@lunora/wire 1.0.0-alpha.1 → 1.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{default as o}from"./packem_shared/stableStringify-KwgJVih9.mjs";import{WIRE_TAG as d,decodeDocument as i,decodeWire as n,encodeArgsOrThrow as a,encodeWire as c,needsWireEncoding as f}from"./packem_shared/WIRE_TAG-DIesFsHE.mjs";import{default as l}from"./packem_shared/stableWireKey-B2We0yhx.mjs";import{isPlainObject as W}from"./packem_shared/isPlainObject-UM7p1XXO.mjs";export{d as WIRE_TAG,i as decodeDocument,n as decodeWire,a as encodeArgsOrThrow,c as encodeWire,W as isPlainObject,f as needsWireEncoding,o as stableStringify,l as stableWireKey};
1
+ import{default as o}from"./packem_shared/stableStringify-rlPCO-eR.mjs";import{WIRE_TAG as d,decodeDocument as i,decodeWire as n,encodeArgsOrThrow as a,encodeWire as c,needsWireEncoding as f}from"./packem_shared/WIRE_TAG-DIesFsHE.mjs";import{default as l}from"./packem_shared/stableWireKey-CHXf9QAT.mjs";import{isPlainObject as W}from"./packem_shared/isPlainObject-UM7p1XXO.mjs";export{d as WIRE_TAG,i as decodeDocument,n as decodeWire,a as encodeArgsOrThrow,c as encodeWire,W as isPlainObject,f as needsWireEncoding,o as stableStringify,l as stableWireKey};
@@ -0,0 +1 @@
1
+ const p=/["\\\u0000-\u001F\uD800-\uDFFF]/,c=t=>p.test(t)?JSON.stringify(t):`"${t}"`,b=t=>Number.isNaN(t)?"nan":t===1/0?"inf":t===-1/0?"-inf":Object.is(t,-0)?"-0":void 0,u=(t,r)=>{const o=Object.getPrototypeOf(t);if(o!==null&&o!==Object.prototype){const i=t.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${i} in a stable JSON cache key — only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}const e=t,a=Object.keys(e).sort();let n="{",s=!0;for(const i of a){const f=e[i];f!==void 0&&(s?s=!1:n+=",",n+=c(i),n+=":",n+=r(f))}return`${n}}`},y=t=>{if(t===void 0)return"null";if(typeof t=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key — pass it as a string, or use stableWireKey");if(typeof t=="function"||typeof t=="symbol")throw new TypeError(`stableStringify: cannot use a ${typeof t} in a stable JSON cache key — only plain objects, arrays, and JSON primitives are supported`);if(typeof t=="number"){const r=b(t);if(r!==void 0)return r}return typeof t=="string"?c(t):t===null||typeof t!="object"?JSON.stringify(t):Array.isArray(t)?`[${Array.from({length:t.length},(o,e)=>y(t[e])).join(",")}]`:u(t,y)};export{y as default};
@@ -1 +1 @@
1
- import r from"./stableStringify-KwgJVih9.mjs";import{encodeWire as t}from"./WIRE_TAG-DIesFsHE.mjs";import"./isPlainObject-UM7p1XXO.mjs";const a=e=>r(t(e));export{a as default};
1
+ import r from"./stableStringify-rlPCO-eR.mjs";import{encodeWire as t}from"./WIRE_TAG-DIesFsHE.mjs";import"./isPlainObject-UM7p1XXO.mjs";const a=e=>r(t(e));export{a as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/wire",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.2",
4
4
  "description": "Wire codec and stable keys shared by every Lunora tier",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -1 +0,0 @@
1
- const b=/["\\\u0000-\u001F\uD800-\uDFFF]/,y=t=>b.test(t)?JSON.stringify(t):`"${t}"`,p=t=>Number.isNaN(t)?"nan":t===1/0?"inf":t===-1/0?"-inf":Object.is(t,-0)?"-0":void 0,u=(t,r)=>{const o=Object.getPrototypeOf(t);if(o!==null&&o!==Object.prototype){const i=t.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${i} in a stable JSON cache key — only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}const e=t,a=Object.keys(e).sort();let n="{",s=!0;for(const i of a){const f=e[i];f!==void 0&&(s?s=!1:n+=",",n+=y(i),n+=":",n+=r(f))}return`${n}}`},c=t=>{if(t===void 0)return"null";if(typeof t=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key — pass it as a string, or use stableWireKey");if(typeof t=="number"){const r=p(t);if(r!==void 0)return r}return typeof t=="string"?y(t):t===null||typeof t!="object"?JSON.stringify(t):Array.isArray(t)?`[${Array.from({length:t.length},(o,e)=>c(t[e])).join(",")}]`:u(t,c)};export{c as default};