@nodescript/stdlib
Version:
Standard Node Definitions
27 lines (26 loc) • 605 B
JavaScript
export const module = {
version: '1.3.5',
moduleName: 'Object / Get',
labelParam: 'key',
description: `
Gets a value at specified key.
Key can be a JSON pointer or a dot-delimited path.
`,
params: {
object: {
schema: { type: 'any' },
},
key: {
schema: { type: 'string' },
attributes: {
pathof: 'object',
},
}
},
result: {
schema: { type: 'any' },
},
};
export const compute = (params, ctx) => {
return ctx.lib.get(params.object, params.key);
};