jinaga
Version:
Data management for web and mobile applications.
25 lines • 594 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toJSON = void 0;
function toJSON(value) {
if (hasProperty(value, "toJSON")) {
return value.toJSON();
}
else {
return value;
}
}
exports.toJSON = toJSON;
function hasProperty(value, name) {
while (value !== null) {
if (typeof (value) !== "object") {
return false;
}
if (value.hasOwnProperty(name)) {
return true;
}
value = Object.getPrototypeOf(value);
}
return false;
}
//# sourceMappingURL=obj.js.map