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

Function shallowCopy

lib/utils.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/**
25 * Merges two query parameter objects. Merges to array

Callers 3

createServerFunction · 0.70
mergeQsFunction · 0.70
serverMethodFactoryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected