@dataplan/json 0.0.1-0.9 → 0.0.1-1.2

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
@@ -1,5 +1,154 @@
1
1
  # @dataplan/json
2
2
 
3
+ ## 0.0.1-1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ [[`7dcb0e008`](https://github.com/benjie/postgraphile-private/commit/7dcb0e008bc3a60c9ef325a856d16e0baab0b9f0)]:
9
+ - grafast@0.0.1-1.2
10
+
11
+ ## 0.0.1-1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#260](https://github.com/benjie/postgraphile-private/pull/260)
16
+ [`d5312e6b9`](https://github.com/benjie/postgraphile-private/commit/d5312e6b968fbeb46d074b82a41b4bdbc166598c)
17
+ Thanks [@benjie](https://github.com/benjie)! - TypeScript v5 is now required
18
+
19
+ - [#266](https://github.com/benjie/postgraphile-private/pull/266)
20
+ [`395b4a2dd`](https://github.com/benjie/postgraphile-private/commit/395b4a2dd24044bad25f5e411a7a7cfa43883eef)
21
+ Thanks [@benjie](https://github.com/benjie)! - The Grafast step class
22
+ 'execute' and 'stream' methods now have a new additional first argument
23
+ `count` which indicates how many results they must return. This means we don't
24
+ need to rely on the `values[0].length` trick to determine how many results to
25
+ return, and thus we can pass through an empty tuple to steps that have no
26
+ dependencies.
27
+ - Updated dependencies
28
+ [[`ae304b33c`](https://github.com/benjie/postgraphile-private/commit/ae304b33c7c5a04d36b552177ae24a7b7b522645),
29
+ [`d5312e6b9`](https://github.com/benjie/postgraphile-private/commit/d5312e6b968fbeb46d074b82a41b4bdbc166598c),
30
+ [`22ec50e36`](https://github.com/benjie/postgraphile-private/commit/22ec50e360d90de41c586c5c220438f780c10ee8),
31
+ [`0f4709356`](https://github.com/benjie/postgraphile-private/commit/0f47093560cf4f8b1f215853bc91d7f6531278cc),
32
+ [`395b4a2dd`](https://github.com/benjie/postgraphile-private/commit/395b4a2dd24044bad25f5e411a7a7cfa43883eef)]:
33
+ - grafast@0.0.1-1.1
34
+
35
+ ## 0.0.1-0.23
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies
40
+ [[`89d16c972`](https://github.com/benjie/postgraphile-private/commit/89d16c972f12659de091b0b866768cacfccc8f6b),
41
+ [`8f323bdc8`](https://github.com/benjie/postgraphile-private/commit/8f323bdc88e39924de50775891bd40f1acb9b7cf),
42
+ [`9e7183c02`](https://github.com/benjie/postgraphile-private/commit/9e7183c02cb82d5f5c684c4f73962035e0267c83)]:
43
+ - grafast@0.0.1-0.23
44
+
45
+ ## 0.0.1-0.22
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies []:
50
+ - grafast@0.0.1-0.22
51
+
52
+ ## 0.0.1-0.21
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies
57
+ [[`f5a04cf66`](https://github.com/benjie/postgraphile-private/commit/f5a04cf66f220c11a6a82db8c1a78b1d91606faa)]:
58
+ - grafast@0.0.1-0.21
59
+
60
+ ## 0.0.1-0.20
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [[`aac8732f9`](undefined)]:
65
+ - grafast@0.0.1-0.20
66
+
67
+ ## 0.0.1-0.19
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies
72
+ [[`397e8bb40`](https://github.com/benjie/postgraphile-private/commit/397e8bb40fe3783995172356a39ab7cb33e3bd36)]:
73
+ - grafast@0.0.1-0.19
74
+
75
+ ## 0.0.1-0.18
76
+
77
+ ### Patch Changes
78
+
79
+ - Updated dependencies
80
+ [[`4c2b7d1ca`](https://github.com/benjie/postgraphile-private/commit/4c2b7d1ca1afbda1e47da22c346cc3b03d01b7f0),
81
+ [`c8a56cdc8`](https://github.com/benjie/postgraphile-private/commit/c8a56cdc83390e5735beb9b90f004e7975cab28c)]:
82
+ - grafast@0.0.1-0.18
83
+
84
+ ## 0.0.1-0.17
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [[`f48860d4f`](undefined)]:
89
+ - grafast@0.0.1-0.17
90
+
91
+ ## 0.0.1-0.16
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies
96
+ [[`df89aba52`](https://github.com/benjie/postgraphile-private/commit/df89aba524270e52f82987fcc4ab5d78ce180fc5)]:
97
+ - grafast@0.0.1-0.16
98
+
99
+ ## 0.0.1-0.15
100
+
101
+ ### Patch Changes
102
+
103
+ - Updated dependencies
104
+ [[`b523118fe`](https://github.com/benjie/postgraphile-private/commit/b523118fe6217c027363fea91252a3a1764e17df)]:
105
+ - grafast@0.0.1-0.15
106
+
107
+ ## 0.0.1-0.14
108
+
109
+ ### Patch Changes
110
+
111
+ - Updated dependencies
112
+ [[`d76043453`](https://github.com/benjie/postgraphile-private/commit/d7604345362c58bf7eb43ef1ac1795a2ac22ae79),
113
+ [`afa0ea5f6`](https://github.com/benjie/postgraphile-private/commit/afa0ea5f6c508d9a0ba5946ab153b13ddbd274a0),
114
+ [`851b78ef2`](https://github.com/benjie/postgraphile-private/commit/851b78ef20d430164507ec9b3f41a5a0b8a18ed7),
115
+ [`384b3594f`](https://github.com/benjie/postgraphile-private/commit/384b3594f543d113650c1b6b02b276360dd2d15f)]:
116
+ - grafast@0.0.1-0.14
117
+
118
+ ## 0.0.1-0.13
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [[`e5b664b6f`](undefined)]:
123
+ - grafast@0.0.1-0.13
124
+
125
+ ## 0.0.1-0.12
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies
130
+ [[`4f5d5bec7`](https://github.com/benjie/postgraphile-private/commit/4f5d5bec72f949b17b39cd07acc848ce7a8bfa36),
131
+ [`25f5a6cbf`](https://github.com/benjie/postgraphile-private/commit/25f5a6cbff6cd5a94ebc4f411f7fa89c209fc383)]:
132
+ - grafast@0.0.1-0.12
133
+
134
+ ## 0.0.1-0.11
135
+
136
+ ### Patch Changes
137
+
138
+ - [`0ab95d0b1`](undefined) - Update sponsors.
139
+
140
+ - Updated dependencies [[`0ab95d0b1`](undefined),
141
+ [`4783bdd7c`](https://github.com/benjie/postgraphile-private/commit/4783bdd7cc28ac8b497fdd4d6f1024d80cb432ef),
142
+ [`652cf1073`](https://github.com/benjie/postgraphile-private/commit/652cf107316ea5832f69c6a55574632187f5c876)]:
143
+ - grafast@0.0.1-0.11
144
+
145
+ ## 0.0.1-0.10
146
+
147
+ ### Patch Changes
148
+
149
+ - Updated dependencies []:
150
+ - grafast@0.0.1-0.10
151
+
3
152
  ## 0.0.1-0.9
4
153
 
5
154
  ### 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 declare type JSONValue = string | number | boolean | null | {
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,EAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAU,cAAc,EAAE,MAAM,SAAS,CAAC;AAEjD,oBAAY,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC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AS,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"}
@@ -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
- return values[0].map((v) => {
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
- return JSON.parse(v);
33
+ result[i] = JSON.parse(v);
31
34
  }
32
35
  catch (e) {
33
- return Promise.reject(e);
36
+ result[i] = Promise.reject(e);
34
37
  }
35
38
  }
36
39
  else if (v == null) {
37
- return null;
40
+ result[i] = null;
38
41
  }
39
42
  else {
40
- return Promise.reject(new Error(`JSONParseStep: expected string to parse, but received ${Array.isArray(v) ? "array" : typeof v}`));
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
- Object.defineProperty(jsonParse, "$$export", {
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-0.9",
3
+ "version": "0.0.1-1.2",
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-0.9",
36
+ "grafast": "^0.0.1-1.2",
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.0",
45
- "jest-serializer-simple": "^5.0.0-0.1",
46
- "typescript": "^4.8.1-rc"
44
+ "jest": "^28.1.3",
45
+ "jest-serializer-simple": "^5.0.0-1.1",
46
+ "typescript": "^5.0.0-beta"
47
47
  }
48
48
  }