@lowerdeck/serialize 1.0.2 → 1.0.4
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/package.json +9 -3
- package/.turbo/turbo-build.log +0 -11
- package/.turbo/turbo-test.log +0 -22
- package/CHANGELOG.md +0 -13
- package/dist/index.modern.js +0 -2
- package/dist/index.modern.js.map +0 -1
- package/tsconfig.json +0 -11
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowerdeck/serialize",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
+
"files": [
|
|
8
|
+
"src/**",
|
|
9
|
+
"dist/**",
|
|
10
|
+
"README.md",
|
|
11
|
+
"package.json"
|
|
12
|
+
],
|
|
7
13
|
"author": "Tobias Herber",
|
|
8
14
|
"license": "Apache 2",
|
|
9
15
|
"type": "module",
|
|
@@ -21,14 +27,14 @@
|
|
|
21
27
|
"scripts": {
|
|
22
28
|
"test": "vitest run --passWithNoTests",
|
|
23
29
|
"lint": "prettier src/**/*.ts --check",
|
|
24
|
-
"build": "microbundle"
|
|
30
|
+
"build": "rm -rf ./dist && microbundle"
|
|
25
31
|
},
|
|
26
32
|
"dependencies": {
|
|
27
33
|
"superjson": "^2.2.5"
|
|
28
34
|
},
|
|
29
35
|
"devDependencies": {
|
|
30
36
|
"microbundle": "^0.15.1",
|
|
31
|
-
"@lowerdeck/tsconfig": "^1.0.
|
|
37
|
+
"@lowerdeck/tsconfig": "^1.0.1",
|
|
32
38
|
"typescript": "5.8.2",
|
|
33
39
|
"vitest": "^3.1.2"
|
|
34
40
|
}
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
[0m[2m[35m$[0m [2m[1mmicrobundle[0m
|
|
3
|
-
[34mBuild "@lowerdeck/serialize" to dist:[39m
|
|
4
|
-
[32m556 B[39m: [37mindex.cjs[39m.gz
|
|
5
|
-
[32m475 B[39m: [37mindex.cjs[39m.br
|
|
6
|
-
[32m531 B[39m: [37mindex.module.js[39m.gz
|
|
7
|
-
[32m453 B[39m: [37mindex.module.js[39m.br
|
|
8
|
-
[32m520 B[39m: [37mindex.module.js[39m.gz
|
|
9
|
-
[32m440 B[39m: [37mindex.module.js[39m.br
|
|
10
|
-
[32m635 B[39m: [37mindex.umd.js[39m.gz
|
|
11
|
-
[32m545 B[39m: [37mindex.umd.js[39m.br
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
[0m[2m[35m$[0m [2m[1mvitest run --passWithNoTests[0m
|
|
3
|
-
[?25l
|
|
4
|
-
[1m[46m RUN [49m[22m [36mv3.2.4 [39m[90m/Users/tobias/code/metorial/metorial-enterprise/oss/src/packages/backend/serialize[39m
|
|
5
|
-
|
|
6
|
-
[?2026h
|
|
7
|
-
[1m[33m ❯ [39m[22msrc/json.test.ts[2m [queued][22m
|
|
8
|
-
|
|
9
|
-
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
10
|
-
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
11
|
-
[2m Start at [22m10:23:32
|
|
12
|
-
[2m Duration [22m101ms
|
|
13
|
-
[?2026l[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K [32m✓[39m src/json.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
14
|
-
[32m✓[39m serialize[2m > [22mencode should return encoded data[32m 1[2mms[22m[39m
|
|
15
|
-
[32m✓[39m serialize[2m > [22mdecode should return decoded data[32m 0[2mms[22m[39m
|
|
16
|
-
|
|
17
|
-
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
18
|
-
[2m Tests [22m [1m[32m2 passed[39m[22m[90m (2)[39m
|
|
19
|
-
[2m Start at [22m 10:23:32
|
|
20
|
-
[2m Duration [22m 222ms[2m (transform 30ms, setup 0ms, collect 32ms, tests 2ms, environment 0ms, prepare 39ms)[22m
|
|
21
|
-
|
|
22
|
-
[?25h
|
package/CHANGELOG.md
DELETED
package/dist/index.modern.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e from"superjson";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(null,arguments)}function r(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}const n=["$$TYPES$$"],o=["__mode"];let a={encode:r=>{var n;let o=e.serialize(r);return null!=(n=o.meta)&&n.referentialEqualities&&delete o.meta.referentialEqualities,JSON.stringify(t({$$TYPES$$:t({__mode:"object"==typeof o.json?"object":"value"},o.meta),data:"object"!=typeof o.json?o.json:void 0},"object"==typeof o.json?o.json:{}))},decode:t=>{if("string"==typeof t&&(t=JSON.parse(t)),"object"!=typeof t)return t;let{$$TYPES$$:a}=t,i=r(t,n);if("object"!=typeof a||!a.__mode)return t;let{__mode:l}=a,f=r(a,o);return e.deserialize({json:"value"==l?i.data:i,meta:f})}};export{a as serialize};
|
|
2
|
-
//# sourceMappingURL=index.modern.js.map
|
package/dist/index.modern.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.js","sources":["../src/json.ts"],"sourcesContent":["// @ts-ignore\nimport SuperJSON from 'superjson';\n\nexport let serialize = {\n encode: (data: any) => {\n let sup = SuperJSON.serialize(data);\n\n if (sup.meta?.referentialEqualities) {\n delete sup.meta.referentialEqualities;\n }\n\n return JSON.stringify({\n $$TYPES$$: {\n __mode: typeof sup.json == 'object' ? 'object' : 'value',\n ...sup.meta\n },\n\n data: typeof sup.json != 'object' ? sup.json : undefined,\n\n ...(typeof sup.json == 'object' ? sup.json : {})\n });\n },\n\n decode: (data: any) => {\n if (typeof data == 'string') data = JSON.parse(data);\n\n if (typeof data != 'object') return data;\n\n let { $$TYPES$$, ...rest } = data;\n\n if (typeof $$TYPES$$ != 'object' || !$$TYPES$$.__mode) return data;\n\n let { __mode, ...meta } = $$TYPES$$;\n let json = __mode == 'value' ? rest.data : rest;\n\n return SuperJSON.deserialize({ json, meta });\n }\n};\n"],"names":["serialize","encode","data","_sup$meta","sup","SuperJSON","meta","referentialEqualities","JSON","stringify","_extends","$$TYPES$$","__mode","json","undefined","decode","parse","rest","_objectWithoutPropertiesLoose","_excluded","_excluded2","deserialize"],"mappings":"iaAGW,IAAAA,EAAY,CACrBC,OAASC,IAAa,IAAAC,EACpB,IAAIC,EAAMC,EAAUL,UAAUE,GAM9B,OAJIC,OAAJA,EAAIC,EAAIE,OAAJH,EAAUI,8BACLH,EAAIE,KAAKC,sBAGXC,KAAKC,UAASC,EACnBC,CAAAA,UAASD,GACPE,OAA2B,iBAAZR,EAAIS,KAAmB,SAAW,SAC9CT,EAAIE,MAGTJ,KAAyB,iBAAZE,EAAIS,KAAmBT,EAAIS,UAAOC,GAExB,iBAAZV,EAAIS,KAAmBT,EAAIS,KAAO,CAAA,KAIjDE,OAASb,IAGP,GAFmB,iBAARA,IAAkBA,EAAOM,KAAKQ,MAAMd,IAE5B,iBAARA,EAAkB,OAAOA,EAEpC,IAAIS,UAAEA,GAAuBT,EAATe,EAAIC,EAAKhB,EAAIiB,GAEjC,GAAwB,iBAAbR,IAA0BA,EAAUC,OAAQ,OAAOV,EAE9D,IAAIU,OAAEA,GAAoBD,EAATL,EAAIY,EAAKP,EAASS,GAGnC,OAAOf,EAAUgB,YAAY,CAAER,KAFV,SAAVD,EAAoBK,EAAKf,KAAOe,EAENX"}
|
package/tsconfig.json
DELETED