summaryrefslogtreecommitdiff
path: root/node_modules/@jet/environment/util/clone.js
blob: 594a597f8dcde6e206e5c65bfbf0e8be75d401ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shallowCloneOf = void 0;
/**
 * Create a copy of a given object without copying any of its members.
 *
 * Use this function to efficiently copy an object for your
 * implementation of the `Clone` interface.
 *
 * @param object - An object to create a shallow copy of.
 * @returns A new shallow copy of `object`.
 */
function shallowCloneOf(object) {
    const copy = Object.create(Object.getPrototypeOf(object));
    return Object.assign(copy, object);
}
exports.shallowCloneOf = shallowCloneOf;
//# sourceMappingURL=clone.js.map