@milaboratories/pl-model-common 1.24.3 → 1.24.4

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.
Files changed (275) hide show
  1. package/dist/base32_encode.cjs +11 -11
  2. package/dist/base32_encode.cjs.map +1 -1
  3. package/dist/base32_encode.d.ts +1 -1
  4. package/dist/base32_encode.js +11 -11
  5. package/dist/base32_encode.js.map +1 -1
  6. package/dist/base64.cjs +2 -2
  7. package/dist/base64.cjs.map +1 -1
  8. package/dist/base64.d.ts +1 -1
  9. package/dist/base64.d.ts.map +1 -1
  10. package/dist/base64.js +2 -2
  11. package/dist/base64.js.map +1 -1
  12. package/dist/block_state.d.ts +3 -3
  13. package/dist/bmodel/block_config.cjs +1 -1
  14. package/dist/bmodel/block_config.cjs.map +1 -1
  15. package/dist/bmodel/block_config.d.ts +3 -3
  16. package/dist/bmodel/block_config.d.ts.map +1 -1
  17. package/dist/bmodel/block_config.js +1 -1
  18. package/dist/bmodel/block_config.js.map +1 -1
  19. package/dist/bmodel/code.cjs +1 -1
  20. package/dist/bmodel/code.cjs.map +1 -1
  21. package/dist/bmodel/code.d.ts +2 -2
  22. package/dist/bmodel/code.js +1 -1
  23. package/dist/bmodel/code.js.map +1 -1
  24. package/dist/bmodel/container.d.ts +5 -5
  25. package/dist/bmodel/index.d.ts +5 -5
  26. package/dist/bmodel/normalization.cjs +17 -17
  27. package/dist/bmodel/normalization.cjs.map +1 -1
  28. package/dist/bmodel/normalization.d.ts +2 -2
  29. package/dist/bmodel/normalization.d.ts.map +1 -1
  30. package/dist/bmodel/normalization.js +17 -17
  31. package/dist/bmodel/normalization.js.map +1 -1
  32. package/dist/bmodel/types.d.ts +1 -1
  33. package/dist/branding.d.ts +2 -2
  34. package/dist/common_types.d.ts +1 -1
  35. package/dist/driver_kit.d.ts +1 -1
  36. package/dist/drivers/ChunkedStreamReader.cjs +13 -12
  37. package/dist/drivers/ChunkedStreamReader.cjs.map +1 -1
  38. package/dist/drivers/ChunkedStreamReader.d.ts +2 -2
  39. package/dist/drivers/ChunkedStreamReader.d.ts.map +1 -1
  40. package/dist/drivers/ChunkedStreamReader.js +13 -12
  41. package/dist/drivers/ChunkedStreamReader.js.map +1 -1
  42. package/dist/drivers/blob.cjs +1 -1
  43. package/dist/drivers/blob.cjs.map +1 -1
  44. package/dist/drivers/blob.d.ts +4 -4
  45. package/dist/drivers/blob.d.ts.map +1 -1
  46. package/dist/drivers/blob.js +1 -1
  47. package/dist/drivers/blob.js.map +1 -1
  48. package/dist/drivers/index.d.ts +8 -8
  49. package/dist/drivers/log.cjs +1 -1
  50. package/dist/drivers/log.cjs.map +1 -1
  51. package/dist/drivers/log.js +1 -1
  52. package/dist/drivers/log.js.map +1 -1
  53. package/dist/drivers/ls.cjs +3 -3
  54. package/dist/drivers/ls.cjs.map +1 -1
  55. package/dist/drivers/ls.d.ts +6 -6
  56. package/dist/drivers/ls.d.ts.map +1 -1
  57. package/dist/drivers/ls.js +3 -3
  58. package/dist/drivers/ls.js.map +1 -1
  59. package/dist/drivers/pframe/column_filter.d.ts +1 -1
  60. package/dist/drivers/pframe/data_info.cjs +119 -110
  61. package/dist/drivers/pframe/data_info.cjs.map +1 -1
  62. package/dist/drivers/pframe/data_info.d.ts +10 -10
  63. package/dist/drivers/pframe/data_info.d.ts.map +1 -1
  64. package/dist/drivers/pframe/data_info.js +119 -110
  65. package/dist/drivers/pframe/data_info.js.map +1 -1
  66. package/dist/drivers/pframe/data_types.cjs +7 -4
  67. package/dist/drivers/pframe/data_types.cjs.map +1 -1
  68. package/dist/drivers/pframe/data_types.d.ts +2 -2
  69. package/dist/drivers/pframe/data_types.d.ts.map +1 -1
  70. package/dist/drivers/pframe/data_types.js +7 -4
  71. package/dist/drivers/pframe/data_types.js.map +1 -1
  72. package/dist/drivers/pframe/driver.d.ts +10 -10
  73. package/dist/drivers/pframe/driver.d.ts.map +1 -1
  74. package/dist/drivers/pframe/find_columns.d.ts +2 -2
  75. package/dist/drivers/pframe/index.d.ts +14 -14
  76. package/dist/drivers/pframe/linker_columns.cjs +13 -5
  77. package/dist/drivers/pframe/linker_columns.cjs.map +1 -1
  78. package/dist/drivers/pframe/linker_columns.d.ts +2 -2
  79. package/dist/drivers/pframe/linker_columns.d.ts.map +1 -1
  80. package/dist/drivers/pframe/linker_columns.js +13 -5
  81. package/dist/drivers/pframe/linker_columns.js.map +1 -1
  82. package/dist/drivers/pframe/pframe.d.ts +6 -6
  83. package/dist/drivers/pframe/pframe.d.ts.map +1 -1
  84. package/dist/drivers/pframe/query/index.d.ts +2 -2
  85. package/dist/drivers/pframe/query/query_common.d.ts +37 -37
  86. package/dist/drivers/pframe/query/query_data.d.ts +2 -2
  87. package/dist/drivers/pframe/query/query_data.d.ts.map +1 -1
  88. package/dist/drivers/pframe/query/query_spec.d.ts +3 -3
  89. package/dist/drivers/pframe/query/query_spec.d.ts.map +1 -1
  90. package/dist/drivers/pframe/spec/anchored.cjs +6 -6
  91. package/dist/drivers/pframe/spec/anchored.cjs.map +1 -1
  92. package/dist/drivers/pframe/spec/anchored.d.ts +4 -4
  93. package/dist/drivers/pframe/spec/anchored.d.ts.map +1 -1
  94. package/dist/drivers/pframe/spec/anchored.js +6 -6
  95. package/dist/drivers/pframe/spec/anchored.js.map +1 -1
  96. package/dist/drivers/pframe/spec/filtered_column.cjs +1 -1
  97. package/dist/drivers/pframe/spec/filtered_column.cjs.map +1 -1
  98. package/dist/drivers/pframe/spec/filtered_column.d.ts +1 -1
  99. package/dist/drivers/pframe/spec/filtered_column.js +1 -1
  100. package/dist/drivers/pframe/spec/filtered_column.js.map +1 -1
  101. package/dist/drivers/pframe/spec/ids.cjs.map +1 -1
  102. package/dist/drivers/pframe/spec/ids.d.ts +5 -5
  103. package/dist/drivers/pframe/spec/ids.js.map +1 -1
  104. package/dist/drivers/pframe/spec/index.d.ts +6 -6
  105. package/dist/drivers/pframe/spec/native_id.cjs.map +1 -1
  106. package/dist/drivers/pframe/spec/native_id.d.ts +3 -3
  107. package/dist/drivers/pframe/spec/native_id.d.ts.map +1 -1
  108. package/dist/drivers/pframe/spec/native_id.js.map +1 -1
  109. package/dist/drivers/pframe/spec/selectors.cjs +1 -1
  110. package/dist/drivers/pframe/spec/selectors.cjs.map +1 -1
  111. package/dist/drivers/pframe/spec/selectors.d.ts +4 -4
  112. package/dist/drivers/pframe/spec/selectors.d.ts.map +1 -1
  113. package/dist/drivers/pframe/spec/selectors.js +1 -1
  114. package/dist/drivers/pframe/spec/selectors.js.map +1 -1
  115. package/dist/drivers/pframe/spec/spec.cjs +64 -59
  116. package/dist/drivers/pframe/spec/spec.cjs.map +1 -1
  117. package/dist/drivers/pframe/spec/spec.d.ts +15 -15
  118. package/dist/drivers/pframe/spec/spec.d.ts.map +1 -1
  119. package/dist/drivers/pframe/spec/spec.js +64 -59
  120. package/dist/drivers/pframe/spec/spec.js.map +1 -1
  121. package/dist/drivers/pframe/table.d.ts +2 -2
  122. package/dist/drivers/pframe/table_calculate.cjs +11 -11
  123. package/dist/drivers/pframe/table_calculate.cjs.map +1 -1
  124. package/dist/drivers/pframe/table_calculate.d.ts +30 -30
  125. package/dist/drivers/pframe/table_calculate.d.ts.map +1 -1
  126. package/dist/drivers/pframe/table_calculate.js +11 -11
  127. package/dist/drivers/pframe/table_calculate.js.map +1 -1
  128. package/dist/drivers/pframe/table_common.cjs +4 -4
  129. package/dist/drivers/pframe/table_common.cjs.map +1 -1
  130. package/dist/drivers/pframe/table_common.d.ts +6 -6
  131. package/dist/drivers/pframe/table_common.js +4 -4
  132. package/dist/drivers/pframe/table_common.js.map +1 -1
  133. package/dist/drivers/pframe/type_util.d.ts.map +1 -1
  134. package/dist/drivers/pframe/unique_values.d.ts +4 -4
  135. package/dist/drivers/urls.cjs +2 -2
  136. package/dist/drivers/urls.cjs.map +1 -1
  137. package/dist/drivers/urls.d.ts +1 -1
  138. package/dist/drivers/urls.js +2 -2
  139. package/dist/drivers/urls.js.map +1 -1
  140. package/dist/errors.cjs +12 -12
  141. package/dist/errors.cjs.map +1 -1
  142. package/dist/errors.d.ts +1 -1
  143. package/dist/errors.d.ts.map +1 -1
  144. package/dist/errors.js +12 -12
  145. package/dist/errors.js.map +1 -1
  146. package/dist/flags/block_flags.cjs +2 -2
  147. package/dist/flags/block_flags.cjs.map +1 -1
  148. package/dist/flags/block_flags.d.ts.map +1 -1
  149. package/dist/flags/block_flags.js +2 -2
  150. package/dist/flags/block_flags.js.map +1 -1
  151. package/dist/flags/flag_utils.cjs +31 -29
  152. package/dist/flags/flag_utils.cjs.map +1 -1
  153. package/dist/flags/flag_utils.d.ts +33 -33
  154. package/dist/flags/flag_utils.d.ts.map +1 -1
  155. package/dist/flags/flag_utils.js +31 -29
  156. package/dist/flags/flag_utils.js.map +1 -1
  157. package/dist/flags/index.d.ts +3 -3
  158. package/dist/flags/type_utils.d.ts +1 -1
  159. package/dist/flags/type_utils.d.ts.map +1 -1
  160. package/dist/httpAuth.cjs +4 -5
  161. package/dist/httpAuth.cjs.map +1 -1
  162. package/dist/httpAuth.d.ts +1 -1
  163. package/dist/httpAuth.d.ts.map +1 -1
  164. package/dist/httpAuth.js +4 -5
  165. package/dist/httpAuth.js.map +1 -1
  166. package/dist/index.d.ts +19 -19
  167. package/dist/json.cjs +1 -1
  168. package/dist/json.cjs.map +1 -1
  169. package/dist/json.d.ts.map +1 -1
  170. package/dist/json.js +1 -1
  171. package/dist/json.js.map +1 -1
  172. package/dist/navigation.cjs +1 -1
  173. package/dist/navigation.cjs.map +1 -1
  174. package/dist/navigation.d.ts +3 -3
  175. package/dist/navigation.js +1 -1
  176. package/dist/navigation.js.map +1 -1
  177. package/dist/plid.cjs +4 -4
  178. package/dist/plid.cjs.map +1 -1
  179. package/dist/plid.d.ts +1 -1
  180. package/dist/plid.js +4 -4
  181. package/dist/plid.js.map +1 -1
  182. package/dist/pool/entry.d.ts +1 -1
  183. package/dist/pool/index.d.ts +3 -3
  184. package/dist/pool/query.cjs +23 -23
  185. package/dist/pool/query.cjs.map +1 -1
  186. package/dist/pool/query.d.ts +9 -9
  187. package/dist/pool/query.d.ts.map +1 -1
  188. package/dist/pool/query.js +23 -23
  189. package/dist/pool/query.js.map +1 -1
  190. package/dist/pool/spec.cjs +9 -9
  191. package/dist/pool/spec.cjs.map +1 -1
  192. package/dist/pool/spec.d.ts +4 -4
  193. package/dist/pool/spec.d.ts.map +1 -1
  194. package/dist/pool/spec.js +9 -9
  195. package/dist/pool/spec.js.map +1 -1
  196. package/dist/ref.cjs +20 -18
  197. package/dist/ref.cjs.map +1 -1
  198. package/dist/ref.d.ts +1 -1
  199. package/dist/ref.d.ts.map +1 -1
  200. package/dist/ref.js +20 -18
  201. package/dist/ref.js.map +1 -1
  202. package/dist/utag.d.ts +1 -1
  203. package/dist/util.cjs +1 -1
  204. package/dist/util.cjs.map +1 -1
  205. package/dist/util.js +1 -1
  206. package/dist/util.js.map +1 -1
  207. package/dist/value_or_error.cjs.map +1 -1
  208. package/dist/value_or_error.d.ts.map +1 -1
  209. package/dist/value_or_error.js.map +1 -1
  210. package/package.json +18 -17
  211. package/src/base32_encode.ts +12 -12
  212. package/src/base64.ts +12 -8
  213. package/src/block_state.ts +3 -3
  214. package/src/bmodel/block_config.ts +12 -6
  215. package/src/bmodel/code.ts +3 -3
  216. package/src/bmodel/container.ts +5 -5
  217. package/src/bmodel/index.ts +5 -5
  218. package/src/bmodel/normalization.ts +33 -25
  219. package/src/bmodel/types.ts +1 -1
  220. package/src/branding.ts +2 -2
  221. package/src/common_types.ts +1 -1
  222. package/src/driver_kit.ts +1 -1
  223. package/src/drivers/ChunkedStreamReader.ts +16 -14
  224. package/src/drivers/blob.ts +7 -11
  225. package/src/drivers/index.ts +8 -8
  226. package/src/drivers/log.ts +3 -3
  227. package/src/drivers/ls.ts +18 -18
  228. package/src/drivers/pframe/column_filter.ts +1 -1
  229. package/src/drivers/pframe/data_info.ts +146 -146
  230. package/src/drivers/pframe/data_types.ts +56 -36
  231. package/src/drivers/pframe/driver.ts +20 -36
  232. package/src/drivers/pframe/find_columns.ts +2 -2
  233. package/src/drivers/pframe/index.ts +14 -14
  234. package/src/drivers/pframe/linker_columns.test.ts +280 -273
  235. package/src/drivers/pframe/linker_columns.ts +65 -39
  236. package/src/drivers/pframe/pframe.ts +6 -9
  237. package/src/drivers/pframe/query/index.ts +2 -2
  238. package/src/drivers/pframe/query/query_common.ts +46 -46
  239. package/src/drivers/pframe/query/query_data.ts +17 -10
  240. package/src/drivers/pframe/query/query_spec.ts +18 -10
  241. package/src/drivers/pframe/spec/anchored.ts +44 -33
  242. package/src/drivers/pframe/spec/filtered_column.ts +2 -2
  243. package/src/drivers/pframe/spec/ids.ts +6 -6
  244. package/src/drivers/pframe/spec/index.ts +6 -6
  245. package/src/drivers/pframe/spec/native_id.ts +7 -9
  246. package/src/drivers/pframe/spec/selectors.test.ts +170 -146
  247. package/src/drivers/pframe/spec/selectors.ts +22 -31
  248. package/src/drivers/pframe/spec/spec.test.ts +163 -176
  249. package/src/drivers/pframe/spec/spec.ts +132 -117
  250. package/src/drivers/pframe/table.ts +2 -2
  251. package/src/drivers/pframe/table_calculate.ts +44 -50
  252. package/src/drivers/pframe/table_common.ts +10 -10
  253. package/src/drivers/pframe/type_util.ts +2 -7
  254. package/src/drivers/pframe/unique_values.ts +4 -4
  255. package/src/drivers/urls.ts +3 -3
  256. package/src/errors.test.ts +20 -20
  257. package/src/errors.ts +24 -20
  258. package/src/flags/block_flags.ts +8 -7
  259. package/src/flags/flag_utils.test.ts +94 -73
  260. package/src/flags/flag_utils.ts +73 -50
  261. package/src/flags/index.ts +3 -3
  262. package/src/flags/type_utils.ts +10 -7
  263. package/src/httpAuth.ts +5 -6
  264. package/src/index.ts +19 -19
  265. package/src/json.ts +28 -17
  266. package/src/navigation.ts +4 -4
  267. package/src/plid.ts +6 -6
  268. package/src/pool/entry.ts +1 -1
  269. package/src/pool/index.ts +3 -3
  270. package/src/pool/query.ts +52 -56
  271. package/src/pool/spec.ts +20 -17
  272. package/src/ref.ts +25 -19
  273. package/src/utag.ts +1 -1
  274. package/src/util.ts +1 -1
  275. package/src/value_or_error.ts +6 -6
@@ -1,45 +1,50 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { RuntimeCapabilities, IncompatibleFlagsError } from './flag_utils';
3
- import type { BlockCodeFeatureFlags } from './block_flags';
1
+ import { describe, it, expect } from "vitest";
2
+ import { RuntimeCapabilities, IncompatibleFlagsError } from "./flag_utils";
3
+ import type { BlockCodeFeatureFlags } from "./block_flags";
4
4
 
5
- describe('RuntimeCapabilities', () => {
6
- describe('addSupportedRequirement', () => {
7
- it('should add a supported requirement with default value true', () => {
5
+ describe("RuntimeCapabilities", () => {
6
+ describe("addSupportedRequirement", () => {
7
+ it("should add a supported requirement with default value true", () => {
8
8
  const capabilities = new RuntimeCapabilities();
9
- capabilities.addSupportedRequirement('requiresModelAPIVersion');
9
+ capabilities.addSupportedRequirement("requiresModelAPIVersion");
10
10
  const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: true };
11
11
  expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
12
12
  });
13
13
 
14
- it('should add a supported requirement with a specific boolean value', () => {
15
- const capabilities = new RuntimeCapabilities();
16
- capabilities.addSupportedRequirement('requiresModelAPIVersion', false);
17
- const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: false };
18
- expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
19
- const blockFlags2: BlockCodeFeatureFlags = { requiresModelAPIVersion: true };
20
- expect(capabilities.checkCompatibility(blockFlags2)).toBe(false);
14
+ it("should add a supported requirement with a specific boolean value", () => {
15
+ const capabilities = new RuntimeCapabilities();
16
+ capabilities.addSupportedRequirement("requiresModelAPIVersion", false);
17
+ const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: false };
18
+ expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
19
+ const blockFlags2: BlockCodeFeatureFlags = { requiresModelAPIVersion: true };
20
+ expect(capabilities.checkCompatibility(blockFlags2)).toBe(false);
21
21
  });
22
22
 
23
- it('should add a supported requirement with a specific number value', () => {
24
- const capabilities = new RuntimeCapabilities();
25
- capabilities.addSupportedRequirement('requiresModelAPIVersion', 2);
26
- const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: 2 };
27
- expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
28
- const blockFlags2: BlockCodeFeatureFlags = { requiresModelAPIVersion: 3 };
29
- expect(capabilities.checkCompatibility(blockFlags2)).toBe(false);
23
+ it("should add a supported requirement with a specific number value", () => {
24
+ const capabilities = new RuntimeCapabilities();
25
+ capabilities.addSupportedRequirement("requiresModelAPIVersion", 2);
26
+ const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: 2 };
27
+ expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
28
+ const blockFlags2: BlockCodeFeatureFlags = { requiresModelAPIVersion: 3 };
29
+ expect(capabilities.checkCompatibility(blockFlags2)).toBe(false);
30
30
  });
31
31
 
32
- it('should allow chaining', () => {
33
- const capabilities = new RuntimeCapabilities();
34
- capabilities.addSupportedRequirement('requiresModelAPIVersion').addSupportedRequirement('requiresUIAPIVersion');
35
- const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: true, requiresUIAPIVersion: true };
36
- expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
32
+ it("should allow chaining", () => {
33
+ const capabilities = new RuntimeCapabilities();
34
+ capabilities
35
+ .addSupportedRequirement("requiresModelAPIVersion")
36
+ .addSupportedRequirement("requiresUIAPIVersion");
37
+ const blockFlags: BlockCodeFeatureFlags = {
38
+ requiresModelAPIVersion: true,
39
+ requiresUIAPIVersion: true,
40
+ };
41
+ expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
37
42
  });
38
43
 
39
- it('should support multiple values for the same requirement', () => {
44
+ it("should support multiple values for the same requirement", () => {
40
45
  const capabilities = new RuntimeCapabilities();
41
- capabilities.addSupportedRequirement('requiresModelAPIVersion', 2);
42
- capabilities.addSupportedRequirement('requiresModelAPIVersion', 3);
46
+ capabilities.addSupportedRequirement("requiresModelAPIVersion", 2);
47
+ capabilities.addSupportedRequirement("requiresModelAPIVersion", 3);
43
48
  const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: 2 };
44
49
  expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
45
50
  const blockFlags2: BlockCodeFeatureFlags = { requiresModelAPIVersion: 3 };
@@ -49,48 +54,55 @@ describe('RuntimeCapabilities', () => {
49
54
  });
50
55
  });
51
56
 
52
- describe('checkCompatibility and getIncompatibleFlags', () => {
53
- it('should return compatible for undefined flags', () => {
57
+ describe("checkCompatibility and getIncompatibleFlags", () => {
58
+ it("should return compatible for undefined flags", () => {
54
59
  const capabilities = new RuntimeCapabilities();
55
60
  expect(capabilities.checkCompatibility(undefined)).toBe(true);
56
61
  expect(capabilities.getIncompatibleFlags(undefined)).toBeUndefined();
57
62
  });
58
63
 
59
- it('should return compatible for empty flags object', () => {
64
+ it("should return compatible for empty flags object", () => {
60
65
  const capabilities = new RuntimeCapabilities();
61
66
  expect(capabilities.checkCompatibility({})).toBe(true);
62
67
  expect(capabilities.getIncompatibleFlags({})).toBeUndefined();
63
68
  });
64
69
 
65
- it('should be compatible if requirements are met', () => {
70
+ it("should be compatible if requirements are met", () => {
66
71
  const capabilities = new RuntimeCapabilities()
67
- .addSupportedRequirement('requiresModelAPIVersion')
68
- .addSupportedRequirement('requiresUIAPIVersion', 2);
69
- const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: true, requiresUIAPIVersion: 2, supportsSomething: true };
72
+ .addSupportedRequirement("requiresModelAPIVersion")
73
+ .addSupportedRequirement("requiresUIAPIVersion", 2);
74
+ const blockFlags: BlockCodeFeatureFlags = {
75
+ requiresModelAPIVersion: true,
76
+ requiresUIAPIVersion: 2,
77
+ supportsSomething: true,
78
+ };
70
79
  expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
71
80
  expect(capabilities.getIncompatibleFlags(blockFlags)).toBeUndefined();
72
81
  });
73
82
 
74
- it('should be incompatible if a requirement value is not met', () => {
75
- const capabilities = new RuntimeCapabilities().addSupportedRequirement('requiresModelAPIVersion', 2);
76
- const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: 3 };
77
- expect(capabilities.checkCompatibility(blockFlags)).toBe(false);
78
- const incompatible = capabilities.getIncompatibleFlags(blockFlags);
79
- expect(incompatible).toEqual(new Map([['requiresModelAPIVersion', 3]]));
83
+ it("should be incompatible if a requirement value is not met", () => {
84
+ const capabilities = new RuntimeCapabilities().addSupportedRequirement(
85
+ "requiresModelAPIVersion",
86
+ 2,
87
+ );
88
+ const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: 3 };
89
+ expect(capabilities.checkCompatibility(blockFlags)).toBe(false);
90
+ const incompatible = capabilities.getIncompatibleFlags(blockFlags);
91
+ expect(incompatible).toEqual(new Map([["requiresModelAPIVersion", 3]]));
80
92
  });
81
93
 
82
- it('should be incompatible if a requirement is not specified in runtime capabilities', () => {
94
+ it("should be incompatible if a requirement is not specified in runtime capabilities", () => {
83
95
  const capabilities = new RuntimeCapabilities();
84
96
  const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: true };
85
97
  expect(capabilities.checkCompatibility(blockFlags)).toBe(false);
86
98
  const incompatible = capabilities.getIncompatibleFlags(blockFlags);
87
- expect(incompatible).toEqual(new Map([['requiresModelAPIVersion', true]]));
99
+ expect(incompatible).toEqual(new Map([["requiresModelAPIVersion", true]]));
88
100
  });
89
101
 
90
- it('should correctly identify multiple incompatible flags', () => {
102
+ it("should correctly identify multiple incompatible flags", () => {
91
103
  const capabilities = new RuntimeCapabilities()
92
- .addSupportedRequirement('requiresModelAPIVersion', true)
93
- .addSupportedRequirement('requiresUIAPIVersion', 2);
104
+ .addSupportedRequirement("requiresModelAPIVersion", true)
105
+ .addSupportedRequirement("requiresUIAPIVersion", 2);
94
106
 
95
107
  const blockFlags: BlockCodeFeatureFlags = {
96
108
  requiresModelAPIVersion: false,
@@ -100,51 +112,60 @@ describe('RuntimeCapabilities', () => {
100
112
 
101
113
  expect(capabilities.checkCompatibility(blockFlags)).toBe(false);
102
114
  const incompatible = capabilities.getIncompatibleFlags(blockFlags);
103
- expect(incompatible).toEqual(new Map<string, number | boolean>([
104
- ['requiresModelAPIVersion', false],
105
- ['requiresUIAPIVersion', 3],
106
- ['requiresSomethingElse', true],
107
- ]));
115
+ expect(incompatible).toEqual(
116
+ new Map<string, number | boolean>([
117
+ ["requiresModelAPIVersion", false],
118
+ ["requiresUIAPIVersion", 3],
119
+ ["requiresSomethingElse", true],
120
+ ]),
121
+ );
108
122
  });
109
123
 
110
- it('should ignore non-requirement flags', () => {
111
- const capabilities = new RuntimeCapabilities();
112
- const blockFlags: BlockCodeFeatureFlags = { supportsSomething: true };
113
- expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
114
- expect(capabilities.getIncompatibleFlags(blockFlags)).toBeUndefined();
124
+ it("should ignore non-requirement flags", () => {
125
+ const capabilities = new RuntimeCapabilities();
126
+ const blockFlags: BlockCodeFeatureFlags = { supportsSomething: true };
127
+ expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
128
+ expect(capabilities.getIncompatibleFlags(blockFlags)).toBeUndefined();
115
129
  });
116
130
 
117
- it('should ignore undefined requirement flags in block', () => {
118
- const capabilities = new RuntimeCapabilities();
119
- const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: undefined };
120
- expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
121
- expect(capabilities.getIncompatibleFlags(blockFlags)).toBeUndefined();
131
+ it("should ignore undefined requirement flags in block", () => {
132
+ const capabilities = new RuntimeCapabilities();
133
+ const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: undefined };
134
+ expect(capabilities.checkCompatibility(blockFlags)).toBe(true);
135
+ expect(capabilities.getIncompatibleFlags(blockFlags)).toBeUndefined();
122
136
  });
123
137
 
124
- it('should be incompatible if a requirement is not defined in capabilities', () => {
138
+ it("should be incompatible if a requirement is not defined in capabilities", () => {
125
139
  const capabilities = new RuntimeCapabilities(); // No requirements added.
126
140
  const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: 1 };
127
141
  expect(capabilities.checkCompatibility(blockFlags)).toBe(false);
128
142
  const incompatible = capabilities.getIncompatibleFlags(blockFlags);
129
- expect(incompatible).toEqual(new Map([['requiresModelAPIVersion', 1]]));
143
+ expect(incompatible).toEqual(new Map([["requiresModelAPIVersion", 1]]));
130
144
  });
131
145
  });
132
146
 
133
- describe('throwIfIncompatible', () => {
134
- it('should not throw if flags are compatible', () => {
135
- const capabilities = new RuntimeCapabilities().addSupportedRequirement('requiresModelAPIVersion');
147
+ describe("throwIfIncompatible", () => {
148
+ it("should not throw if flags are compatible", () => {
149
+ const capabilities = new RuntimeCapabilities().addSupportedRequirement(
150
+ "requiresModelAPIVersion",
151
+ );
136
152
  const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: true };
137
153
  expect(() => capabilities.throwIfIncompatible(blockFlags)).not.toThrow();
138
154
  });
139
155
 
140
- it('should throw IncompatibleFlagsError if flags are incompatible', () => {
141
- const capabilities = new RuntimeCapabilities().addSupportedRequirement('requiresModelAPIVersion');
156
+ it("should throw IncompatibleFlagsError if flags are incompatible", () => {
157
+ const capabilities = new RuntimeCapabilities().addSupportedRequirement(
158
+ "requiresModelAPIVersion",
159
+ );
142
160
  const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: false };
143
161
  expect(() => capabilities.throwIfIncompatible(blockFlags)).toThrow(IncompatibleFlagsError);
144
162
  });
145
163
 
146
- it('should throw with an error containing incompatible flags', () => {
147
- const capabilities = new RuntimeCapabilities().addSupportedRequirement('requiresModelAPIVersion', 1);
164
+ it("should throw with an error containing incompatible flags", () => {
165
+ const capabilities = new RuntimeCapabilities().addSupportedRequirement(
166
+ "requiresModelAPIVersion",
167
+ 1,
168
+ );
148
169
  const blockFlags: BlockCodeFeatureFlags = { requiresModelAPIVersion: 2 };
149
170
  try {
150
171
  capabilities.throwIfIncompatible(blockFlags);
@@ -153,8 +174,8 @@ describe('RuntimeCapabilities', () => {
153
174
  } catch (e) {
154
175
  expect(e).toBeInstanceOf(IncompatibleFlagsError);
155
176
  if (e instanceof IncompatibleFlagsError) {
156
- expect(e.incompatibleFlags).toEqual(new Map([['requiresModelAPIVersion', 2]]));
157
- expect(e.message).toContain('requiresModelAPIVersion: 2');
177
+ expect(e.incompatibleFlags).toEqual(new Map([["requiresModelAPIVersion", 2]]));
178
+ expect(e.message).toContain("requiresModelAPIVersion: 2");
158
179
  }
159
180
  }
160
181
  });
@@ -1,60 +1,82 @@
1
- import type { BlockCodeFeatureFlags, BlockCodeKnownFeatureFlags } from './block_flags';
2
- import type { FilterKeysByPrefix } from './type_utils';
1
+ import type { BlockCodeFeatureFlags, BlockCodeKnownFeatureFlags } from "./block_flags";
2
+ import type { FilterKeysByPrefix } from "./type_utils";
3
3
 
4
- export function checkBlockFlag(flags: BlockCodeFeatureFlags | undefined, flag: keyof BlockCodeKnownFeatureFlags, flagValue: boolean | number = true): boolean {
4
+ export function checkBlockFlag(
5
+ flags: BlockCodeFeatureFlags | undefined,
6
+ flag: keyof BlockCodeKnownFeatureFlags,
7
+ flagValue: boolean | number = true,
8
+ ): boolean {
5
9
  if (flags === undefined) return false;
6
10
  return flags[flag] === flagValue;
7
11
  }
8
12
 
9
13
  /**
10
- * Extracts all requirements from the feature flags.
11
- * @param flags - The feature flags.
12
- * @returns A set of requirements.
13
- */
14
- export function extractAllRequirements(flags: BlockCodeFeatureFlags | undefined): Set<`requires${string}`> {
14
+ * Extracts all requirements from the feature flags.
15
+ * @param flags - The feature flags.
16
+ * @returns A set of requirements.
17
+ */
18
+ export function extractAllRequirements(
19
+ flags: BlockCodeFeatureFlags | undefined,
20
+ ): Set<`requires${string}`> {
15
21
  if (flags === undefined) return new Set();
16
- return new Set(Object.entries(flags)
17
- .filter(([key, value]) => key.startsWith('requires') && value === true)
18
- .map(([key]) => key as `requires${string}`));
22
+ return new Set(
23
+ Object.entries(flags)
24
+ .filter(([key, value]) => key.startsWith("requires") && value === true)
25
+ .map(([key]) => key as `requires${string}`),
26
+ );
19
27
  }
20
28
 
21
29
  /**
22
- * Extracts all supports from the feature flags.
23
- * @param flags - The feature flags.
24
- * @returns A set of supports.
25
- */
26
- export function extractAllSupports(flags: BlockCodeFeatureFlags | undefined): Set<`supports${string}`> {
30
+ * Extracts all supports from the feature flags.
31
+ * @param flags - The feature flags.
32
+ * @returns A set of supports.
33
+ */
34
+ export function extractAllSupports(
35
+ flags: BlockCodeFeatureFlags | undefined,
36
+ ): Set<`supports${string}`> {
27
37
  if (flags === undefined) return new Set();
28
- return new Set(Object.entries(flags)
29
- .filter(([key, value]) => key.startsWith('supports') && value === true)
30
- .map(([key]) => key as `supports${string}`));
38
+ return new Set(
39
+ Object.entries(flags)
40
+ .filter(([key, value]) => key.startsWith("supports") && value === true)
41
+ .map(([key]) => key as `supports${string}`),
42
+ );
31
43
  }
32
44
 
33
45
  export class IncompatibleFlagsError extends Error {
34
- name = 'IncompatibleFlagsError';
46
+ name = "IncompatibleFlagsError";
35
47
  constructor(public readonly incompatibleFlags: Map<`requires${string}`, number | boolean>) {
36
- super(`Some of the block requirements are not supported by the runtime: ${Array.from(incompatibleFlags.entries()).map(([key, value]) => `${key}: ${value}`).join(', ')}`);
48
+ super(
49
+ `Some of the block requirements are not supported by the runtime: ${Array.from(
50
+ incompatibleFlags.entries(),
51
+ )
52
+ .map(([key, value]) => `${key}: ${value}`)
53
+ .join(", ")}`,
54
+ );
37
55
  }
38
56
  }
39
57
 
40
58
  /**
41
- * A type that represents a supported requirement.
42
- * @remarks
43
- * This type is used to represent a supported requirement.
44
- * It is a subtype of `BlockCodeKnownFeatureFlags` and is used to represent a supported requirement.
45
- * It is used to represent a supported requirement.
46
- */
47
- export type SupportedRequirement = FilterKeysByPrefix<BlockCodeKnownFeatureFlags, 'requires'>;
59
+ * A type that represents a supported requirement.
60
+ * @remarks
61
+ * This type is used to represent a supported requirement.
62
+ * It is a subtype of `BlockCodeKnownFeatureFlags` and is used to represent a supported requirement.
63
+ * It is used to represent a supported requirement.
64
+ */
65
+ export type SupportedRequirement = FilterKeysByPrefix<BlockCodeKnownFeatureFlags, "requires">;
48
66
 
49
67
  export class RuntimeCapabilities {
50
- private readonly supportedRequirements: Map<`requires${string}`, Set<number | boolean>> = new Map();
68
+ private readonly supportedRequirements: Map<`requires${string}`, Set<number | boolean>> =
69
+ new Map();
51
70
 
52
71
  /**
53
- * Adds a supported requirement to the runtime capabilities.
54
- * @param requirement - The requirement.
55
- * @param value - The value of the requirement. If not provided, defaults to true.
56
- */
57
- public addSupportedRequirement(requirement: SupportedRequirement, value: number | boolean = true): this {
72
+ * Adds a supported requirement to the runtime capabilities.
73
+ * @param requirement - The requirement.
74
+ * @param value - The value of the requirement. If not provided, defaults to true.
75
+ */
76
+ public addSupportedRequirement(
77
+ requirement: SupportedRequirement,
78
+ value: number | boolean = true,
79
+ ): this {
58
80
  if (!this.supportedRequirements.has(requirement)) {
59
81
  this.supportedRequirements.set(requirement, new Set());
60
82
  }
@@ -63,15 +85,17 @@ export class RuntimeCapabilities {
63
85
  }
64
86
 
65
87
  /**
66
- * Returns a map of incompatible flags. If the block flags are compatible, returns undefined.
67
- * @param blockFlags - The block flags.
68
- * @returns A map of incompatible flags, or undefined if the block flags are compatible.
69
- */
70
- public getIncompatibleFlags(blockFlags: BlockCodeFeatureFlags | undefined): Map<`requires${string}`, number | boolean> | undefined {
88
+ * Returns a map of incompatible flags. If the block flags are compatible, returns undefined.
89
+ * @param blockFlags - The block flags.
90
+ * @returns A map of incompatible flags, or undefined if the block flags are compatible.
91
+ */
92
+ public getIncompatibleFlags(
93
+ blockFlags: BlockCodeFeatureFlags | undefined,
94
+ ): Map<`requires${string}`, number | boolean> | undefined {
71
95
  if (blockFlags === undefined) return undefined;
72
96
  const incompatibleFlags = new Map<`requires${string}`, number | boolean>();
73
97
  for (const [key, value] of Object.entries(blockFlags)) {
74
- if (key.startsWith('requires')) {
98
+ if (key.startsWith("requires")) {
75
99
  if (value === undefined) continue;
76
100
  const supportedValues = this.supportedRequirements.get(key as `requires${string}`);
77
101
  if (supportedValues === undefined || !supportedValues.has(value as number | boolean)) {
@@ -83,22 +107,21 @@ export class RuntimeCapabilities {
83
107
  }
84
108
 
85
109
  /**
86
- * Checks if the block flags are compatible with the runtime capabilities.
87
- * @param blockFlags - The block flags.
88
- * @returns True if the block flags are compatible, false otherwise.
89
- */
110
+ * Checks if the block flags are compatible with the runtime capabilities.
111
+ * @param blockFlags - The block flags.
112
+ * @returns True if the block flags are compatible, false otherwise.
113
+ */
90
114
  public checkCompatibility(blockFlags: BlockCodeFeatureFlags | undefined): boolean {
91
115
  return this.getIncompatibleFlags(blockFlags) === undefined;
92
116
  }
93
117
 
94
118
  /**
95
- * Throws an error if the block flags are incompatible with the runtime capabilities.
96
- * @param blockFlags - The block flags.
97
- * @throws IncompatibleFlagsError if the block flags are incompatible with the runtime capabilities.
98
- */
119
+ * Throws an error if the block flags are incompatible with the runtime capabilities.
120
+ * @param blockFlags - The block flags.
121
+ * @throws IncompatibleFlagsError if the block flags are incompatible with the runtime capabilities.
122
+ */
99
123
  public throwIfIncompatible(blockFlags: BlockCodeFeatureFlags | undefined) {
100
124
  const incompatibleFlags = this.getIncompatibleFlags(blockFlags);
101
- if (incompatibleFlags !== undefined)
102
- throw new IncompatibleFlagsError(incompatibleFlags);
125
+ if (incompatibleFlags !== undefined) throw new IncompatibleFlagsError(incompatibleFlags);
103
126
  }
104
127
  }
@@ -1,3 +1,3 @@
1
- export * from './block_flags';
2
- export * from './flag_utils';
3
- export * from './type_utils';
1
+ export * from "./block_flags";
2
+ export * from "./flag_utils";
3
+ export * from "./type_utils";
@@ -10,17 +10,17 @@ export type FilterKeysByPrefix<T, P extends string> = keyof {
10
10
  * Helper to assert that two types are equal. This will cause a compile-time error if they are not.
11
11
  * We use this to ensure all feature flags are accounted for in the arrays below.
12
12
  */
13
- export type AssertKeysEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2
14
- ? unknown
15
- : { error: 'Feature flag definitions are out of sync'; expected: T; actual: U };
13
+ export type AssertKeysEqual<T, U> =
14
+ (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2
15
+ ? unknown
16
+ : { error: "Feature flag definitions are out of sync"; expected: T; actual: U };
16
17
 
17
18
  /**
18
19
  * Checks if two types are exactly equal.
19
20
  * Returns 'true' if they are, 'false' otherwise.
20
21
  */
21
- export type Is<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2
22
- ? true
23
- : false;
22
+ export type Is<T, U> =
23
+ (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? true : false;
24
24
 
25
25
  /**
26
26
  * Checks if T is a subtype of U.
@@ -37,7 +37,10 @@ export type Assert<T extends true> = T;
37
37
  /**
38
38
  * Helper to create a union type of two array value types.
39
39
  */
40
- export type ArrayTypeUnion<T extends readonly any[], U extends readonly any[]> = T[number] extends never
40
+ export type ArrayTypeUnion<
41
+ T extends readonly any[],
42
+ U extends readonly any[],
43
+ > = T[number] extends never
41
44
  ? U[number]
42
45
  : U[number] extends never
43
46
  ? T[number]
package/src/httpAuth.ts CHANGED
@@ -2,14 +2,13 @@
2
2
 
3
3
  export function parseHttpAuth(input: string): HttpAuth {
4
4
  const match = /(?<scheme>.*?) (?<parameters>.*)/.exec(input);
5
- if (match?.groups?.scheme === 'Basic') {
6
- const credentialsMatch = /(?<username>.*?):(?<password>.*)/
7
- .exec(atob(match.groups.parameters));
5
+ if (match?.groups?.scheme === "Basic") {
6
+ const credentialsMatch = /(?<username>.*?):(?<password>.*)/.exec(atob(match.groups.parameters));
8
7
  if (!credentialsMatch?.groups) {
9
8
  throw new Error(`Malformed credentials.`);
10
9
  }
11
10
  return {
12
- scheme: 'Basic',
11
+ scheme: "Basic",
13
12
  username: credentialsMatch.groups.username,
14
13
  password: credentialsMatch.groups.password,
15
14
  };
@@ -18,7 +17,7 @@ export function parseHttpAuth(input: string): HttpAuth {
18
17
  }
19
18
 
20
19
  export function serializeHttpAuth(input: HttpAuth): string {
21
- if (input.scheme === 'Basic') {
20
+ if (input.scheme === "Basic") {
22
21
  return `Basic ${btoa(`${input.username}:${input.password}`)}`;
23
22
  }
24
23
  throw new Error(`Unsupported auth scheme: ${input.scheme as string}.`);
@@ -27,7 +26,7 @@ export function serializeHttpAuth(input: HttpAuth): string {
27
26
  export type HttpAuth = BasicHttpAuth;
28
27
 
29
28
  export interface BasicHttpAuth {
30
- scheme: 'Basic';
29
+ scheme: "Basic";
31
30
  username: string;
32
31
  password: string;
33
32
  }
package/src/index.ts CHANGED
@@ -1,19 +1,19 @@
1
- export * from './author_marker';
2
- export * from './block_state';
3
- export * from './bmodel';
4
- export * from './branding';
5
- export * from './common_types';
6
- export * from './driver_kit';
7
- export * from './drivers';
8
- export * from './errors';
9
- export * from './flags';
10
- export * from './json';
11
- export * from './navigation';
12
- export * from './plid';
13
- export * from './pool';
14
- export * from './ref';
15
- export * from './utag';
16
- export * from './value_or_error';
17
- export * from './base64';
18
- export * from './util';
19
- export * from './httpAuth';
1
+ export * from "./author_marker";
2
+ export * from "./block_state";
3
+ export * from "./bmodel";
4
+ export * from "./branding";
5
+ export * from "./common_types";
6
+ export * from "./driver_kit";
7
+ export * from "./drivers";
8
+ export * from "./errors";
9
+ export * from "./flags";
10
+ export * from "./json";
11
+ export * from "./navigation";
12
+ export * from "./plid";
13
+ export * from "./pool";
14
+ export * from "./ref";
15
+ export * from "./utag";
16
+ export * from "./value_or_error";
17
+ export * from "./base64";
18
+ export * from "./util";
19
+ export * from "./httpAuth";
package/src/json.ts CHANGED
@@ -1,4 +1,4 @@
1
- import canonicalize from 'canonicalize';
1
+ import canonicalize from "canonicalize";
2
2
 
3
3
  type JsonPrimitive = string | number | boolean | null;
4
4
 
@@ -13,18 +13,26 @@ export type JsonSerializable =
13
13
  // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
14
14
  type NotAssignableToJson = bigint | symbol | Function;
15
15
 
16
- export type JsonCompatible<T> = unknown extends T ? unknown
17
- : [T] extends [JsonValue] ? T
18
- : [T] extends [NotAssignableToJson] ? never
19
- : {
20
- [P in keyof T]: [Exclude<T[P], undefined>] extends [JsonValue] ? T[P]
21
- : [Exclude<T[P], undefined>] extends [NotAssignableToJson] ? never
22
- : JsonCompatible<T[P]>;
23
- };
24
-
25
- export type StringifiedJson<T = unknown> = JsonCompatible<T> extends never ? never : string & {
26
- __json_stringified: T;
27
- };
16
+ export type JsonCompatible<T> = unknown extends T
17
+ ? unknown
18
+ : [T] extends [JsonValue]
19
+ ? T
20
+ : [T] extends [NotAssignableToJson]
21
+ ? never
22
+ : {
23
+ [P in keyof T]: [Exclude<T[P], undefined>] extends [JsonValue]
24
+ ? T[P]
25
+ : [Exclude<T[P], undefined>] extends [NotAssignableToJson]
26
+ ? never
27
+ : JsonCompatible<T[P]>;
28
+ };
29
+
30
+ export type StringifiedJson<T = unknown> =
31
+ JsonCompatible<T> extends never
32
+ ? never
33
+ : string & {
34
+ __json_stringified: T;
35
+ };
28
36
 
29
37
  export function stringifyJson<T>(value: JsonCompatible<T>): StringifiedJson<T>;
30
38
  export function stringifyJson<T extends JsonSerializable>(value: T): string;
@@ -32,9 +40,12 @@ export function stringifyJson(value: unknown): string {
32
40
  return JSON.stringify(value);
33
41
  }
34
42
 
35
- export type CanonicalizedJson<T = unknown> = JsonCompatible<T> extends never ? never : string & {
36
- __json_canonicalized: T;
37
- };
43
+ export type CanonicalizedJson<T = unknown> =
44
+ JsonCompatible<T> extends never
45
+ ? never
46
+ : string & {
47
+ __json_canonicalized: T;
48
+ };
38
49
 
39
50
  export function canonicalizeJson<T>(value: JsonCompatible<T>): CanonicalizedJson<T>;
40
51
  export function canonicalizeJson<T extends JsonSerializable>(value: T): string;
@@ -47,5 +58,5 @@ export function parseJson<T>(value: StringifiedJson<T> | CanonicalizedJson<T>):
47
58
  }
48
59
 
49
60
  export function bigintReplacer(_key: string, value: unknown): unknown {
50
- return typeof value === 'bigint' ? value.toString() : value;
61
+ return typeof value === "bigint" ? value.toString() : value;
51
62
  }
package/src/navigation.ts CHANGED
@@ -6,7 +6,7 @@ export type BlockSection = BlockSectionLink | BlockSectionDelimiter;
6
6
  export type BlockSectionLink = {
7
7
  /** Potentially there may be multiple section types, i.e. for "+" rows and for
8
8
  * sections directly opening html from the outputs. */
9
- readonly type: 'link';
9
+ readonly type: "link";
10
10
 
11
11
  /** Internal block section identifier */
12
12
  readonly href: `/${string}`;
@@ -24,11 +24,11 @@ export type BlockSectionLink = {
24
24
  /** Different variants for link section appearance */
25
25
  export type BlockSectionLinkAppearance =
26
26
  /** Shows a section of type `link` with a `+` icon and a certain specific style */
27
- 'add-section';
27
+ "add-section";
28
28
 
29
29
  /** Create a horizontal line between sections */
30
30
  export type BlockSectionDelimiter = {
31
- readonly type: 'delimiter';
31
+ readonly type: "delimiter";
32
32
  };
33
33
 
34
34
  /**
@@ -39,4 +39,4 @@ export type NavigationState<Href extends `/${string}` = `/${string}`> = {
39
39
  readonly href: Href;
40
40
  };
41
41
 
42
- export const DefaultNavigationState: NavigationState = { href: '/' };
42
+ export const DefaultNavigationState: NavigationState = { href: "/" };