@symblight/toolset
v0.1.8
Published
## get started ```bash npm install @symblight/toolset ```
Downloads
26
Readme
Javascript toolset
get started
npm install @symblight/toolset
tools
getIn
import { getIn } from '@symblight/toolset'
const game = {
name: 'cyberpunk',
state: {
title: 'Game',
type: {
tag: 'dev',
},
},
}
const result = getIn(game, ['state', 'type', 'tag']) // output: dev
setIn
import { setIn } from '@symblight/toolset'
const game = {
name: 'cyberpunk',
state: {
title: 'Game',
type: {
tag: 'dev',
},
},
}
const result = setIn(game, ['state', 'type', 'tag'], 'prod') // output: object game
removeIn
import { removeIn } from '@symblight/toolset'
const game = {
name: 'cyberpunk',
state: {
title: 'Game',
type: {
tag: 'dev',
},
},
}
const result = removeIn(game, ['state', 'type', 'tag']) // output: object game
updateIn
import { updateIn } from '@symblight/toolset'
const game = {
name: 'cyberpunk',
state: {
title: 'Game',
type: {
tag: 'dev',
},
},
}
const result = updateIn(game, ['state', 'type'], (type) => ({ tag: 'prod', version: 1 })) // output: object game