MCPcopy Create free account
hub / github.com/avoidwork/tenso / smartClone

Function smartClone

src/utils/sort.js:21–23  ·  view source on GitHub ↗

* Clones data efficiently based on whether it contains undefined values * @param {*} arg - The data to clone * @returns {*} The cloned data

(arg)

Source from the content-addressed store, hash-verified

19 * @returns {*} The cloned data
20 */
21function smartClone (arg) {
22 return hasUndefined(arg) ? structuredClone(arg) : clone(arg);
23}
24
25/**
26 * Sorts an array based on query parameters in the request

Callers 1

sortFunction · 0.85

Calls 2

cloneFunction · 0.90
hasUndefinedFunction · 0.85

Tested by

no test coverage detected