MCPcopy Index your code
hub / github.com/restify/node-restify / shallowCopy

Function shallowCopy

lib/plugins/utils/shallowCopy.js:13–22  ·  view source on GitHub ↗

* Return a shallow copy of the given object * * @public * @function shallowCopy * @param {Object} obj - the object to copy * @returns {Object} the new copy of the object

(obj)

Source from the content-addressed store, hash-verified

11 * @returns {Object} the new copy of the object
12 */
13function shallowCopy(obj) {
14 if (!obj) {
15 return obj;
16 }
17 var copy = {};
18 Object.keys(obj).forEach(function forEach(k) {
19 copy[k] = obj[k];
20 });
21 return copy;
22}
23
24///--- Exports
25

Callers 2

requestLoggerFunction · 0.50
serveStaticFilesFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected