Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 425 Bytes

README.md

File metadata and controls

18 lines (12 loc) · 425 Bytes

Json Mapper

Maps one json structure to another, according to a declared specification.

const globals = { time: Date.now() }

const mapper = JsonMapper.fromString(`{
  input / .
  createdAt / ^..&.time
}`, globals)

const output = mapper.map({ some: 'input' })

console.dir(output) // { createdAt: <Date.now()>, input: { some: 'input' } }

Please see the documentation for more info.