mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Don't expose constants directly in initializers/
This commit is contained in:
parent
6dd9de95df
commit
74dc3bca2b
114 changed files with 168 additions and 144 deletions
|
@ -11,14 +11,13 @@ import * as pem from 'pem'
|
|||
import { URL } from 'url'
|
||||
import { truncate } from 'lodash'
|
||||
import { exec } from 'child_process'
|
||||
import { isArray } from './custom-validators/misc'
|
||||
|
||||
const objectConverter = (oldObject: any, keyConverter: (e: string) => string, valueConverter: (e: any) => any) => {
|
||||
if (!oldObject || typeof oldObject !== 'object') {
|
||||
return valueConverter(oldObject)
|
||||
}
|
||||
|
||||
if (isArray(oldObject)) {
|
||||
if (Array.isArray(oldObject)) {
|
||||
return oldObject.map(e => objectConverter(e, keyConverter, valueConverter))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue