@dataplan/json 0.0.1-0.9 → 0.0.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/CHANGELOG.md +141 -0
- package/README.md +1 -3
- package/dist/steps/jsonParse.d.ts +2 -2
- package/dist/steps/jsonParse.d.ts.map +1 -1
- package/dist/steps/jsonParse.js +12 -13
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,146 @@
|
|
|
1
1
|
# @dataplan/json
|
|
2
2
|
|
|
3
|
+
## 0.0.1-1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#260](https://github.com/benjie/postgraphile-private/pull/260)
|
|
8
|
+
[`d5312e6b9`](https://github.com/benjie/postgraphile-private/commit/d5312e6b968fbeb46d074b82a41b4bdbc166598c)
|
|
9
|
+
Thanks [@benjie](https://github.com/benjie)! - TypeScript v5 is now required
|
|
10
|
+
|
|
11
|
+
- [#266](https://github.com/benjie/postgraphile-private/pull/266)
|
|
12
|
+
[`395b4a2dd`](https://github.com/benjie/postgraphile-private/commit/395b4a2dd24044bad25f5e411a7a7cfa43883eef)
|
|
13
|
+
Thanks [@benjie](https://github.com/benjie)! - The Grafast step class
|
|
14
|
+
'execute' and 'stream' methods now have a new additional first argument
|
|
15
|
+
`count` which indicates how many results they must return. This means we don't
|
|
16
|
+
need to rely on the `values[0].length` trick to determine how many results to
|
|
17
|
+
return, and thus we can pass through an empty tuple to steps that have no
|
|
18
|
+
dependencies.
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
[[`ae304b33c`](https://github.com/benjie/postgraphile-private/commit/ae304b33c7c5a04d36b552177ae24a7b7b522645),
|
|
21
|
+
[`d5312e6b9`](https://github.com/benjie/postgraphile-private/commit/d5312e6b968fbeb46d074b82a41b4bdbc166598c),
|
|
22
|
+
[`22ec50e36`](https://github.com/benjie/postgraphile-private/commit/22ec50e360d90de41c586c5c220438f780c10ee8),
|
|
23
|
+
[`0f4709356`](https://github.com/benjie/postgraphile-private/commit/0f47093560cf4f8b1f215853bc91d7f6531278cc),
|
|
24
|
+
[`395b4a2dd`](https://github.com/benjie/postgraphile-private/commit/395b4a2dd24044bad25f5e411a7a7cfa43883eef)]:
|
|
25
|
+
- grafast@0.0.1-1.1
|
|
26
|
+
|
|
27
|
+
## 0.0.1-0.23
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
[[`89d16c972`](https://github.com/benjie/postgraphile-private/commit/89d16c972f12659de091b0b866768cacfccc8f6b),
|
|
33
|
+
[`8f323bdc8`](https://github.com/benjie/postgraphile-private/commit/8f323bdc88e39924de50775891bd40f1acb9b7cf),
|
|
34
|
+
[`9e7183c02`](https://github.com/benjie/postgraphile-private/commit/9e7183c02cb82d5f5c684c4f73962035e0267c83)]:
|
|
35
|
+
- grafast@0.0.1-0.23
|
|
36
|
+
|
|
37
|
+
## 0.0.1-0.22
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies []:
|
|
42
|
+
- grafast@0.0.1-0.22
|
|
43
|
+
|
|
44
|
+
## 0.0.1-0.21
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- Updated dependencies
|
|
49
|
+
[[`f5a04cf66`](https://github.com/benjie/postgraphile-private/commit/f5a04cf66f220c11a6a82db8c1a78b1d91606faa)]:
|
|
50
|
+
- grafast@0.0.1-0.21
|
|
51
|
+
|
|
52
|
+
## 0.0.1-0.20
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- Updated dependencies [[`aac8732f9`](undefined)]:
|
|
57
|
+
- grafast@0.0.1-0.20
|
|
58
|
+
|
|
59
|
+
## 0.0.1-0.19
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- Updated dependencies
|
|
64
|
+
[[`397e8bb40`](https://github.com/benjie/postgraphile-private/commit/397e8bb40fe3783995172356a39ab7cb33e3bd36)]:
|
|
65
|
+
- grafast@0.0.1-0.19
|
|
66
|
+
|
|
67
|
+
## 0.0.1-0.18
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated dependencies
|
|
72
|
+
[[`4c2b7d1ca`](https://github.com/benjie/postgraphile-private/commit/4c2b7d1ca1afbda1e47da22c346cc3b03d01b7f0),
|
|
73
|
+
[`c8a56cdc8`](https://github.com/benjie/postgraphile-private/commit/c8a56cdc83390e5735beb9b90f004e7975cab28c)]:
|
|
74
|
+
- grafast@0.0.1-0.18
|
|
75
|
+
|
|
76
|
+
## 0.0.1-0.17
|
|
77
|
+
|
|
78
|
+
### Patch Changes
|
|
79
|
+
|
|
80
|
+
- Updated dependencies [[`f48860d4f`](undefined)]:
|
|
81
|
+
- grafast@0.0.1-0.17
|
|
82
|
+
|
|
83
|
+
## 0.0.1-0.16
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- Updated dependencies
|
|
88
|
+
[[`df89aba52`](https://github.com/benjie/postgraphile-private/commit/df89aba524270e52f82987fcc4ab5d78ce180fc5)]:
|
|
89
|
+
- grafast@0.0.1-0.16
|
|
90
|
+
|
|
91
|
+
## 0.0.1-0.15
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- Updated dependencies
|
|
96
|
+
[[`b523118fe`](https://github.com/benjie/postgraphile-private/commit/b523118fe6217c027363fea91252a3a1764e17df)]:
|
|
97
|
+
- grafast@0.0.1-0.15
|
|
98
|
+
|
|
99
|
+
## 0.0.1-0.14
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- Updated dependencies
|
|
104
|
+
[[`d76043453`](https://github.com/benjie/postgraphile-private/commit/d7604345362c58bf7eb43ef1ac1795a2ac22ae79),
|
|
105
|
+
[`afa0ea5f6`](https://github.com/benjie/postgraphile-private/commit/afa0ea5f6c508d9a0ba5946ab153b13ddbd274a0),
|
|
106
|
+
[`851b78ef2`](https://github.com/benjie/postgraphile-private/commit/851b78ef20d430164507ec9b3f41a5a0b8a18ed7),
|
|
107
|
+
[`384b3594f`](https://github.com/benjie/postgraphile-private/commit/384b3594f543d113650c1b6b02b276360dd2d15f)]:
|
|
108
|
+
- grafast@0.0.1-0.14
|
|
109
|
+
|
|
110
|
+
## 0.0.1-0.13
|
|
111
|
+
|
|
112
|
+
### Patch Changes
|
|
113
|
+
|
|
114
|
+
- Updated dependencies [[`e5b664b6f`](undefined)]:
|
|
115
|
+
- grafast@0.0.1-0.13
|
|
116
|
+
|
|
117
|
+
## 0.0.1-0.12
|
|
118
|
+
|
|
119
|
+
### Patch Changes
|
|
120
|
+
|
|
121
|
+
- Updated dependencies
|
|
122
|
+
[[`4f5d5bec7`](https://github.com/benjie/postgraphile-private/commit/4f5d5bec72f949b17b39cd07acc848ce7a8bfa36),
|
|
123
|
+
[`25f5a6cbf`](https://github.com/benjie/postgraphile-private/commit/25f5a6cbff6cd5a94ebc4f411f7fa89c209fc383)]:
|
|
124
|
+
- grafast@0.0.1-0.12
|
|
125
|
+
|
|
126
|
+
## 0.0.1-0.11
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- [`0ab95d0b1`](undefined) - Update sponsors.
|
|
131
|
+
|
|
132
|
+
- Updated dependencies [[`0ab95d0b1`](undefined),
|
|
133
|
+
[`4783bdd7c`](https://github.com/benjie/postgraphile-private/commit/4783bdd7cc28ac8b497fdd4d6f1024d80cb432ef),
|
|
134
|
+
[`652cf1073`](https://github.com/benjie/postgraphile-private/commit/652cf107316ea5832f69c6a55574632187f5c876)]:
|
|
135
|
+
- grafast@0.0.1-0.11
|
|
136
|
+
|
|
137
|
+
## 0.0.1-0.10
|
|
138
|
+
|
|
139
|
+
### Patch Changes
|
|
140
|
+
|
|
141
|
+
- Updated dependencies []:
|
|
142
|
+
- grafast@0.0.1-0.10
|
|
143
|
+
|
|
3
144
|
## 0.0.1-0.9
|
|
4
145
|
|
|
5
146
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -24,14 +24,12 @@ And please give some love to our featured sponsors 🤩:
|
|
|
24
24
|
<table><tr>
|
|
25
25
|
<td align="center"><a href="https://surge.io/"><img src="https://graphile.org/images/sponsors/surge.png" width="90" height="90" alt="Surge" /><br />Surge</a> *</td>
|
|
26
26
|
<td align="center"><a href="https://www.netflix.com/"><img src="https://graphile.org/images/sponsors/Netflix.png" width="90" height="90" alt="Netflix" /><br />Netflix</a> *</td>
|
|
27
|
-
<td align="center"><a href="https://qwick.com/"><img src="https://graphile.org/images/sponsors/qwick.png" width="90" height="90" alt="Qwick" /><br />Qwick</a> *</td>
|
|
28
27
|
<td align="center"><a href="https://www.the-guild.dev/"><img src="https://graphile.org/images/sponsors/theguild.png" width="90" height="90" alt="The Guild" /><br />The Guild</a> *</td>
|
|
28
|
+
<td align="center"><a href="https://qwick.com/"><img src="https://graphile.org/images/sponsors/qwick.png" width="90" height="90" alt="Qwick" /><br />Qwick</a> *</td>
|
|
29
29
|
</tr><tr>
|
|
30
30
|
<td align="center"><a href="http://chads.website"><img src="https://graphile.org/images/sponsors/chadf.png" width="90" height="90" alt="Chad Furman" /><br />Chad Furman</a> *</td>
|
|
31
|
-
<td align="center"><a href="https://www.fanatics.com/"><img src="https://graphile.org/images/sponsors/fanatics.png" width="90" height="90" alt="Fanatics" /><br />Fanatics</a> *</td>
|
|
32
31
|
<td align="center"><a href="https://dovetailapp.com/"><img src="https://graphile.org/images/sponsors/dovetail.png" width="90" height="90" alt="Dovetail" /><br />Dovetail</a> *</td>
|
|
33
32
|
<td align="center"><a href="https://www.enzuzo.com/"><img src="https://graphile.org/images/sponsors/enzuzo.png" width="90" height="90" alt="Enzuzo" /><br />Enzuzo</a> *</td>
|
|
34
|
-
</tr><tr>
|
|
35
33
|
<td align="center"><a href="https://stellate.co/"><img src="https://graphile.org/images/sponsors/Stellate.png" width="90" height="90" alt="Stellate" /><br />Stellate</a> *</td>
|
|
36
34
|
</tr></table>
|
|
37
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AccessStep, GrafastResultsList, GrafastValuesList } from "grafast";
|
|
2
2
|
import { ExecutableStep } from "grafast";
|
|
3
|
-
export
|
|
3
|
+
export type JSONValue = string | number | boolean | null | {
|
|
4
4
|
[key: string]: JSONValue;
|
|
5
5
|
} | Array<JSONValue>;
|
|
6
6
|
export declare class JSONParseStep<TJSON extends JSONValue> extends ExecutableStep<TJSON> {
|
|
@@ -15,7 +15,7 @@ export declare class JSONParseStep<TJSON extends JSONValue> extends ExecutableSt
|
|
|
15
15
|
[key: string]: unknown;
|
|
16
16
|
} ? TJSON[TKey] : never>;
|
|
17
17
|
at<TIndex extends keyof TJSON & number>(index: TIndex): AccessStep<TJSON[TIndex]>;
|
|
18
|
-
execute(values: [GrafastValuesList<string>]): GrafastResultsList<TJSON>;
|
|
18
|
+
execute(count: number, values: [GrafastValuesList<string>]): GrafastResultsList<TJSON>;
|
|
19
19
|
}
|
|
20
20
|
export declare function jsonParse<TJSON extends JSONValue>($string: ExecutableStep<string | null>): JSONParseStep<TJSON>;
|
|
21
21
|
//# sourceMappingURL=jsonParse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonParse.d.ts","sourceRoot":"","sources":["../../src/steps/jsonParse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"jsonParse.d.ts","sourceRoot":"","sources":["../../src/steps/jsonParse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAU,cAAc,EAAY,MAAM,SAAS,CAAC;AAE3D,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC5B,KAAK,CAAC,SAAS,CAAC,CAAC;AAMrB,qBAAa,aAAa,CACxB,KAAK,SAAS,SAAS,CACvB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC7B,MAAM,CAAC,QAAQ;;;MAGb;IAGF,aAAa,UAAS;gBAEV,WAAW,EAAE,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC;IAKtD,YAAY,IAAI,MAAM;IAItB,GAAG,CAAC,IAAI,SAAS,MAAM,KAAK,EAC1B,GAAG,EAAE,IAAI,GACR,UAAU,CACX,KAAK,SAAS;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAC/D;IAID,EAAE,CAAC,MAAM,SAAS,MAAM,KAAK,GAAG,MAAM,EACpC,KAAK,EAAE,MAAM,GACZ,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAI5B,OAAO,CACL,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,GAClC,kBAAkB,CAAC,KAAK,CAAC;CAyB7B;AAMD,wBAAgB,SAAS,CAAC,KAAK,SAAS,SAAS,EAC/C,OAAO,EAAE,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,GACrC,aAAa,CAAC,KAAK,CAAC,CAEtB"}
|
package/dist/steps/jsonParse.js
CHANGED
|
@@ -23,23 +23,27 @@ class JSONParseStep extends grafast_1.ExecutableStep {
|
|
|
23
23
|
at(index) {
|
|
24
24
|
return (0, grafast_1.access)(this, [index]);
|
|
25
25
|
}
|
|
26
|
-
execute(values) {
|
|
27
|
-
|
|
26
|
+
execute(count, values) {
|
|
27
|
+
const result = [];
|
|
28
|
+
const list = values[0];
|
|
29
|
+
for (let i = 0; i < count; i++) {
|
|
30
|
+
const v = list[i];
|
|
28
31
|
if (typeof v === "string") {
|
|
29
32
|
try {
|
|
30
|
-
|
|
33
|
+
result[i] = JSON.parse(v);
|
|
31
34
|
}
|
|
32
35
|
catch (e) {
|
|
33
|
-
|
|
36
|
+
result[i] = Promise.reject(e);
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
else if (v == null) {
|
|
37
|
-
|
|
40
|
+
result[i] = null;
|
|
38
41
|
}
|
|
39
42
|
else {
|
|
40
|
-
|
|
43
|
+
result[i] = Promise.reject(new Error(`JSONParseStep: expected string to parse, but received ${Array.isArray(v) ? "array" : typeof v}`));
|
|
41
44
|
}
|
|
42
|
-
}
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
exports.JSONParseStep = JSONParseStep;
|
|
@@ -47,9 +51,4 @@ function jsonParse($string) {
|
|
|
47
51
|
return new JSONParseStep($string);
|
|
48
52
|
}
|
|
49
53
|
exports.jsonParse = jsonParse;
|
|
50
|
-
|
|
51
|
-
value: {
|
|
52
|
-
moduleName: "@dataplan/json",
|
|
53
|
-
exportName: "jsonParse",
|
|
54
|
-
},
|
|
55
|
-
});
|
|
54
|
+
(0, grafast_1.exportAs)("@dataplan/json", jsonParse, "jsonParse");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataplan/json",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-1.1",
|
|
4
4
|
"description": "JSON step classes for Grafast",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"node": ">=14.17"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"grafast": "^0.0.1-
|
|
36
|
+
"grafast": "^0.0.1-1.1",
|
|
37
37
|
"graphql": "^16.1.0-experimental-stream-defer.6"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
],
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/jest": "^27.5.1",
|
|
44
|
-
"jest": "^28.1.
|
|
45
|
-
"jest-serializer-simple": "^5.0.0-
|
|
46
|
-
"typescript": "^
|
|
44
|
+
"jest": "^28.1.3",
|
|
45
|
+
"jest-serializer-simple": "^5.0.0-1.1",
|
|
46
|
+
"typescript": "^5.0.0-beta"
|
|
47
47
|
}
|
|
48
48
|
}
|