@cmtlyt/logger
Version:
2 lines • 966 B
JavaScript
function e(e){return e}function t(e){let t=new Map,n=JSON.stringify(e,(e,n)=>{if("bigint"==typeof n)return n.toString();if("function"==typeof n){let e=n.toString();return e.includes("=>")||e.startsWith("function")?e:`function ${e}`}if("object"==typeof n){if(t.has(n)){let e=t.get(n);return`[Circular ${e?`key: ${e}`:"self"}]`}return t.set(n,e),n}return n},2);return n&&"function"==typeof n.replace?n.replace(/\n(\s+)/g,(e,{length:t})=>`
${"\xa0".repeat(t)}`):n}function n(){return void 0!==globalThis.window}function r(){return"undefined"!=typeof process&&!!(process.versions&&process.versions.node)}function i(e){let t=new Set(["debug","info","warn","error"]);if(!e)return t;if("function"==typeof e)return e;if(Array.isArray(e)){let n=new Set(t);return e.forEach(e=>{n.add(e)}),n}return e}function o(e,t){return"function"==typeof t?t(e):t.has(e)}export{i as createAllowTypesChecker,e as defineAdapter,r as isNode,o as isTypeAllowed,n as isWeb,t as objectStringify};