Module

flat

Methods

# static filterOutParams(params, properties) → {FlattenParams}

Parameters:
Name Type Description
params FlattenParams
properties string | Array.<string>

View Source adminjs/src/utils/flat/filter-out-params.ts, line 10

# static get(params, propertyPathopt, options) → {any}

Parameters:
Name Type Attributes Description
params FlattenParams

flatten params from which property has to be taken

propertyPath string <optional>

name of the property

options GetOptions

options

View Source adminjs/src/utils/flat/get.ts, line 17

when property key exists directly it returns what is inside, otherwise it tries to find any nested objects and returns them

any

# static merge(params) → {FlattenParams}

Merges params together and returns flatten result

Parameters:
Name Type Description
params any
...mergeParams Array.<any>

View Source adminjs/src/utils/flat/merge.ts, line 12

# static removePath(params, …properties) → {FlattenParams}

Parameters:
Name Type Attributes Description
params FlattenParams
properties string <repeatable>

View Source adminjs/src/utils/flat/remove-path.ts, line 14

# static selectParams(params, properties, optionsopt) → {FlattenParams}

Parameters:
Name Type Attributes Description
params FlattenParams
properties string | Array.<string>
options GetOptions <optional>

View Source adminjs/src/utils/flat/select-params.ts, line 11

# static set(params, propertyPath, valueopt) → {FlattenParams}

Parameters:
Name Type Attributes Description
params FlattenParams
propertyPath string
value any <optional>

if not give function will only try to remove old keys

View Source adminjs/src/utils/flat/set.ts, line 22

# pathToParts(propertyPath, options) → {PathParts}

Parameters:
Name Type Description
propertyPath string
options PathToPartsOptions

View Source adminjs/src/utils/flat/path-to-parts.ts, line 11

PathParts

Type Definitions

object

# FlattenParams

Type of flatten params.

Properties:
Name Type Description
{...} FlattenValue

View Source adminjs/src/utils/flat/flat.types.ts, line 17

Union

# FlattenValue

Available types for flatten values. This is an Union of types:

  • string
  • boolean
  • number
  • Date
  • null
  • [] (empty array)
  • {} (empty object)
  • File

View Source adminjs/src/utils/flat/flat.types.ts, line 2

object

# GetOptions

Properties:
Name Type Attributes Description
includeAllSiblings boolean <optional>

Indicates if all the "less related" siblings should be included. This option takes care of, fetching elements in nested arrays. Let's say you have keys: nested.0.array.0 and , nested.1.array.0.. With includeAllSiblings` you will fetch all nested.N.array elements.

View Source adminjs/src/utils/flat/flat.types.ts, line 26

object

# PathToPartsOptions

Properties:
Name Type Attributes Description
skipArrayIndexes boolean <optional>

Indicates if array indexes should be skipped from the outcome.

View Source adminjs/src/utils/flat/path-to-parts.ts, line 30