zeed 1.0.21 → 1.1.1
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/README.md +217 -234
- package/dist/{chunk-2Z75UI2C.js → chunk-3LSWLKUP.js} +2 -2
- package/dist/{chunk-Z3CCAUP7.js → chunk-4X7UJTXJ.js} +2 -2
- package/dist/chunk-5RJ6XORD.cjs +2 -0
- package/dist/chunk-5RJ6XORD.cjs.map +1 -0
- package/dist/{chunk-AVGEBKCV.js → chunk-5WAO44ET.js} +2 -2
- package/dist/{chunk-EXAC332B.cjs → chunk-DAD3M2IM.cjs} +2 -2
- package/dist/{chunk-EXAC332B.cjs.map → chunk-DAD3M2IM.cjs.map} +1 -1
- package/dist/{chunk-OWX5SXG3.js → chunk-FGAKPO3O.js} +2 -2
- package/dist/{chunk-4VAH6DEB.js → chunk-IBGLNGGT.js} +2 -2
- package/dist/{chunk-4K3FOY2Z.js → chunk-IQWBYSWG.js} +2 -2
- package/dist/chunk-JWON4PLZ.cjs +2 -0
- package/dist/{chunk-67WN7TPU.cjs.map → chunk-JWON4PLZ.cjs.map} +1 -1
- package/dist/{chunk-PCT5BR7B.cjs → chunk-K4IRAHZV.cjs} +2 -2
- package/dist/{chunk-PCT5BR7B.cjs.map → chunk-K4IRAHZV.cjs.map} +1 -1
- package/dist/{chunk-IMURZASN.js → chunk-KIKHNNKK.js} +2 -2
- package/dist/{chunk-KJKNVADW.cjs → chunk-L5OF6DSH.cjs} +2 -2
- package/dist/{chunk-KJKNVADW.cjs.map → chunk-L5OF6DSH.cjs.map} +1 -1
- package/dist/chunk-LAGM3ULD.js +1 -0
- package/dist/chunk-LLDVPAUS.js +2 -0
- package/dist/chunk-LLDVPAUS.js.map +1 -0
- package/dist/chunk-MIEXPALS.cjs +1 -0
- package/dist/chunk-MIEXPALS.cjs.map +1 -0
- package/dist/chunk-MQNZQKBT.js +1 -0
- package/dist/chunk-MQNZQKBT.js.map +1 -0
- package/dist/chunk-NPQ77LO4.cjs +1 -0
- package/dist/chunk-NPQ77LO4.cjs.map +1 -0
- package/dist/{chunk-IQQCKTKP.cjs → chunk-NVLJOTGF.cjs} +2 -2
- package/dist/{chunk-IQQCKTKP.cjs.map → chunk-NVLJOTGF.cjs.map} +1 -1
- package/dist/{chunk-GRMMMGD6.cjs → chunk-RMTW3TW2.cjs} +2 -2
- package/dist/{chunk-GRMMMGD6.cjs.map → chunk-RMTW3TW2.cjs.map} +1 -1
- package/dist/chunk-SHOLGUSO.cjs +2 -0
- package/dist/{chunk-2DDHD4HB.cjs.map → chunk-SHOLGUSO.cjs.map} +1 -1
- package/dist/{chunk-W4VPTJY3.js → chunk-UAU7GDLR.js} +2 -2
- package/dist/{chunk-YNFT35YQ.js → chunk-UFYY2K4G.js} +2 -2
- package/dist/{chunk-4GFUK2NK.cjs → chunk-VR7T3I5N.cjs} +2 -2
- package/dist/{chunk-4GFUK2NK.cjs.map → chunk-VR7T3I5N.cjs.map} +1 -1
- package/dist/chunk-ZEQQVU3K.cjs +2 -0
- package/dist/{chunk-6CVV5WAD.cjs.map → chunk-ZEQQVU3K.cjs.map} +1 -1
- package/dist/common/bin/index.cjs +1 -1
- package/dist/common/bin/index.js +1 -1
- package/dist/common/bin/lib0/buffer.cjs +1 -1
- package/dist/common/bin/lib0/buffer.js +1 -1
- package/dist/common/bin/lib0/decoding.cjs +1 -1
- package/dist/common/bin/lib0/decoding.js +1 -1
- package/dist/common/bin/lib0/encoding.cjs +1 -1
- package/dist/common/bin/lib0/encoding.js +1 -1
- package/dist/common/data/datauri.cjs +1 -1
- package/dist/common/data/datauri.js +1 -1
- package/dist/common/data/index.cjs +1 -1
- package/dist/common/data/index.js +1 -1
- package/dist/common/index.cjs +1 -1
- package/dist/common/index.cjs.map +1 -1
- package/dist/common/index.d.cts +1 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js +1 -1
- package/dist/common/schema/export-json-schema.cjs +1 -1
- package/dist/common/schema/export-json-schema.js +1 -1
- package/dist/common/schema/export-swift.cjs +1 -1
- package/dist/common/schema/export-swift.js +1 -1
- package/dist/common/schema/index.cjs +1 -1
- package/dist/common/schema/index.cjs.map +1 -1
- package/dist/common/schema/index.d.cts +1 -0
- package/dist/common/schema/index.d.ts +1 -0
- package/dist/common/schema/index.js +1 -1
- package/dist/common/schema/parse-args.cjs +1 -1
- package/dist/common/schema/parse-args.js +1 -1
- package/dist/common/schema/parse-env.cjs +1 -1
- package/dist/common/schema/parse-env.js +1 -1
- package/dist/common/schema/parse-object.cjs +1 -1
- package/dist/common/schema/parse-object.js +1 -1
- package/dist/common/schema/schema-standard.cjs +2 -0
- package/dist/common/schema/schema-standard.cjs.map +1 -0
- package/dist/common/schema/schema-standard.d.cts +57 -0
- package/dist/common/schema/schema-standard.d.ts +57 -0
- package/dist/common/schema/schema-standard.js +2 -0
- package/dist/common/schema/schema-standard.js.map +1 -0
- package/dist/common/schema/schema.cjs +1 -1
- package/dist/common/schema/schema.d.cts +10 -0
- package/dist/common/schema/schema.d.ts +10 -0
- package/dist/common/schema/schema.js +1 -1
- package/dist/common/schema/serialize.cjs +1 -1
- package/dist/common/schema/serialize.js +1 -1
- package/dist/common/schema/z-collection.cjs +1 -1
- package/dist/common/schema/z-collection.js +1 -1
- package/dist/common/schema/z.cjs +1 -1
- package/dist/common/schema/z.js +1 -1
- package/dist/common/test.cjs +1 -1
- package/dist/common/test.js +1 -1
- package/dist/index.all.cjs +1 -1
- package/dist/index.all.cjs.map +1 -1
- package/dist/index.all.d.cts +1 -0
- package/dist/index.all.d.ts +1 -0
- package/dist/index.all.js +1 -1
- package/dist/index.browser.cjs +1 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +1 -0
- package/dist/index.browser.d.ts +1 -0
- package/dist/index.browser.js +1 -1
- package/dist/index.node.cjs +1 -1
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.cts +1 -0
- package/dist/index.node.d.ts +1 -0
- package/dist/index.node.js +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/log/index.cjs +1 -1
- package/dist/node/log/index.cjs.map +1 -1
- package/dist/node/log/index.js +1 -1
- package/dist/node/log/log-context-node.cjs +1 -1
- package/dist/node/log/log-context-node.cjs.map +1 -1
- package/dist/node/log/log-context-node.js +1 -1
- package/dist/node/log/log-file-rotation.cjs +1 -1
- package/dist/node/log/log-file-rotation.cjs.map +1 -1
- package/dist/node/log/log-file-rotation.js +1 -1
- package/dist/node/log/log-file.cjs +1 -1
- package/dist/node/log/log-file.cjs.map +1 -1
- package/dist/node/log/log-file.js +1 -1
- package/package.json +2 -2
- package/src/common/schema/README.md +96 -1
- package/src/common/schema/index.ts +1 -0
- package/src/common/schema/schema-standard.spec.ts +327 -0
- package/src/common/schema/schema-standard.ts +76 -0
- package/src/common/schema/schema.ts +225 -0
- package/dist/chunk-2DDHD4HB.cjs +0 -2
- package/dist/chunk-5VUEFXFJ.js +0 -1
- package/dist/chunk-67WN7TPU.cjs +0 -2
- package/dist/chunk-6CVV5WAD.cjs +0 -2
- package/dist/chunk-IPZOSTTO.cjs +0 -1
- package/dist/chunk-IPZOSTTO.cjs.map +0 -1
- package/dist/chunk-UC5TCP5S.cjs +0 -2
- package/dist/chunk-UC5TCP5S.cjs.map +0 -1
- package/dist/chunk-VFRJ7C3X.js +0 -2
- package/dist/chunk-VFRJ7C3X.js.map +0 -1
- /package/dist/{chunk-2Z75UI2C.js.map → chunk-3LSWLKUP.js.map} +0 -0
- /package/dist/{chunk-Z3CCAUP7.js.map → chunk-4X7UJTXJ.js.map} +0 -0
- /package/dist/{chunk-AVGEBKCV.js.map → chunk-5WAO44ET.js.map} +0 -0
- /package/dist/{chunk-OWX5SXG3.js.map → chunk-FGAKPO3O.js.map} +0 -0
- /package/dist/{chunk-4VAH6DEB.js.map → chunk-IBGLNGGT.js.map} +0 -0
- /package/dist/{chunk-4K3FOY2Z.js.map → chunk-IQWBYSWG.js.map} +0 -0
- /package/dist/{chunk-IMURZASN.js.map → chunk-KIKHNNKK.js.map} +0 -0
- /package/dist/{chunk-5VUEFXFJ.js.map → chunk-LAGM3ULD.js.map} +0 -0
- /package/dist/{chunk-W4VPTJY3.js.map → chunk-UAU7GDLR.js.map} +0 -0
- /package/dist/{chunk-YNFT35YQ.js.map → chunk-UFYY2K4G.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,28 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🌱 Zeed
|
|
4
|
+
|
|
5
|
+
**A zero-dependency TypeScript utility library for universal JavaScript**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/zeed)
|
|
8
|
+
[](https://github.com/holtwick/zeed/blob/main/LICENSE)
|
|
9
|
+
[](https://www.typescriptlang.org/)
|
|
10
|
+
|
|
11
|
+
[Documentation](https://zeed.holtwick.de/) • [GitHub](https://github.com/holtwick/zeed) • [Codeberg](https://codeberg.org/holtwick/zeed)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
---
|
|
2
16
|
|
|
3
17
|
> [!CAUTION]
|
|
4
18
|
> The main repository is now at <https://codeberg.org/holtwick/zeed> to strengthen European sovereignty. Learn more at [UnplugTrump](https://holtwick.de/blog/unplug-trump).
|
|
5
19
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
20
|
+
## ✨ Features
|
|
21
|
+
|
|
22
|
+
<table>
|
|
23
|
+
<tr>
|
|
24
|
+
<td width="50%">
|
|
25
|
+
|
|
26
|
+
### 🎯 **Type-Safe**
|
|
27
|
+
Strict TypeScript with full type inference
|
|
28
|
+
|
|
29
|
+
### 📦 **Zero Dependencies**
|
|
30
|
+
Lightweight and completely tree-shakable
|
|
31
|
+
|
|
32
|
+
### 🌍 **Universal**
|
|
33
|
+
Works in browsers, Node.js, Deno, and Bun
|
|
34
|
+
|
|
35
|
+
</td>
|
|
36
|
+
<td width="50%">
|
|
37
|
+
|
|
38
|
+
### ⚡ **Modern ESM**
|
|
39
|
+
ES Modules with CommonJS fallback
|
|
11
40
|
|
|
12
|
-
|
|
41
|
+
### ✅ **Well Tested**
|
|
42
|
+
Comprehensive test coverage
|
|
43
|
+
|
|
44
|
+
### 🔌 **Standard Schema**
|
|
45
|
+
Compatible with tRPC, TanStack, Hono & more
|
|
46
|
+
|
|
47
|
+
</td>
|
|
48
|
+
</tr>
|
|
49
|
+
</table>
|
|
50
|
+
|
|
51
|
+
## 🚀 Quick Start
|
|
13
52
|
|
|
14
53
|
```sh
|
|
15
|
-
npm
|
|
54
|
+
npm install zeed
|
|
55
|
+
# or
|
|
56
|
+
pnpm add zeed
|
|
57
|
+
# or
|
|
58
|
+
yarn add zeed
|
|
16
59
|
```
|
|
17
60
|
|
|
18
|
-
|
|
61
|
+
---
|
|
19
62
|
|
|
20
|
-
|
|
21
|
-
- Github repo at https://github.com/holtwick/zeed
|
|
63
|
+
## 📚 Core Features
|
|
22
64
|
|
|
23
|
-
|
|
65
|
+
### 🪵 Universal Logging
|
|
24
66
|
|
|
25
|
-
Powerful logging for browser and terminal.
|
|
67
|
+
Powerful, filterable logging for browser and terminal with colorful output and stack traces.
|
|
26
68
|
|
|
27
69
|
```ts
|
|
28
70
|
import { Logger } from 'zeed'
|
|
@@ -35,339 +77,280 @@ log.warn('Warning')
|
|
|
35
77
|
log.error('Error')
|
|
36
78
|
```
|
|
37
79
|
|
|
38
|
-
|
|
80
|
+
**Terminal output:**
|
|
39
81
|
|
|
40
82
|
<img src=".assets/node-console@2x.png" width="566" style="max-width:100%">
|
|
41
83
|
|
|
42
|
-
|
|
84
|
+
**Browser output:**
|
|
43
85
|
|
|
44
86
|
<img src=".assets/safari-console.png" style="max-width:100%">
|
|
45
87
|
|
|
46
|
-
|
|
88
|
+
<details>
|
|
89
|
+
<summary>📖 Learn more about logging features</summary>
|
|
47
90
|
|
|
48
|
-
|
|
91
|
+
**Filtering:**
|
|
49
92
|
|
|
50
|
-
|
|
93
|
+
By default, logs are muted. Enable them with filters:
|
|
51
94
|
|
|
95
|
+
**Browser:**
|
|
52
96
|
```ts
|
|
53
97
|
localStorage.zeed = '*'
|
|
54
98
|
```
|
|
55
99
|
|
|
56
|
-
|
|
57
|
-
|
|
100
|
+
**Node.js:**
|
|
58
101
|
```sh
|
|
59
102
|
ZEED=* node myapp.js
|
|
60
103
|
```
|
|
61
104
|
|
|
62
|
-
|
|
105
|
+
You can use advanced filters compatible with [debug syntax](https://github.com/visionmedia/debug#wildcards). Use `ZEED` or `DEBUG` environment variables (`ZEED` supersedes `DEBUG`).
|
|
63
106
|
|
|
64
|
-
|
|
107
|
+
Filter by level: `ZEED_LEVEL=info` to hide debug logs.
|
|
65
108
|
|
|
66
|
-
|
|
109
|
+
Write to file: `ZEED_LOG=/path/to/file.log`
|
|
67
110
|
|
|
68
|
-
|
|
111
|
+
**Log Handlers:**
|
|
69
112
|
|
|
70
|
-
|
|
113
|
+
- `LoggerConsoleHandler(opt)` - Plain console output
|
|
114
|
+
- `LoggerBrowserHandler(opt)` - Colorful browser logs
|
|
115
|
+
- `LoggerNodeHandler(opt)` - Colorful Node.js logs
|
|
116
|
+
- `LoggerFileHandler(path, opt)` - File output with optional rotation
|
|
71
117
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
- `LoggerFileHandler(path, opt)`: Write to file
|
|
118
|
+
**Log Rotation Example:**
|
|
119
|
+
```ts
|
|
120
|
+
import { LoggerFileHandler } from 'zeed'
|
|
76
121
|
|
|
77
|
-
|
|
122
|
+
LoggerFileHandler('/var/log/app.log', {
|
|
123
|
+
rotation: {
|
|
124
|
+
size: '10M',
|
|
125
|
+
maxFiles: 5,
|
|
126
|
+
compress: 'gzip'
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
```
|
|
78
130
|
|
|
79
|
-
|
|
80
|
-
import { LoggerFileHandler } from 'zeed'
|
|
131
|
+
</details>
|
|
81
132
|
|
|
82
|
-
|
|
83
|
-
LoggerFileHandler('/var/log/app.log', {
|
|
84
|
-
rotation: true
|
|
85
|
-
})
|
|
133
|
+
---
|
|
86
134
|
|
|
87
|
-
|
|
88
|
-
LoggerFileHandler('/var/log/app.log', {
|
|
89
|
-
rotation: { interval: '1d' }
|
|
90
|
-
})
|
|
135
|
+
### ⚙️ Async/Promise Utilities
|
|
91
136
|
|
|
92
|
-
|
|
93
|
-
LoggerFileHandler('/var/log/app.log', {
|
|
94
|
-
rotation: {
|
|
95
|
-
size: '10M',
|
|
96
|
-
maxFiles: 5,
|
|
97
|
-
compress: 'gzip'
|
|
98
|
-
}
|
|
99
|
-
})
|
|
137
|
+
Powerful utilities for working with async operations:
|
|
100
138
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
interval: '1h',
|
|
105
|
-
maxSize: '100M',
|
|
106
|
-
compress: true
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
```
|
|
139
|
+
```ts
|
|
140
|
+
// Wait for an event
|
|
141
|
+
await waitOn(emitter, 'action', 1000)
|
|
110
142
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- `interval`: Rotate at time intervals (e.g., `'1d'`, `'1h'`, `'30m'`)
|
|
114
|
-
- `maxFiles`: Maximum number of rotated files to keep
|
|
115
|
-
- `maxSize`: Maximum total size of all log files
|
|
116
|
-
- `compress`: Compress rotated files (`true`, `'gzip'`, or custom compressor function)
|
|
117
|
-
- `rotate`: Number of files to keep in classical rotation mode
|
|
143
|
+
// Sleep for milliseconds
|
|
144
|
+
await sleep(1000)
|
|
118
145
|
|
|
119
|
-
|
|
146
|
+
// Timeout a promise
|
|
147
|
+
await timeout(asyncFn, 1000)
|
|
148
|
+
|
|
149
|
+
// Ensure a value is a Promise
|
|
150
|
+
await promisify(returnValue)
|
|
151
|
+
```
|
|
120
152
|
|
|
121
|
-
|
|
153
|
+
---
|
|
122
154
|
|
|
123
|
-
###
|
|
155
|
+
### 🆔 Unique ID Generation
|
|
124
156
|
|
|
125
|
-
|
|
157
|
+
Multiple ID generation strategies for different use cases:
|
|
126
158
|
|
|
127
|
-
|
|
159
|
+
```ts
|
|
160
|
+
// UUID (Base62, 22 chars) - cryptographically secure
|
|
161
|
+
const id = uuid()
|
|
128
162
|
|
|
129
|
-
|
|
163
|
+
// Sortable UID with timestamp
|
|
164
|
+
const sortable = suid()
|
|
165
|
+
suidDate(sortable) // Extract timestamp
|
|
130
166
|
|
|
131
|
-
|
|
167
|
+
// Named incremental IDs (great for debugging)
|
|
168
|
+
uname('user') // => 'user-0'
|
|
169
|
+
uname('user') // => 'user-1'
|
|
132
170
|
|
|
133
|
-
|
|
134
|
-
|
|
171
|
+
// Classic UUID v4
|
|
172
|
+
const classic = uuidv4() // => 'a7755f8d-ef6f-45e9-8db3-d29347a4a2a1'
|
|
135
173
|
```
|
|
136
174
|
|
|
137
|
-
|
|
175
|
+
**Available ID types:** `uuid`, `uuidB32`, `suid`, `quid`, `uuidv4`
|
|
138
176
|
|
|
139
|
-
|
|
177
|
+
---
|
|
140
178
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
```ts
|
|
144
|
-
await waitOn(emitter, 'action', 1000) // 1000 is optional timeout in ms
|
|
145
|
-
```
|
|
179
|
+
### 🎯 Typed Event Emitter
|
|
146
180
|
|
|
147
|
-
|
|
181
|
+
Type-safe, async event emitter with full TypeScript support:
|
|
148
182
|
|
|
149
183
|
```ts
|
|
150
|
-
|
|
151
|
-
|
|
184
|
+
interface MyEvents {
|
|
185
|
+
inc: (count: number) => number
|
|
186
|
+
}
|
|
152
187
|
|
|
153
|
-
|
|
188
|
+
const e = new Emitter<MyEvents>()
|
|
189
|
+
e.on('inc', async count => counter + 1)
|
|
190
|
+
await e.emit('inc', 1)
|
|
154
191
|
|
|
155
|
-
|
|
156
|
-
await
|
|
192
|
+
// Or use the .call proxy
|
|
193
|
+
await e.call.inc(1)
|
|
157
194
|
```
|
|
158
195
|
|
|
159
|
-
|
|
196
|
+
**Global emitter** for cross-module communication:
|
|
160
197
|
|
|
161
198
|
```ts
|
|
162
|
-
|
|
163
|
-
|
|
199
|
+
declare global {
|
|
200
|
+
interface ZeedGlobalEmitter {
|
|
201
|
+
test: (x: string) => void
|
|
202
|
+
}
|
|
203
|
+
}
|
|
164
204
|
|
|
165
|
-
|
|
205
|
+
getGlobalEmitter().call.test('Hello World')
|
|
206
|
+
```
|
|
166
207
|
|
|
167
|
-
|
|
208
|
+
---
|
|
168
209
|
|
|
169
|
-
|
|
170
|
-
const id1 = uuid() // base62 encoded => 22 chars
|
|
171
|
-
const id2 = uuidB32() // base32 encoded => 26 chars
|
|
172
|
-
```
|
|
210
|
+
### 💬 Messaging
|
|
173
211
|
|
|
174
|
-
|
|
212
|
+
Type-safe messaging infrastructure for client-server communication:
|
|
175
213
|
|
|
176
214
|
```ts
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
uname('something') // => 'something-1'
|
|
215
|
+
const m = useMessageHub({ channel }).send<MyMessages>()
|
|
216
|
+
m.echo({ hello: 'world' })
|
|
180
217
|
```
|
|
181
218
|
|
|
182
|
-
|
|
219
|
+
> 📖 [Full messaging documentation](./src/common/msg/README.md)
|
|
183
220
|
|
|
184
|
-
|
|
185
|
-
const shortSortableId = suid() // = '000iMi10bt6YK8buKlYPsd'
|
|
186
|
-
suidDate(shortSortableId) // = 2021-07-03T22:42:40.727Z
|
|
187
|
-
shortSortableId < suid() // = true
|
|
188
|
-
```
|
|
221
|
+
---
|
|
189
222
|
|
|
190
|
-
|
|
223
|
+
### ✅ Schema Validation
|
|
191
224
|
|
|
192
|
-
|
|
193
|
-
- `uuidB32`
|
|
194
|
-
- `suid`
|
|
195
|
-
- `quid`: Quick ID great for UI purposes of patter `id-1`, `id-2`, ...
|
|
196
|
-
- `uuidv4`: The _classic_ UID like `a7755f8d-ef6f-45e9-8db3-d29347a4a2a1`
|
|
225
|
+
<div align="center">
|
|
197
226
|
|
|
198
|
-
|
|
227
|
+
**🎯 Type-safe • 🔄 Standard Schema Compatible • 🚀 Zero Dependencies**
|
|
199
228
|
|
|
200
|
-
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
Powerful schema validation with full TypeScript inference and [Standard Schema](https://github.com/standard-schema/standard-schema) support:
|
|
201
232
|
|
|
202
233
|
```ts
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
234
|
+
import { z } from 'zeed'
|
|
235
|
+
|
|
236
|
+
// Define and validate schemas
|
|
237
|
+
const userSchema = z.object({
|
|
238
|
+
name: z.string(),
|
|
239
|
+
email: z.string(),
|
|
240
|
+
age: z.number().optional(),
|
|
241
|
+
role: z.stringLiterals(['admin', 'user', 'guest']),
|
|
242
|
+
})
|
|
206
243
|
|
|
207
|
-
|
|
244
|
+
// Full type inference
|
|
245
|
+
type User = z.infer<typeof userSchema>
|
|
208
246
|
|
|
209
|
-
|
|
210
|
-
|
|
247
|
+
// Parse and validate
|
|
248
|
+
const user = schemaParseObject(userSchema, data)
|
|
211
249
|
```
|
|
212
250
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
```ts
|
|
216
|
-
await e.call.inc(1)
|
|
217
|
-
```
|
|
251
|
+
<details>
|
|
252
|
+
<summary>🔗 Standard Schema Compatibility</summary>
|
|
218
253
|
|
|
219
|
-
|
|
254
|
+
Compatible with **tRPC**, **TanStack Form/Router**, **Hono**, and [40+ other libraries](https://github.com/standard-schema/standard-schema#what-tools--frameworks-accept-spec-compliant-schemas):
|
|
220
255
|
|
|
221
256
|
```ts
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
257
|
+
// Use with any standard-schema-compatible library
|
|
258
|
+
const schema = z.object({
|
|
259
|
+
name: z.string(),
|
|
260
|
+
count: z.number(),
|
|
226
261
|
})
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
You can also use a global emitter that will be available even over module boundaries:
|
|
230
262
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
263
|
+
const result = schema['~standard'].validate({ name: 'test', count: 42 })
|
|
264
|
+
if (result.issues) {
|
|
265
|
+
console.error('Validation failed:', result.issues)
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
console.log('Valid data:', result.value)
|
|
236
269
|
}
|
|
237
|
-
|
|
238
|
-
getGlobalEmitter().emit('test', 'Hello World') // or
|
|
239
|
-
getGlobalEmitter().call.test('Hello World')
|
|
240
270
|
```
|
|
241
271
|
|
|
242
|
-
|
|
272
|
+
**Features:**
|
|
273
|
+
- Primitives: `string()`, `number()`, `int()`, `boolean()`, `any()`
|
|
274
|
+
- Objects: `object()`, `record()`, `pick()`, `omit()`, `extend()`, `partial()`, `required()`
|
|
275
|
+
- Arrays & Tuples: `array()`, `tuple()`
|
|
276
|
+
- Unions & Literals: `union()`, `literal()`, `stringLiterals()`
|
|
277
|
+
- Modifiers: `.optional()`, `.default()`, `.describe()`
|
|
243
278
|
|
|
244
|
-
|
|
279
|
+
</details>
|
|
245
280
|
|
|
246
|
-
|
|
247
|
-
const m = useMessageHub({ cannel }).send<MyMessages>()
|
|
248
|
-
m.echo({ hello: 'world' })
|
|
249
|
-
```
|
|
281
|
+
> 📖 [Complete schema documentation](./src/common/schema/README.md)
|
|
250
282
|
|
|
251
|
-
|
|
283
|
+
---
|
|
252
284
|
|
|
253
|
-
|
|
285
|
+
### 📊 Additional Utilities
|
|
254
286
|
|
|
255
|
-
|
|
287
|
+
<table>
|
|
288
|
+
<tr>
|
|
289
|
+
<td width="50%">
|
|
256
290
|
|
|
291
|
+
**🔄 CRDT Sorting**
|
|
257
292
|
```ts
|
|
258
293
|
interface Row extends SortedItem {
|
|
259
294
|
id: string
|
|
260
295
|
title: string
|
|
261
296
|
}
|
|
262
|
-
|
|
263
|
-
const rows: Row[] = []
|
|
264
|
-
|
|
265
|
-
function getSortedRows() {
|
|
266
|
-
return sortedItems(rows)
|
|
267
|
-
}
|
|
297
|
+
sortedItems(rows)
|
|
268
298
|
```
|
|
269
299
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
> Essays:
|
|
273
|
-
>
|
|
274
|
-
> - [Holtwick: Smart Reordering for UITableView](https://holtwick.de/en/blog/smart-table-reordering)
|
|
275
|
-
> - [Figma: Fractional Indexing](https://www.figma.com/blog/realtime-editing-of-ordered-sequences/#fractional-indexing)
|
|
276
|
-
>
|
|
277
|
-
> The implementation in Zeed is pretty straight forward, but there are also more sophisticated approaches available as alternatives:
|
|
278
|
-
>
|
|
279
|
-
> - [Implementing Fractional Indexing](https://observablehq.com/@dgreensp/implementing-fractional-indexing)
|
|
280
|
-
> - [fractional-indexing](https://github.com/rocicorp/fractional-indexing) - npm module
|
|
281
|
-
|
|
282
|
-
## Custom binary data encoding / decoding
|
|
283
|
-
|
|
284
|
-
Integration of the [base-x](https://github.com/cryptocoinjs/base-x) code to support encoding and decoding to any alphabet, but especially base2, base16 (hex), base32, base62, base64.
|
|
285
|
-
Human-readable yet efficient encoding of binary data.
|
|
286
|
-
|
|
300
|
+
**🔐 Binary Encoding**
|
|
287
301
|
```ts
|
|
288
|
-
const sample = new UInt8Array([1, 2, 3])
|
|
289
302
|
const { encode, decode } = useBase(62)
|
|
290
|
-
decode(encode(
|
|
303
|
+
decode(encode(data)) === data
|
|
291
304
|
```
|
|
292
305
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
Handle complex objects.
|
|
306
|
+
</td>
|
|
307
|
+
<td width="50%">
|
|
296
308
|
|
|
309
|
+
**🔍 Deep Object Utils**
|
|
297
310
|
```ts
|
|
298
|
-
deepEqual(
|
|
299
|
-
deepMerge(
|
|
311
|
+
deepEqual(obj1, obj2)
|
|
312
|
+
deepMerge(obj1, obj2)
|
|
300
313
|
```
|
|
301
314
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
`useDispose` will simplify cleaning up objects. You just need to `add` a function or and object with `dispose` method to be called for cleanup. This can also be nested. A simple example is a timer:
|
|
305
|
-
|
|
315
|
+
**🧹 Resource Disposal**
|
|
306
316
|
```ts
|
|
307
|
-
function disposableTimer() {
|
|
308
|
-
const timeout = setTimeout(() => console.log('hello world'), 1000)
|
|
309
|
-
return () => clearTimeout(timeout)
|
|
310
|
-
}
|
|
311
|
-
|
|
312
317
|
const dispose = useDispose()
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
dispose.add(obj)
|
|
316
|
-
|
|
317
|
-
// or
|
|
318
|
-
|
|
319
|
-
const untrackTimer = dispose.add(disposableTimer())
|
|
320
|
-
untrackTimer() // dispose single object by return value of .track
|
|
321
|
-
|
|
322
|
-
// then later dispose all
|
|
323
|
-
|
|
324
|
-
dispose()
|
|
318
|
+
dispose.add(cleanup)
|
|
319
|
+
await dispose()
|
|
325
320
|
```
|
|
326
321
|
|
|
327
|
-
|
|
322
|
+
</td>
|
|
323
|
+
</tr>
|
|
324
|
+
</table>
|
|
328
325
|
|
|
329
|
-
|
|
326
|
+
---
|
|
330
327
|
|
|
331
|
-
|
|
332
|
-
class DisposeExample {
|
|
333
|
-
// the trick is to assign to member `dispose`, will be both
|
|
334
|
-
// the destructor and the registration point for disposables
|
|
335
|
-
dispose = useDispose()
|
|
328
|
+
## 📦 More Features
|
|
336
329
|
|
|
337
|
-
|
|
338
|
-
this.dispose.add(disposableTimer())
|
|
339
|
-
}
|
|
340
|
-
}
|
|
330
|
+
Zeed includes many more utilities - explore the [full API documentation](https://zeed.holtwick.de/)!
|
|
341
331
|
|
|
342
|
-
|
|
343
|
-
// ...
|
|
344
|
-
obj.dispose() // or async via `await obj.dispose()`
|
|
345
|
-
```
|
|
332
|
+
## 🤝 Related Projects
|
|
346
333
|
|
|
347
|
-
|
|
334
|
+
**By the same author:**
|
|
335
|
+
- [zeed-dom](https://github.com/holtwick/zeed-dom) - DOM manipulation utilities
|
|
336
|
+
- [zerva](https://github.com/holtwick/zerva) - Modular server framework
|
|
348
337
|
|
|
349
|
-
|
|
338
|
+
**Similar utility libraries:**
|
|
339
|
+
- [lib0](https://github.com/dmonad/lib0) - Fundamental utility functions
|
|
340
|
+
- [antfu/utils](https://github.com/antfu/utils) - Collection of common utilities
|
|
341
|
+
- [vueuse](https://vueuse.org/) - Vue composition utilities
|
|
342
|
+
- [unjs](https://github.com/unjs/) - Unified JavaScript tools
|
|
350
343
|
|
|
351
|
-
##
|
|
344
|
+
## 📄 License
|
|
352
345
|
|
|
353
|
-
|
|
346
|
+
MIT
|
|
354
347
|
|
|
355
|
-
|
|
356
|
-
- [zerva](https://github.com/holtwick/zerva)
|
|
348
|
+
---
|
|
357
349
|
|
|
358
|
-
|
|
350
|
+
<div align="center">
|
|
359
351
|
|
|
360
|
-
|
|
361
|
-
- [antfu/utils](https://github.com/antfu/utils)
|
|
362
|
-
- [vueuse](https://vueuse.org/)
|
|
363
|
-
- [unjs](https://github.com/unjs/)
|
|
352
|
+
**Built with ❤️ by [Dirk Holtwick](https://holtwick.de)**
|
|
364
353
|
|
|
365
|
-
|
|
354
|
+
[⭐ Star on GitHub](https://github.com/holtwick/zeed) • [📖 Documentation](https://zeed.holtwick.de/) • [🐛 Report Issue](https://github.com/holtwick/zeed/issues)
|
|
366
355
|
|
|
367
|
-
|
|
368
|
-
- [debug](https://github.com/visionmedia/debug) MIT
|
|
369
|
-
- [dotenv](https://github.com/motdotla/dotenv) BSD-2
|
|
370
|
-
- [filenamify](https://github.com/sindresorhus/filenamify) MIT
|
|
371
|
-
- [gravatar](https://github.com/mazondo/gravatarjs/blob/master/gravatar.js) MIT
|
|
372
|
-
- [lib0](https://github.com/dmonad/lib0) MIT
|
|
373
|
-
- [birpc](https://github.com/antfu/birpc) MIT
|
|
356
|
+
</div>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as k,c as S,d as g,e as j,f as m,g as p,k as i,l,m as T,n as V,o as x,p as b,q as s,r as c,s as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as k,c as S,d as g,e as j,f as m,g as p,k as i,l,m as T,n as V,o as x,p as b,q as s,r as c,s as f}from"./chunk-LLDVPAUS.js";import{b as d,e as _}from"./chunk-6VFFIKPT.js";import{a as r}from"./chunk-5NKC2EQJ.js";function y(e){let n={type:e.type};if(e._optional!==void 0&&(n.optional=e._optional),e._meta!==void 0&&(n.meta=e._meta),e._default!==void 0&&!d(e._default)&&(n.default=e._default),e._object!==void 0){n.object={};for(let[t,a]of Object.entries(e._object))n.object[t]=y(a)}return e._type!==void 0&&(_(e._type)?n.tupleTypes=e._type.map(t=>y(t)):n.itemType=y(e._type)),e._union!==void 0&&(n.union=e._union.map(t=>y(t))),e._enumValues!==void 0&&(n.enumValues=e._enumValues),e._args!==void 0&&(n.args=e._args.map(t=>y(t))),e._ret!==void 0&&(n.ret=y(e._ret)),e._info!==void 0&&(n.info=y(e._info)),e.type==="literal"&&e._default!==void 0&&(n.literalValue=e._default),n}r(y,"serializeSchema");function o(e){let n;switch(e.type){case"string":e.enumValues?n=x(e.enumValues):n=k();break;case"number":n=S();break;case"int":n=g();break;case"boolean":n=j();break;case"none":n=m();break;case"any":n=p();break;case"object":if(e.object){let t={};for(let[a,u]of Object.entries(e.object))t[a]=o(u);n=i(t)}else n=i({});break;case"record":e.itemType?n=l(o(e.itemType)):n=l(p());break;case"array":e.itemType?n=s(o(e.itemType)):n=s(p());break;case"tuple":if(e.tupleTypes){let t=e.tupleTypes.map(a=>o(a));n=b(t)}else n=b([]);break;case"union":if(e.union){let t=e.union.map(a=>o(a));n=T(t)}else n=T([]);break;case"literal":e.literalValue!==void 0?n=V(e.literalValue):n=p();break;case"function":if(e.args&&e.ret){let t=e.args.map(u=>o(u)),a=o(e.ret);n=c(t,a)}else n=c([],p());break;case"rpc":if(e.info&&e.ret){let t=o(e.info),a=o(e.ret);n=f(t,a)}else if(e.ret){let t=o(e.ret);n=f(void 0,t)}else n=f();break;default:n=p();break}return e.optional&&(n=n.optional()),e.default!==void 0&&(n=n.default(e.default)),e.meta&&(n=n.meta(e.meta)),n}r(o,"deserializeSchema");export{y as a,o as b};
|
|
2
|
+
//# sourceMappingURL=chunk-3LSWLKUP.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as L}from"./chunk-DTFGASVV.js";import{b as d}from"./chunk-
|
|
1
|
+
import{c as L}from"./chunk-DTFGASVV.js";import{b as d}from"./chunk-KIKHNNKK.js";import{b as g}from"./chunk-ACQZBCFF.js";import{b as f,d as p}from"./chunk-D3NCJPFL.js";import{c as k,d as H,e as W}from"./chunk-RZR3ECDT.js";import{a as m}from"./chunk-5NKC2EQJ.js";import{createWriteStream as x,mkdirSync as I}from"fs";import{basename as M,dirname as N,resolve as D}from"path";import E from"process";var u={};function B(e,v={}){let{level:y=void 0,filter:O=void 0,time:R=!0,pretty:S=!1,rotation:$}=v;e=D(E.cwd(),e);let l=N(e);I(l,{recursive:!0});let i=d($),a;i?(i.path=l,a=L(M(e),i)):a=x(e,{flags:"a"});let b=f(O),w=p(y);return t=>{if(!w(t.level)||!b(t.name))return;let o=R?`${new Date().toISOString()} `:"",s=t.name||"",c=u[s||""];c==null&&(u[s]=c);let r=[`[${s||"*"}]`,g(t.messages,{pretty:S})];function n(...F){a.write(`${F.join(" ")}
|
|
2
2
|
`)}switch(m(n,"write"),t.level){case 1:n(`${o}I|* `,...r);break;case 2:n(`${o}W|** `,...r);break;case 3:n(`${o}E|***`,...r);break;default:n(`${o}D| `,...r);break}}}m(B,"LoggerFileHandler");export{B as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-4X7UJTXJ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkIVUEQANCcjs = require('./chunk-IVUEQANC.cjs');var _chunkP7XCQ7WVcjs = require('./chunk-P7XCQ7WV.cjs');var i=class s{static{_chunkP7XCQ7WVcjs.a.call(void 0, this,"Type")}constructor(e,t={}){this.type=e,Object.assign(this,t)}get"~standard"(){return{version:1,vendor:"zeed",validate:_chunkP7XCQ7WVcjs.a.call(void 0, e=>this.validate(e),"validate"),types:{input:void 0,output:void 0}}}validate(e){if(e==null)return this._optional?{value:void 0}:this._default!==void 0?{value:_chunkIVUEQANCcjs.b.call(void 0, this._default)?this._default(this):this._default}:{issues:[{message:"Required value is missing",path:[]}]};if(this.type==="literal"&&this._default!==e)return{issues:[{message:`Expected literal value ${this._default}, got ${e}`,path:[]}]};if(this._enumValues&&Array.isArray(this._enumValues)&&!this._enumValues.includes(e))return{issues:[{message:`Expected one of [${this._enumValues.join(", ")}], got ${e}`,path:[]}]};if(this._union&&Array.isArray(this._union)){for(let t of this._union){let n=t.validate(e);if(!n.issues)return n}return{issues:[{message:"Value does not match any union variant",path:[]}]}}if(this.type==="array"||this.type==="tuple"){if(!Array.isArray(e))return{issues:[{message:`Expected array, got ${typeof e}`,path:[]}]};if(this.type==="tuple"&&this._type){let t=this._type;if(e.length!==t.length)return{issues:[{message:`Expected tuple of length ${t.length}, got ${e.length}`,path:[]}]};let n=[];for(let r=0;r<t.length;r++){let a=t[r].validate(e[r]);if(a.issues)for(let p of a.issues)n.push({message:p.message,path:[r,...p.path||[]]})}if(n.length>0)return{issues:n}}else if(this._type){let t=this._type,n=[];for(let r=0;r<e.length;r++){let a=t.validate(e[r]);if(a.issues)for(let p of a.issues)n.push({message:p.message,path:[r,...p.path||[]]})}if(n.length>0)return{issues:n}}}if(this._object){if(!_chunkIVUEQANCcjs.a.call(void 0, e))return{issues:[{message:`Expected object, got ${typeof e}`,path:[]}]};let t=[],n=e;for(let r in this._object){let a=this._object[r],p=n[r],y=a.validate(p);if(y.issues)for(let f of y.issues)t.push({message:f.message,path:[r,...f.path||[]]})}return t.length>0?{issues:t}:{value:e,issues:void 0}}if(this.type==="record"&&this._type){if(!_chunkIVUEQANCcjs.a.call(void 0, e))return{issues:[{message:`Expected object, got ${typeof e}`,path:[]}]};let t=this._type,n=[],r=e;for(let a in r){let p=t.validate(r[a]);if(p.issues)for(let y of p.issues)n.push({message:y.message,path:[a,...y.path||[]]})}if(n.length>0)return{issues:n}}return this._check&&!this._check(e)?{issues:[{message:`Expected ${this.type}, got ${typeof e}`,path:[]}]}:{value:e}}_cloneWithProps(e={}){let t=new s(this.type),n=["_default","_optional","_meta","_check","_object","_type","_union","_enumValues","_args","_ret","_info"];for(let r of n)this[r]!==void 0&&(t[r]=this[r]);return Object.assign(t,e),t}static _copyTypeProperties(e,t){let n=["_check","_default","_meta","_object","_type","_enumValues"];for(let r of n)e[r]!==void 0&&(t[r]=e[r])}optional(){return this._cloneWithProps({_optional:!0})}default(e){return this._cloneWithProps({_default:e})}meta(e){return this._cloneWithProps({_meta:e})}describe(e){let t=this._meta||{};return t.desc=e,this._cloneWithProps({_meta:t})}extend(e){if(!this._object)throw new Error("extend() can only be used on object schemas");let t={...this._object,...e};return T(t)}pick(e){if(!this._object)throw new Error("pick() can only be used on object schemas");let t={};for(let n of Object.keys(e))n in this._object&&(t[n]=this._object[n]);return T(t)}omit(e){if(!this._object)throw new Error("omit() can only be used on object schemas");let t={...this._object};for(let n of Object.keys(e))delete t[n];return T(t)}_transformObjectProperties(e,t){if(!this._object)throw new Error("This operation can only be used on object schemas");let n={},r=this._object;for(let[a,p]of Object.entries(r)){let y=!t||a in t;n[a]=e(a,p,y)}return T(n)}partial(e){if(!this._object)throw new Error("partial() can only be used on object schemas");return this._transformObjectProperties((t,n,r)=>r?s._cloneTypeWithOptional(n,!0):n,e)}required(e){if(!this._object)throw new Error("required() can only be used on object schemas");return this._transformObjectProperties((t,n,r)=>r?s._cloneTypeWithOptional(n,!1):n,e)}static _cloneTypeWithOptional(e,t){let n=new s(e.type);return s._copyTypeProperties(e,n),n._optional=t,n}};function k(){return new i("string",{_check:_chunkIVUEQANCcjs.h})}_chunkP7XCQ7WVcjs.a.call(void 0, k,"string");function d(){return new i("number",{_check:_chunkIVUEQANCcjs.i})}_chunkP7XCQ7WVcjs.a.call(void 0, d,"number");function j(){return new i("int",{_check:_chunkIVUEQANCcjs.j})}_chunkP7XCQ7WVcjs.a.call(void 0, j,"int");function R(){return new i("boolean",{_check:_chunkIVUEQANCcjs.l})}_chunkP7XCQ7WVcjs.a.call(void 0, R,"boolean");function g(){return new i("none",{_check:_chunkP7XCQ7WVcjs.a.call(void 0, s=>s==null,"_check"),_optional:!0})}_chunkP7XCQ7WVcjs.a.call(void 0, g,"none");function K(){return new i("any",{_check:_chunkP7XCQ7WVcjs.a.call(void 0, s=>s!=null,"_check")})}_chunkP7XCQ7WVcjs.a.call(void 0, K,"any");var w=d,O= exports.i =d,P= exports.j =d;function T(s){return new i("object",{_check:_chunkIVUEQANCcjs.a,_object:s})}_chunkP7XCQ7WVcjs.a.call(void 0, T,"object");function V(s){return new i("record",{_check:_chunkIVUEQANCcjs.a,_type:s})}_chunkP7XCQ7WVcjs.a.call(void 0, V,"record");function I(s){return new i("union",{_check:_chunkP7XCQ7WVcjs.a.call(void 0, e=>s.some(t=>_nullishCoalesce(_optionalChain([t, 'access', _2 => _2._check, 'optionalCall', _3 => _3(e)]), () => (!1))),"_check"),_union:s})}_chunkP7XCQ7WVcjs.a.call(void 0, I,"union");function A(s){return new i("literal",{_check:_chunkP7XCQ7WVcjs.a.call(void 0, e=>e===s,"_check"),_default:s})}_chunkP7XCQ7WVcjs.a.call(void 0, A,"literal");function E(s){return new i("string",{_check:_chunkP7XCQ7WVcjs.a.call(void 0, e=>typeof e=="string"&&s.includes(e),"_check"),_enumValues:s})}_chunkP7XCQ7WVcjs.a.call(void 0, E,"stringLiterals");function S(s){return new i("tuple",{_check:_chunkP7XCQ7WVcjs.a.call(void 0, e=>Array.isArray(e)&&e.length===s.length&&s.every((t,n)=>_nullishCoalesce(_optionalChain([t, 'access', _4 => _4._check, 'optionalCall', _5 => _5(e[n])]), () => (!1))),"_check"),_type:s})}_chunkP7XCQ7WVcjs.a.call(void 0, S,"tuple");function $(s){return new i("array",{_check:_chunkIVUEQANCcjs.e,_type:s})}_chunkP7XCQ7WVcjs.a.call(void 0, $,"array");function q(s,e){return new i("function",{_check:_chunkIVUEQANCcjs.b,_args:s,_ret:e})}_chunkP7XCQ7WVcjs.a.call(void 0, q,"func");function F(s,e){return new i("rpc",{_check:_chunkIVUEQANCcjs.b,_info:s,_ret:_nullishCoalesce(e, () => (g()))})}_chunkP7XCQ7WVcjs.a.call(void 0, F,"rpc");exports.a = i; exports.b = k; exports.c = d; exports.d = j; exports.e = R; exports.f = g; exports.g = K; exports.h = w; exports.i = O; exports.j = P; exports.k = T; exports.l = V; exports.m = I; exports.n = A; exports.o = E; exports.p = S; exports.q = $; exports.r = q; exports.s = F;
|
|
2
|
+
//# sourceMappingURL=chunk-5RJ6XORD.cjs.map
|