npm.io
0.0.11 • Published 6 years ago

json-spider

Licence
MIT
Version
0.0.11
Deps
0
Size
89 kB
Vulns
0
Weekly
0

NPM

Json-Spider

Constant expression

// Will output 1

console.log(calculateExpression({
    type: 'CONSTANT',
    value: 'test',
    valueType: 'STRING'
}));

Division expression

// Will output 10

console.log(calculateExpression({
  type: 'EXP_DIVISION',
  left: {
      type: 'CONSTANT',
      value: 100,
      valueType: 'NUMBER'
  },
  right: {
      type: 'CONSTANT',
      value: 10,
      valueType: 'NUMBER'
  }
}))