Initial commit

This commit is contained in:
bilulib
2025-04-13 00:18:57 +02:00
parent cff009bb7c
commit d894249e61
18301 changed files with 2905442 additions and 3845 deletions

View File

@@ -0,0 +1,2 @@
export declare function stableHash(arg: any): string;
export default stableHash;

View File

@@ -0,0 +1 @@
var u=Object.defineProperty;var r=t=>u(t,"__esModule",{value:!0});var y=(t,o)=>{r(t);for(var s in o)u(t,s,{get:o[s],enumerable:!0})};y(exports,{default:()=>b,stableHash:()=>c});const i=new WeakMap;let p=0;function c(t){const o=typeof t,s=t&&t.constructor,f=s==Date;if(Object(t)===t&&!f&&s!=RegExp){let e=i.get(t);if(e)return e;e=++p+"~",i.set(t,e);let n;if(s==Array){for(e="@",n=0;n<t.length;n++)e+=c(t[n])+",";i.set(t,e)}else if(s==Object){e="#";const l=Object.keys(t).sort();for(;(n=l.pop())!==void 0;)t[n]!==void 0&&(e+=n+":"+c(t[n])+",");i.set(t,e)}return e}return f?t.toJSON():o=="symbol"?t.toString():o=="string"?JSON.stringify(t):""+t}var b=c;

View File

@@ -0,0 +1 @@
const o=new WeakMap;let u=0;export function stableHash(t){const i=typeof t,s=t&&t.constructor,c=s==Date;if(Object(t)===t&&!c&&s!=RegExp){let e=o.get(t);if(e)return e;e=++u+"~",o.set(t,e);let n;if(s==Array){for(e="@",n=0;n<t.length;n++)e+=stableHash(t[n])+",";o.set(t,e)}else if(s==Object){e="#";const f=Object.keys(t).sort();for(;(n=f.pop())!==void 0;)t[n]!==void 0&&(e+=n+":"+stableHash(t[n])+",");o.set(t,e)}return e}return c?t.toJSON():i=="symbol"?t.toString():i=="string"?JSON.stringify(t):""+t}export default stableHash;