@dataplan/json 0.0.1-beta.2 → 0.0.1-beta.20
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 +230 -0
- package/README.md +6 -7
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/steps/jsonParse.d.ts +2 -2
- package/dist/steps/jsonParse.d.ts.map +1 -1
- package/dist/steps/jsonParse.js +10 -12
- package/dist/steps/jsonParse.js.map +1 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,235 @@
|
|
|
1
1
|
# @dataplan/json
|
|
2
2
|
|
|
3
|
+
## 0.0.1-beta.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
[[`582bd768f`](https://github.com/graphile/crystal/commit/582bd768fec403ce3284f293b85b9fd86e4d3f40)]:
|
|
9
|
+
- grafast@0.1.1-beta.11
|
|
10
|
+
|
|
11
|
+
## 0.0.1-beta.19
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
[[`3c161f7e1`](https://github.com/graphile/crystal/commit/3c161f7e13375105b1035a7d5d1c0f2b507ca5c7),
|
|
17
|
+
[`a674a9923`](https://github.com/graphile/crystal/commit/a674a9923bc908c9315afa40e0cb256ee0953d16),
|
|
18
|
+
[`b7cfeffd1`](https://github.com/graphile/crystal/commit/b7cfeffd1019d61c713a5054c4f5929960a2a6ab)]:
|
|
19
|
+
- grafast@0.1.1-beta.10
|
|
20
|
+
|
|
21
|
+
## 0.0.1-beta.18
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
[[`437570f97`](https://github.com/graphile/crystal/commit/437570f97e8520afaf3d0d0b514d1f4c31546b76)]:
|
|
27
|
+
- grafast@0.1.1-beta.9
|
|
28
|
+
|
|
29
|
+
## 0.0.1-beta.17
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
[[`bd5a908a4`](https://github.com/graphile/crystal/commit/bd5a908a4d04310f90dfb46ad87398ffa993af3b)]:
|
|
35
|
+
- grafast@0.1.1-beta.8
|
|
36
|
+
|
|
37
|
+
## 0.0.1-beta.16
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- [#1980](https://github.com/graphile/crystal/pull/1980)
|
|
42
|
+
[`357d475f5`](https://github.com/graphile/crystal/commit/357d475f54fecc8c51892e0346d6872b34132430)
|
|
43
|
+
Thanks [@benjie](https://github.com/benjie)! - The signature of
|
|
44
|
+
`ExecutableStep.execute` has changed; please make the following change to each
|
|
45
|
+
of your custom step classes' `execute` methods:
|
|
46
|
+
|
|
47
|
+
```diff
|
|
48
|
+
- async execute(count: number, values: any[][], extra: ExecutionExtra) {
|
|
49
|
+
+ async execute({ count, values: newValues, extra }: ExecutionDetails) {
|
|
50
|
+
+ const values = newValues.map((dep) =>
|
|
51
|
+
+ dep.isBatch ? dep.entries : new Array(count).fill(dep.value)
|
|
52
|
+
+ );
|
|
53
|
+
// REST OF YOUR FUNCTION HERE
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For more details, see: https://err.red/gev2
|
|
58
|
+
|
|
59
|
+
- [#1973](https://github.com/graphile/crystal/pull/1973)
|
|
60
|
+
[`a0e82b9c5`](https://github.com/graphile/crystal/commit/a0e82b9c5f4e585f1af1e147299cd07944ece6f8)
|
|
61
|
+
Thanks [@benjie](https://github.com/benjie)! - Add 'unary steps' concept to
|
|
62
|
+
codebase and refactor to using new executeV2 execution method which leverages
|
|
63
|
+
them. Backwards compatibility maintained, but users should move to executeV2.
|
|
64
|
+
- Updated dependencies
|
|
65
|
+
[[`357d475f5`](https://github.com/graphile/crystal/commit/357d475f54fecc8c51892e0346d6872b34132430),
|
|
66
|
+
[`3551725e7`](https://github.com/graphile/crystal/commit/3551725e71c3ed876554e19e5ab2c1dcb0fb1143),
|
|
67
|
+
[`80836471e`](https://github.com/graphile/crystal/commit/80836471e5cedb29dee63bc5002550c4f1713cfd),
|
|
68
|
+
[`a5c20fefb`](https://github.com/graphile/crystal/commit/a5c20fefb571dea6d1187515dc48dd547e9e6204),
|
|
69
|
+
[`1ce08980e`](https://github.com/graphile/crystal/commit/1ce08980e2a52ed9bc81564d248c19648ecd3616),
|
|
70
|
+
[`dff4f2535`](https://github.com/graphile/crystal/commit/dff4f2535ac6ce893089b312fcd5fffcd98573a5),
|
|
71
|
+
[`a287a57c2`](https://github.com/graphile/crystal/commit/a287a57c2765da0fb6a132ea0953f64453210ceb),
|
|
72
|
+
[`2fe56f9a6`](https://github.com/graphile/crystal/commit/2fe56f9a6dac03484ace45c29c2223a65f9ca1db),
|
|
73
|
+
[`fed603d71`](https://github.com/graphile/crystal/commit/fed603d719c02f33e12190f925c9e3b06c581fac),
|
|
74
|
+
[`ed6e0d278`](https://github.com/graphile/crystal/commit/ed6e0d2788217a1c419634837f4208013eaf2923),
|
|
75
|
+
[`e82e4911e`](https://github.com/graphile/crystal/commit/e82e4911e32138df1b90ec0fde555ea963018d21),
|
|
76
|
+
[`42ece5aa6`](https://github.com/graphile/crystal/commit/42ece5aa6ca05345ebc17fb5c7d55df3b79b7612),
|
|
77
|
+
[`e0d69e518`](https://github.com/graphile/crystal/commit/e0d69e518a98c70f9b90f59d243ce33978c1b5a1),
|
|
78
|
+
[`6699388ec`](https://github.com/graphile/crystal/commit/6699388ec167d35c71220ce5d9113cac578da6cb),
|
|
79
|
+
[`966203504`](https://github.com/graphile/crystal/commit/96620350467ab8c65b56adf2f055e19450f8e772),
|
|
80
|
+
[`c1645b249`](https://github.com/graphile/crystal/commit/c1645b249aae949a548cd916e536ccfb63e5ab35),
|
|
81
|
+
[`ed8bbaa3c`](https://github.com/graphile/crystal/commit/ed8bbaa3cd1563a7601ca8c6b0412633b0ea4ce9),
|
|
82
|
+
[`a0e82b9c5`](https://github.com/graphile/crystal/commit/a0e82b9c5f4e585f1af1e147299cd07944ece6f8),
|
|
83
|
+
[`14e2412ee`](https://github.com/graphile/crystal/commit/14e2412ee368e8d53abf6774c7f0069f32d4e8a3),
|
|
84
|
+
[`57ab0e1e7`](https://github.com/graphile/crystal/commit/57ab0e1e72c01213b21d3efc539cd655d83d993a),
|
|
85
|
+
[`8442242e4`](https://github.com/graphile/crystal/commit/8442242e43cac7d89ca0c413cf42c9fabf6f247f),
|
|
86
|
+
[`64ce7b765`](https://github.com/graphile/crystal/commit/64ce7b7650530251aec38a51089da66f914c19b4),
|
|
87
|
+
[`cba842357`](https://github.com/graphile/crystal/commit/cba84235786acbd77ade53bae7a3fba4a9be1eb7),
|
|
88
|
+
[`2fa77d0f2`](https://github.com/graphile/crystal/commit/2fa77d0f237cdb98d3dafb6b5e4083a2c6c38673)]:
|
|
89
|
+
- grafast@0.1.1-beta.7
|
|
90
|
+
|
|
91
|
+
## 0.0.1-beta.15
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- Updated dependencies
|
|
96
|
+
[[`9f85c614d`](https://github.com/graphile/crystal/commit/9f85c614d48dc745c5fed15333dbb75af7fddc88),
|
|
97
|
+
[`6c6be29f1`](https://github.com/graphile/crystal/commit/6c6be29f12b24782c926b2bc62ed2ede09ac05de),
|
|
98
|
+
[`8315e8d01`](https://github.com/graphile/crystal/commit/8315e8d01c118cebc4ebbc53a2f264b958b252ad)]:
|
|
99
|
+
- grafast@0.1.1-beta.6
|
|
100
|
+
|
|
101
|
+
## 0.0.1-beta.14
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- [#1924](https://github.com/graphile/crystal/pull/1924)
|
|
106
|
+
[`ef44c29b2`](https://github.com/graphile/crystal/commit/ef44c29b24a1ad5a042ae1536a4546dd64b17195)
|
|
107
|
+
Thanks [@benjie](https://github.com/benjie)! - 🚨 TypeScript is now configured
|
|
108
|
+
to hide interfaces marked as `@internal`. This may result in a few errors
|
|
109
|
+
where you're accessing things you oughtn't be, but also may hide some
|
|
110
|
+
interfaces that should be exposed - please file an issue if an API you were
|
|
111
|
+
dependent on has been removed from the TypeScript typings. If that API happens
|
|
112
|
+
to be `step.dependencies`; you should first read this:
|
|
113
|
+
https://benjie.dev/graphql/ancestors
|
|
114
|
+
- Updated dependencies
|
|
115
|
+
[[`63dd7ea99`](https://github.com/graphile/crystal/commit/63dd7ea992d30ad711dd85a73a127484a0e35479),
|
|
116
|
+
[`d801c9778`](https://github.com/graphile/crystal/commit/d801c9778a86d61e060896460af9fe62a733534a),
|
|
117
|
+
[`ef44c29b2`](https://github.com/graphile/crystal/commit/ef44c29b24a1ad5a042ae1536a4546dd64b17195)]:
|
|
118
|
+
- grafast@0.1.1-beta.5
|
|
119
|
+
|
|
120
|
+
## 0.0.1-beta.13
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- Updated dependencies
|
|
125
|
+
[[`a2176ea32`](https://github.com/graphile/crystal/commit/a2176ea324db0801249661b30e9c9d314c6fb159),
|
|
126
|
+
[`886833e2e`](https://github.com/graphile/crystal/commit/886833e2e319f23d905d7184ca88fca701b94044)]:
|
|
127
|
+
- grafast@0.1.1-beta.4
|
|
128
|
+
|
|
129
|
+
## 0.0.1-beta.12
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- Updated dependencies []:
|
|
134
|
+
- grafast@0.1.1-beta.3
|
|
135
|
+
|
|
136
|
+
## 0.0.1-beta.11
|
|
137
|
+
|
|
138
|
+
### Patch Changes
|
|
139
|
+
|
|
140
|
+
- Updated dependencies
|
|
141
|
+
[[`3fdc2bce4`](https://github.com/graphile/crystal/commit/3fdc2bce42418773f808c5b8309dfb361cd95ce9),
|
|
142
|
+
[`aeef362b5`](https://github.com/graphile/crystal/commit/aeef362b5744816f01e4a6f714bbd77f92332bc5),
|
|
143
|
+
[`8a76db07f`](https://github.com/graphile/crystal/commit/8a76db07f4c110cecc6225504f9a05ccbcbc7b92),
|
|
144
|
+
[`8a0cdb95f`](https://github.com/graphile/crystal/commit/8a0cdb95f200b28b0ea1ab5caa12b23dce5f374f),
|
|
145
|
+
[`1c9f1c0ed`](https://github.com/graphile/crystal/commit/1c9f1c0edf4e621a5b6345d3a41527a18143c6ae)]:
|
|
146
|
+
- grafast@0.1.1-beta.2
|
|
147
|
+
|
|
148
|
+
## 0.0.1-beta.10
|
|
149
|
+
|
|
150
|
+
### Patch Changes
|
|
151
|
+
|
|
152
|
+
- Updated dependencies
|
|
153
|
+
[[`49fcb0d58`](https://github.com/graphile/crystal/commit/49fcb0d585b31b291c9072c339d6f5b550eefc9f)]:
|
|
154
|
+
- grafast@0.1.1-beta.1
|
|
155
|
+
|
|
156
|
+
## 0.0.1-beta.9
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- [#1778](https://github.com/graphile/crystal/pull/1778)
|
|
161
|
+
[`b2bce88da`](https://github.com/graphile/crystal/commit/b2bce88da26c7a8965468be16fc2d935eadd3434)
|
|
162
|
+
Thanks [@benjie](https://github.com/benjie)! - Enable source maps in modules
|
|
163
|
+
where it was disabled.
|
|
164
|
+
|
|
165
|
+
- Updated dependencies
|
|
166
|
+
[[`4a4d26d87`](https://github.com/graphile/crystal/commit/4a4d26d87ce74589429b8ca5126a7bfdf30351b8),
|
|
167
|
+
[`b2bce88da`](https://github.com/graphile/crystal/commit/b2bce88da26c7a8965468be16fc2d935eadd3434),
|
|
168
|
+
[`861a8a306`](https://github.com/graphile/crystal/commit/861a8a306ef42a821da19e77903ddd7e8130bfb3)]:
|
|
169
|
+
- grafast@0.1.1-beta.0
|
|
170
|
+
|
|
171
|
+
## 0.0.1-beta.8
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- [#514](https://github.com/graphile/crystal-pre-merge/pull/514)
|
|
176
|
+
[`c9848f693`](https://github.com/graphile/crystal-pre-merge/commit/c9848f6936a5abd7740c0638bfb458fb5551f03b)
|
|
177
|
+
Thanks [@benjie](https://github.com/benjie)! - Update package.json repository
|
|
178
|
+
information
|
|
179
|
+
|
|
180
|
+
- Updated dependencies
|
|
181
|
+
[[`c9848f693`](https://github.com/graphile/crystal-pre-merge/commit/c9848f6936a5abd7740c0638bfb458fb5551f03b),
|
|
182
|
+
[`ede1092fe`](https://github.com/graphile/crystal-pre-merge/commit/ede1092fe197719b6fa786f4cfa75f6a1f4c56c1),
|
|
183
|
+
[`566983fbd`](https://github.com/graphile/crystal-pre-merge/commit/566983fbd99c4b2df8c4ebd6260521670a2b7dfc),
|
|
184
|
+
[`409bf6071`](https://github.com/graphile/crystal-pre-merge/commit/409bf607180d4d8faec658c803e5ec4d1a00c451)]:
|
|
185
|
+
- grafast@0.0.1-beta.8
|
|
186
|
+
|
|
187
|
+
## 0.0.1-beta.7
|
|
188
|
+
|
|
189
|
+
### Patch Changes
|
|
190
|
+
|
|
191
|
+
- Updated dependencies
|
|
192
|
+
[[`3700e204f`](https://github.com/benjie/crystal/commit/3700e204f430db182c92ca7abc82017c81fa1f9b)]:
|
|
193
|
+
- grafast@0.0.1-beta.7
|
|
194
|
+
|
|
195
|
+
## 0.0.1-beta.6
|
|
196
|
+
|
|
197
|
+
### Patch Changes
|
|
198
|
+
|
|
199
|
+
- [#496](https://github.com/benjie/crystal/pull/496)
|
|
200
|
+
[`c9bfd9892`](https://github.com/benjie/crystal/commit/c9bfd989247f9433fb5b18c5175c9d8d64cd21a1)
|
|
201
|
+
Thanks [@benjie](https://github.com/benjie)! - Update dependencies (sometimes
|
|
202
|
+
through major versions).
|
|
203
|
+
|
|
204
|
+
- Updated dependencies
|
|
205
|
+
[[`c9bfd9892`](https://github.com/benjie/crystal/commit/c9bfd989247f9433fb5b18c5175c9d8d64cd21a1),
|
|
206
|
+
[`e613b476d`](https://github.com/benjie/crystal/commit/e613b476d6ee867d1f7509c895dabee40e7f9a31)]:
|
|
207
|
+
- grafast@0.0.1-beta.6
|
|
208
|
+
|
|
209
|
+
## 0.0.1-beta.5
|
|
210
|
+
|
|
211
|
+
### Patch Changes
|
|
212
|
+
|
|
213
|
+
- Updated dependencies
|
|
214
|
+
[[`53186213a`](https://github.com/benjie/crystal/commit/53186213ade962f4b66cb0d5ea8b57b5ce7ea85f)]:
|
|
215
|
+
- grafast@0.0.1-beta.5
|
|
216
|
+
|
|
217
|
+
## 0.0.1-beta.4
|
|
218
|
+
|
|
219
|
+
### Patch Changes
|
|
220
|
+
|
|
221
|
+
- Updated dependencies
|
|
222
|
+
[[`f9cc88dc4`](https://github.com/benjie/crystal/commit/f9cc88dc442d371aee154a28d4e63c6da39f6b2e)]:
|
|
223
|
+
- grafast@0.0.1-beta.4
|
|
224
|
+
|
|
225
|
+
## 0.0.1-beta.3
|
|
226
|
+
|
|
227
|
+
### Patch Changes
|
|
228
|
+
|
|
229
|
+
- Updated dependencies
|
|
230
|
+
[[`46cd08aa1`](https://github.com/benjie/crystal/commit/46cd08aa13e3bac4d186c72c6ce24997f37658af)]:
|
|
231
|
+
- grafast@0.0.1-beta.3
|
|
232
|
+
|
|
3
233
|
## 0.0.1-beta.2
|
|
4
234
|
|
|
5
235
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -13,9 +13,9 @@ Docs: https://grafast.org/grafast/step-library/dataplan-json/
|
|
|
13
13
|
|
|
14
14
|
## Crowd-funded open-source software
|
|
15
15
|
|
|
16
|
-
To help us develop this software sustainably
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
To help us develop this software sustainably, we ask all individuals and
|
|
17
|
+
businesses that use it to help support its ongoing maintenance and development
|
|
18
|
+
via sponsorship.
|
|
19
19
|
|
|
20
20
|
### [Click here to find out more about sponsors and sponsorship.](https://www.graphile.org/sponsor/)
|
|
21
21
|
|
|
@@ -24,12 +24,11 @@ And please give some love to our featured sponsors 🤩:
|
|
|
24
24
|
<table><tr>
|
|
25
25
|
<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>
|
|
26
26
|
<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>
|
|
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.netflix.com/"><img src="https://graphile.org/images/sponsors/Netflix.png" width="90" height="90" alt="Netflix" /><br />Netflix</a> *</td>
|
|
29
|
-
</tr><tr>
|
|
30
|
-
<td align="center"><a href=""><img src="https://graphile.org/images/sponsors/chadf.png" width="90" height="90" alt="Chad Furman" /><br />Chad Furman</a> *</td>
|
|
31
28
|
<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>
|
|
32
|
-
|
|
29
|
+
</tr><tr>
|
|
30
|
+
<td align="center"><a href="https://gosteelhead.com/"><img src="https://graphile.org/images/sponsors/steelhead.svg" width="90" height="90" alt="Steelhead" /><br />Steelhead</a> *</td>
|
|
31
|
+
<td align="center"><a href="https://www.sylvera.com/"><img src="https://graphile.org/images/sponsors/sylvera.svg" width="90" height="90" alt="Sylvera" /><br />Sylvera</a> *</td>
|
|
33
32
|
</tr></table>
|
|
34
33
|
|
|
35
34
|
<em>\* Sponsors the entire Graphile suite</em>
|
package/dist/index.js
CHANGED
|
@@ -4,3 +4,4 @@ exports.JSONParseStep = exports.jsonParse = void 0;
|
|
|
4
4
|
var jsonParse_js_1 = require("./steps/jsonParse.js");
|
|
5
5
|
Object.defineProperty(exports, "jsonParse", { enumerable: true, get: function () { return jsonParse_js_1.jsonParse; } });
|
|
6
6
|
Object.defineProperty(exports, "JSONParseStep", { enumerable: true, get: function () { return jsonParse_js_1.JSONParseStep; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2E;AAAlE,yGAAA,SAAS,OAAA;AAAE,6GAAA,aAAa,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccessStep,
|
|
1
|
+
import type { AccessStep, ExecutionDetails, GrafastResultsList } from "grafast";
|
|
2
2
|
import { ExecutableStep } from "grafast";
|
|
3
3
|
export type JSONValue = string | number | boolean | null | {
|
|
4
4
|
[key: string]: JSONValue;
|
|
@@ -19,7 +19,7 @@ export declare class JSONParseStep<TJSON extends JSONValue> extends ExecutableSt
|
|
|
19
19
|
[key: string]: unknown;
|
|
20
20
|
} ? TJSON[TKey] : never>;
|
|
21
21
|
at<TIndex extends keyof TJSON & number>(index: TIndex): AccessStep<TJSON[TIndex]>;
|
|
22
|
-
execute(
|
|
22
|
+
execute({ indexMap, values: [stringDep], }: ExecutionDetails<[string]>): GrafastResultsList<TJSON>;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* This plan accepts as JSON string as its only input and will result in the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonParse.d.ts","sourceRoot":"","sources":["../../src/steps/jsonParse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"jsonParse.d.ts","sourceRoot":"","sources":["../../src/steps/jsonParse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAEnB,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;AAErB;;;GAGG;AACH,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,CAAC,EACN,QAAQ,EACR,MAAM,EAAE,CAAC,SAAS,CAAC,GACpB,EAAE,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC;CAsB1D;AAED;;;GAGG;AACH,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
|
@@ -21,7 +21,7 @@ class JSONParseStep extends grafast_1.ExecutableStep {
|
|
|
21
21
|
this.addDependency($stringPlan);
|
|
22
22
|
}
|
|
23
23
|
toStringMeta() {
|
|
24
|
-
return chalk_1.default.bold.yellow(String(this.
|
|
24
|
+
return chalk_1.default.bold.yellow(String(this.getDep(0).id));
|
|
25
25
|
}
|
|
26
26
|
get(key) {
|
|
27
27
|
return (0, grafast_1.access)(this, [key]);
|
|
@@ -29,27 +29,24 @@ class JSONParseStep extends grafast_1.ExecutableStep {
|
|
|
29
29
|
at(index) {
|
|
30
30
|
return (0, grafast_1.access)(this, [index]);
|
|
31
31
|
}
|
|
32
|
-
execute(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
for (let i = 0; i < count; i++) {
|
|
36
|
-
const v = list[i];
|
|
32
|
+
execute({ indexMap, values: [stringDep], }) {
|
|
33
|
+
return indexMap((i) => {
|
|
34
|
+
const v = stringDep.at(i);
|
|
37
35
|
if (typeof v === "string") {
|
|
38
36
|
try {
|
|
39
|
-
|
|
37
|
+
return JSON.parse(v);
|
|
40
38
|
}
|
|
41
39
|
catch (e) {
|
|
42
|
-
|
|
40
|
+
return Promise.reject(e);
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
else if (v == null) {
|
|
46
|
-
|
|
44
|
+
return null;
|
|
47
45
|
}
|
|
48
46
|
else {
|
|
49
|
-
|
|
47
|
+
return Promise.reject(new Error(`JSONParseStep: expected string to parse, but received ${Array.isArray(v) ? "array" : typeof v}`));
|
|
50
48
|
}
|
|
51
|
-
}
|
|
52
|
-
return result;
|
|
49
|
+
});
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
exports.JSONParseStep = JSONParseStep;
|
|
@@ -62,3 +59,4 @@ function jsonParse($string) {
|
|
|
62
59
|
}
|
|
63
60
|
exports.jsonParse = jsonParse;
|
|
64
61
|
(0, grafast_1.exportAs)("@dataplan/json", jsonParse, "jsonParse");
|
|
62
|
+
//# sourceMappingURL=jsonParse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonParse.js","sourceRoot":"","sources":["../../src/steps/jsonParse.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAO1B,qCAA2D;AAU3D;;;GAGG;AACH,MAAa,aAEX,SAAQ,wBAAqB;aACtB,aAAQ,GAAG;QAChB,UAAU,EAAE,gBAAgB;QAC5B,UAAU,EAAE,eAAe;KAC5B,AAHc,CAGb;IAKF,YAAY,WAA0C;QACpD,KAAK,EAAE,CAAC;QALV,wEAAwE;QACxE,WAAW;QACX,kBAAa,GAAG,KAAK,CAAC;QAIpB,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IAED,YAAY;QACV,OAAO,eAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,GAAG,CACD,GAAS;QAIT,OAAO,IAAA,gBAAM,EAAC,IAAI,EAAE,CAAC,GAAa,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,EAAE,CACA,KAAa;QAEb,OAAO,IAAA,gBAAM,EAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,CAAC,EACN,QAAQ,EACR,MAAM,EAAE,CAAC,SAAS,CAAC,GACQ;QAC3B,OAAO,QAAQ,CAAyB,CAAC,CAAC,EAAE,EAAE;YAC5C,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;gBACzB,IAAI;oBACF,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;iBACtB;gBAAC,OAAO,CAAC,EAAE;oBACV,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;iBAC1B;aACF;iBAAM,IAAI,CAAC,IAAI,IAAI,EAAE;gBACpB,OAAO,IAAW,CAAC;aACpB;iBAAM;gBACL,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,yDACE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CACtC,EAAE,CACH,CACF,CAAC;aACH;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AA1DH,sCA2DC;AAED;;;GAGG;AACH,SAAgB,SAAS,CACvB,OAAsC;IAEtC,OAAO,IAAI,aAAa,CAAQ,OAAO,CAAC,CAAC;AAC3C,CAAC;AAJD,8BAIC;AAED,IAAA,kBAAQ,EAAC,gBAAgB,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataplan/json",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.20",
|
|
4
4
|
"description": "JSON step classes for Grafast",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/graphile/
|
|
12
|
+
"url": "git+https://github.com/graphile/crystal.git"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"graphile",
|
|
@@ -22,26 +22,26 @@
|
|
|
22
22
|
"author": "Benjie Gillam <code@benjiegillam.com>",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"bugs": {
|
|
25
|
-
"url": "https://github.com/graphile/
|
|
25
|
+
"url": "https://github.com/graphile/crystal/issues"
|
|
26
26
|
},
|
|
27
|
-
"homepage": "https://github.com/graphile/
|
|
27
|
+
"homepage": "https://github.com/graphile/crystal/tree/main/grafast/dataplan-json",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"chalk": "^4.1.2",
|
|
30
|
-
"tslib": "^2.
|
|
30
|
+
"tslib": "^2.6.2"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=14.17"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"grafast": "^0.
|
|
36
|
+
"grafast": "^0.1.1-beta.11"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/jest": "^
|
|
43
|
-
"jest": "^
|
|
44
|
-
"jest-serializer-simple": "^5.0.0-beta.
|
|
45
|
-
"typescript": "^5.
|
|
42
|
+
"@types/jest": "^29.5.4",
|
|
43
|
+
"jest": "^29.6.4",
|
|
44
|
+
"jest-serializer-simple": "^5.0.0-beta.3",
|
|
45
|
+
"typescript": "^5.2.2"
|
|
46
46
|
}
|
|
47
47
|
}
|