@haelp/teto
Version:
A typescript-based controllable TETR.IO client.
27 lines (26 loc) • 775 B
JavaScript
export * from "./damageCalc/index.mjs";
export * from "./increase/index.mjs";
export * from "./kicks/index.mjs";
export * from "./tetromino/index.mjs";
export * from "./seed.mjs";
export * from "./polyfills/index.mjs";
export * from "./rng/index.mjs";
export function deepCopy(obj, handlers = []) {
if (obj === null || obj === undefined || typeof obj !== "object") {
return obj;
}
for (const h of handlers){
if (obj instanceof h.type) {
return h.copy(obj);
}
}
if (Array.isArray(obj)) {
return obj.map((item)=>deepCopy(item, handlers));
}
const out = {};
for (const key of Object.keys(obj)){
out[key] = deepCopy(obj[key], handlers);
}
return out;
}
//# sourceMappingURL=index.js.map