flowcode
Version:
Tools for building dataflow graphs
25 lines • 548 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Returns a shallow copy of the specified value.
* @param a
*/
function copy(a) {
if (a instanceof Array) {
return a.slice();
}
else if (a instanceof Object) {
const result = {};
// tslint:disable:forin
for (const key in a) {
result[key] = a[key];
}
// tslint:enable:forin
return result;
}
else {
return a;
}
}
exports.copy = copy;
//# sourceMappingURL=copy.js.map
;