Map from one object to another using JSON pointers.
npm install map-pointer --save
schema
(object, string or array) The schema to map ontoinput
(any) The input object to select from
import { map } from 'map-pointer'
const schema = {
sub: '/id',
name: '/full_name'
}
const input = {
id: 123,
full_name: 'Blake Embrey'
}
map(schema, input) //=> { sub: 123, name: 'Blake Embrey' }
Apache 2.0