feat(PocomathInstance): Add subtypesOf and isSubtypeOf methods

Note this involves refeactoring the internal subtype tracker to keep
  subtypes in a list sorted in topological order.
This commit is contained in:
Glen Whitney 2022-08-12 09:10:53 -07:00
parent 340dbd436e
commit dc6921e768
2 changed files with 39 additions and 11 deletions

View file

@ -22,6 +22,7 @@ describe('The default full pocomath instance "math"', () => {
it('can determine the return types of operations', () => {
assert.strictEqual(math.returnTypeOf('negate', 'number'), 'number')
assert.strictEqual(math.returnTypeOf('negate', 'NumInt'), 'NumInt')
})
it('can subtract numbers', () => {