UNPKG

jkstra

Version:

Small JavaScript graph routing library

36 lines (29 loc) 968 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.propsMatch = propsMatch; function isScalar(o) { return (/boolean|number|string/.test(typeof o === "undefined" ? "undefined" : _typeof(o)) ); }; function propsMatch(set, subSet) { if (subSet === null) { return set === null; } if (isScalar(set)) { return isScalar(subSet) && set === subSet; } for (var p in subSet) { if (set.hasOwnProperty(p)) { if (!propsMatch(set[p], subSet[p])) { return false; } } else { return false; } } return true; }; //# sourceMappingURL=utils.js.map