flatpack-json 9.5.0 → 9.6.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.
@@ -1,5 +1,6 @@
1
- import { RefElements } from './RefElements.mjs';
2
- import { Flatpacked, type FlattenedElement } from './types.mjs';
1
+ import type { RefElements } from './RefElements.mjs';
2
+ import type { Flatpacked } from './types.mjs';
3
+ import { type FlattenedElement } from './types.mjs';
3
4
  export declare function fromElement(elem: FlattenedElement, resolve: (index: number) => RefElements): RefElements;
4
5
  export declare function fromFlatpacked(flat: Flatpacked): RefElements[];
5
6
  export declare class FlatpackedWrapper {
@@ -1,6 +1,6 @@
1
1
  import assert from 'node:assert';
2
2
  import { ArrayRefElement, BigIntRefElement, DateRefElement, MapRefElement, NumberRefElement, ObjectRefElement, ObjectWrapperRefElement, PrimitiveRefElement, RegExpRefElement, SetRefElement, StringConcatRefElement, StringPrimitiveRefElement, SubStringRefElement, } from './RefElements.mjs';
3
- import { ElementType, supportedHeaders, } from './types.mjs';
3
+ import { ElementType, supportedHeaders } from './types.mjs';
4
4
  export function fromElement(elem, resolve) {
5
5
  function handleArrayElement(element) {
6
6
  switch (element[0]) {
@@ -1,3 +1,3 @@
1
- import { Flatpacked } from './types.mjs';
1
+ import type { Flatpacked } from './types.mjs';
2
2
  export declare function optimizeFlatpacked(data: Flatpacked): Flatpacked;
3
3
  //# sourceMappingURL=optimizeFlatpacked.d.mts.map
package/dist/storage.mjs CHANGED
@@ -329,7 +329,7 @@ export class CompactStorage {
329
329
  const element = [ElementType.Array, ...indexValues];
330
330
  const useIdx = this.dedupe ? this.stashArray(idx, element) : idx;
331
331
  if (useIdx !== idx) {
332
- assert(this.data.length == idx + 1, `Expected ${idx + 1} but got ${this.data.length}`);
332
+ assert(this.data.length === idx + 1, `Expected ${idx + 1} but got ${this.data.length}`);
333
333
  this.data.length = idx;
334
334
  return useIdx;
335
335
  }
@@ -3,7 +3,7 @@ export function stringifyFlatpacked(input) {
3
3
  let prev = '';
4
4
  for (let i = 1; i < input.length; i++) {
5
5
  const next = JSON.stringify(input[i]);
6
- result += prev == next ? ',' : ',\n';
6
+ result += prev === next ? ',' : ',\n';
7
7
  result += next;
8
8
  prev = next;
9
9
  }
package/dist/unpack.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Flatpacked, Unpacked } from './types.mjs';
1
+ import type { Flatpacked, Unpacked } from './types.mjs';
2
2
  export declare function fromJSON(data: Flatpacked): Unpacked;
3
3
  export declare function parse(data: string): Unpacked;
4
4
  //# sourceMappingURL=unpack.d.mts.map
package/dist/unpack.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import assert from 'node:assert';
2
- import { ElementType, supportedHeaders, } from './types.mjs';
2
+ import { ElementType, supportedHeaders } from './types.mjs';
3
3
  export function fromJSON(data) {
4
4
  const [header] = data;
5
5
  if (!supportedHeaders.has(header)) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "provenance": true
6
6
  },
7
- "version": "9.5.0",
7
+ "version": "9.6.1",
8
8
  "description": "A library to normalize / flatten JSON objects to reduce the size.",
9
9
  "keywords": [
10
10
  "cspell",
@@ -53,9 +53,9 @@
53
53
  "node": ">=20"
54
54
  },
55
55
  "devDependencies": {
56
- "@cspell/filetypes": "9.5.0",
57
- "diff": "^8.0.2",
56
+ "@cspell/filetypes": "9.6.1",
57
+ "diff": "^8.0.3",
58
58
  "flatted": "^3.3.3"
59
59
  },
60
- "gitHead": "4407eed11650481d9037e5a1d53488a93ff4b66d"
60
+ "gitHead": "666fb79096d25c53af9519cad07030e7aca597e1"
61
61
  }