@devvit/shared-types 0.10.23-next-2024-06-26-865c83e3a.0 → 0.10.23-next-2024-06-27-2e1096d65.0

Sign up to get free protection for your applications and to get access to all the features.
package/json.d.ts CHANGED
@@ -15,4 +15,29 @@ export type JSONObject = {
15
15
  };
16
16
  export type JSONArray = JSONValue[];
17
17
  export type JSONPrimitive = boolean | null | number | string;
18
+ /**
19
+ * Like JSONValue but deeply allow lossy undefined values that are easier to
20
+ * type but may de/serialize differently or incorrectly. For example:
21
+ *
22
+ * - `JSON.stringify({a: 1, b: 2, c: undefined, d: 3})`: `'{"a":1,"b":2,"d":3}'`.
23
+ * - `JSON.stringify([1, 2, undefined, 3])`: `'[1,2,null,3]'`.
24
+ * - `JSON.stringify(undefined)`: `undefined`.
25
+ *
26
+ * JSON.stringify() accepts an `any` input so there are no typing guards. Prefer
27
+ * plain JSONValue when possible.
28
+ *
29
+ * One mostly only cares about stringify since creating a JSON string with
30
+ * undefineds in it would require deliberate effort. These all throw errors:
31
+ *
32
+ * - `JSON.parse('{a: 1, b: 2, c: undefined, d: 3}')`.
33
+ * - `JSON.parse('[1, 2, undefined, 3]')`.
34
+ * - `JSON.parse('undefined')`.
35
+ * - `JSON.parse(undefined)` (also a typing error).
36
+ */
37
+ export type PartialJSONValue = PartialJSONPrimitive | PartialJSONArray | PartialJSONObject;
38
+ export type PartialJSONObject = Partial<{
39
+ [key: string]: PartialJSONValue;
40
+ }>;
41
+ export type PartialJSONArray = PartialJSONValue[];
42
+ export type PartialJSONPrimitive = boolean | null | number | string | undefined;
18
43
  //# sourceMappingURL=json.d.ts.map
package/json.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAC/D,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AACtD,MAAM,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AACpC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAC/D,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AACtD,MAAM,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AACpC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAC3F,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;CAAE,CAAC,CAAC;AAC7E,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,EAAE,CAAC;AAClD,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/shared-types",
3
- "version": "0.10.23-next-2024-06-26-865c83e3a.0",
3
+ "version": "0.10.23-next-2024-06-27-2e1096d65.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,12 +23,12 @@
23
23
  },
24
24
  "types": "./index.d.ts",
25
25
  "dependencies": {
26
- "@devvit/protos": "0.10.23-next-2024-06-26-865c83e3a.0"
26
+ "@devvit/protos": "0.10.23-next-2024-06-27-2e1096d65.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@devvit/eslint-config": "0.10.22",
30
30
  "@devvit/repo-tools": "0.10.22",
31
- "@devvit/tsconfig": "0.10.23-next-2024-06-26-865c83e3a.0",
31
+ "@devvit/tsconfig": "0.10.23-next-2024-06-27-2e1096d65.0",
32
32
  "@types/redis-mock": "0.17.1",
33
33
  "eslint": "8.9.0",
34
34
  "lit": "2.2.8",
@@ -41,5 +41,5 @@
41
41
  "directory": "dist"
42
42
  },
43
43
  "source": "./src/index.ts",
44
- "gitHead": "3d5fdf9ae322e02063f8b18a99e7e40a12b01726"
44
+ "gitHead": "efa7ee709e24772284a047d52a732934aa29d14f"
45
45
  }