sendscript 2.3.5 → 2.3.7

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/CHANGELOG.md CHANGED
@@ -4,8 +4,20 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v2.3.7](https://github.com/bas080/sendscript/compare/v2.3.6...v2.3.7)
8
+
9
+ - Fix missing schema node type [`afb2d1b`](https://github.com/bas080/sendscript/commit/afb2d1b8cba4406c659db1f76f79b4e1de3d1872)
10
+
11
+ #### [v2.3.6](https://github.com/bas080/sendscript/compare/v2.3.5...v2.3.6)
12
+
13
+ > 14 April 2026
14
+
15
+ - Document recursive nature of schema [`ddcd466`](https://github.com/bas080/sendscript/commit/ddcd46667db0d4e76c123d5dcf7e04e05b9c6e3e)
16
+
7
17
  #### [v2.3.5](https://github.com/bas080/sendscript/compare/v2.3.4...v2.3.5)
8
18
 
19
+ > 14 April 2026
20
+
9
21
  - Have reference and parse reference same schema type [`0a05608`](https://github.com/bas080/sendscript/commit/0a0560828b78d297bfa5b12639a5e54774c089bd)
10
22
 
11
23
  #### [v2.3.4](https://github.com/bas080/sendscript/compare/v2.3.3...v2.3.4)
package/README.md CHANGED
@@ -15,6 +15,7 @@ Write JS code that you can run on servers, browsers or other clients.
15
15
  * [Parse](#parse)
16
16
  * [parse](#parse)
17
17
  * [References](#references)
18
+ * [SchemaNode](#schemanode)
18
19
  * [Schema](#schema)
19
20
  * [defaultLeafStringify](#defaultleafstringify)
20
21
  * [Stringify](#stringify)
@@ -172,14 +173,22 @@ Schema supports:
172
173
 
173
174
  Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Nested instrumented API object
174
175
 
176
+ ### SchemaNode
177
+
178
+ A single schema node.
179
+
180
+ Type: ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | \[[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [Schema](#schema)])
181
+
175
182
  ### Schema
176
183
 
177
184
  A schema defines the structure of the runtime API tree.
178
185
 
179
186
  * string → leaf node
180
- * \[name, children] → namespace
187
+ * \[name, children] → namespace node
181
188
 
182
- Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | \[[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)])>
189
+ Schema is recursive: nodes can contain nested schemas.
190
+
191
+ Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[SchemaNode](#schemanode)>
183
192
 
184
193
  ### defaultLeafStringify
185
194
 
@@ -201,6 +210,8 @@ Creates a stringify function for SendScript AST structures.
201
210
 
202
211
  * `leafStringify` (optional, default `defaultLeafStringify`)
203
212
 
213
+ Returns **[stringify](#stringify)**&#x20;
214
+
204
215
  ### stringify
205
216
 
206
217
  Serializes a program into a JSON string representation.
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **add**(`a`, `b`): `number`
10
10
 
11
- Defined in: [math.ts:1](https://github.com/bas080/sendscript/blob/0a0560828b78d297bfa5b12639a5e54774c089bd/example/typescript/math.ts#L1)
11
+ Defined in: [math.ts:1](https://github.com/bas080/sendscript/blob/afb2d1b8cba4406c659db1f76f79b4e1de3d1872/example/typescript/math.ts#L1)
12
12
 
13
13
  ## Parameters
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **square**(`a`): `number`
10
10
 
11
- Defined in: [math.ts:2](https://github.com/bas080/sendscript/blob/0a0560828b78d297bfa5b12639a5e54774c089bd/example/typescript/math.ts#L2)
11
+ Defined in: [math.ts:2](https://github.com/bas080/sendscript/blob/afb2d1b8cba4406c659db1f76f79b4e1de3d1872/example/typescript/math.ts#L2)
12
12
 
13
13
  ## Parameters
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sendscript",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
4
4
  "description": "Blur the line between server and client code.",
5
5
  "module": true,
6
6
  "main": "index.mjs",
package/parse.mjs CHANGED
@@ -102,7 +102,6 @@ const defaultLeafParse = (text) => JSON.parse(text)
102
102
 
103
103
  /**
104
104
  * @template Env
105
- * @typedef {(program: string) => any | Promise<any>} parse
106
105
  *
107
106
  * Creates a program parser for a given schema and environment.
108
107
  *
package/schema.mjs CHANGED
@@ -1,9 +1,18 @@
1
+ /**
2
+ * A single schema node.
3
+ *
4
+ * @typedef {string | [string, Schema]} SchemaNode
5
+ * @public
6
+ */
7
+
1
8
  /**
2
9
  * A schema defines the structure of the runtime API tree.
3
10
  *
4
11
  * - string → leaf node
5
- * - [name, children] → namespace
12
+ * - [name, children] → namespace node
13
+ *
14
+ * Schema is recursive: nodes can contain nested schemas.
6
15
  *
7
- * @typedef {Array<string | [string, Array]>} Schema
16
+ * @typedef {SchemaNode[]} Schema
8
17
  * @public
9
18
  */
package/stringify.mjs CHANGED
@@ -105,7 +105,7 @@ function defaultLeafStringify (x) {
105
105
  * Creates a stringify function for SendScript AST structures.
106
106
  *
107
107
  * @param {(value: any) => string} [leafSerializer=strictStringify]
108
- * @returns {(program: any) => string}
108
+ * @returns {stringify}
109
109
  * @public
110
110
  */
111
111
  export default function Stringify (leafStringify = defaultLeafStringify) {