UNPKG

reactotron-plugin-zustand

Version:
54 lines (52 loc) 1.71 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/utils.ts var utils_exports = {}; __export(utils_exports, { omitFunctionRecursively: () => omitFunctionRecursively }); module.exports = __toCommonJS(utils_exports); function omitFunctionRecursively(input, enable) { if (!enable) { return input; } return removeFunctions(input); } function removeFunctions(value) { if (typeof value !== "object" || value === null) { return value; } if (Array.isArray(value)) { return value.map(removeFunctions).filter((item) => typeof item !== "function"); } const newObj = {}; for (const key in value) { if (value.hasOwnProperty(key)) { const cleanedValue = removeFunctions(value[key]); if (typeof cleanedValue !== "function") { newObj[key] = cleanedValue; } } } return newObj; } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { omitFunctionRecursively });