External module "ancient-cursor/src/lib/bundle"
Type aliases
TBundlePath
TBundlePath: string
TBundleSelector
TBundleSelector: any
Functions
getByPath
- getByPath(data: any, path: any): any
prepare
- prepare(container: any, bundle: any): object
-
Parameters
-
container: any
-
bundle: any
Returns object
Object literals
Const bundleParsers
bundleParsers: object
extend
-
Parameters
Returns object
-
-
bundlePath: string[]
-
data: any
-
newValue: any
move
-
Parameters
Returns object
-
-
bundlePath: string[]
-
data: any
-
newValue: any[]
push
-
Parameters
Returns object
-
-
bundlePath: string[]
-
data: any
-
newValue: any[]
remove
- remove(container: object, bundle: IBundle): object
-
Parameters
Returns object
-
-
bundlePath: string[]
-
data: any
-
newValue: any[]
set
-
Parameters
Returns object
-
-
bundlePath: string[]
-
data: any
-
newValue: any
splice
-
Parameters
Returns object
-
-
bundlePath: string[]
-
data: any
-
newValue: any[]
unset
- unset(container: object, bundle: IBundle): object
-
Parameters
Returns object
-
-
bundlePath: string[]
-
data: any
-
newValue: any
Get value by paths in data.
import { get, TBundlePaths, } from 'ancient-cursor/lib/bundle'; const paths:TBundlePaths = ['a', { b:2 }, 'c']; const path:TBundlePaths = 'a.1.c'; const data = { a:[{ b:3, c:4 }, { b:2, c:5 }] }; console.log (get (data, paths)); // 5 console.log (get (data, path)); // 5