Intial Commit
This commit is contained in:
3
nodered/rootfs/data/node_modules/mathjs/lib/json/index.js
generated
vendored
Normal file
3
nodered/rootfs/data/node_modules/mathjs/lib/json/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = [
|
||||
require('./reviver')
|
||||
];
|
||||
22
nodered/rootfs/data/node_modules/mathjs/lib/json/reviver.js
generated
vendored
Normal file
22
nodered/rootfs/data/node_modules/mathjs/lib/json/reviver.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
function factory (type, config, load, typed) {
|
||||
/**
|
||||
* Instantiate mathjs data types from their JSON representation
|
||||
* @param {string} key
|
||||
* @param {*} value
|
||||
* @returns {*} Returns the revived object
|
||||
*/
|
||||
return function reviver(key, value) {
|
||||
var constructor = type[value && value.mathjs];
|
||||
if (constructor && typeof constructor.fromJSON === 'function') {
|
||||
return constructor.fromJSON(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
exports.name = 'reviver';
|
||||
exports.path = 'json';
|
||||
exports.factory = factory;
|
||||
Reference in New Issue
Block a user