Bringing points stuff up to spec

This commit is contained in:
Bán Dénes 2020-06-26 21:00:10 +02:00
parent 0ab5a246e5
commit a5e686b059
11 changed files with 474 additions and 108 deletions

View file

@ -1,7 +1,19 @@
const m = require('makerjs')
exports.assert = (exp, msg) => {
if (!exp) {
throw new Error(msg)
}
}
exports.deepcopy = (value) => JSON.parse(JSON.stringify(value))
exports.type = (val) => {
if (Array.isArray(val)) return 'array'
if (val === null) return 'null'
return typeof val
}
const eq = exports.eq = (a=[], b=[]) => {
return a[0] === b[0] && a[1] === b[1]
}