data-structure-typed 2.2.5 → 2.2.7

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.
@@ -1019,13 +1019,11 @@ function buildIndex(sample: Product[]): TreeMultiMap<number, Product, Product> {
1019
1019
 
1020
1020
  // Helper: normalize getLeftMost/getRightMost return (key or node.key)
1021
1021
  function leftKey(tmm: TreeMultiMap<number, Product, Product>): number | undefined {
1022
- const v = tmm.getLeftMost();
1023
- return v == null ? undefined : typeof v === 'object' ? v.key : v;
1022
+ return tmm.getLeftMost();
1024
1023
  }
1025
1024
 
1026
1025
  function rightKey(tmm: TreeMultiMap<number, Product, Product>): number | undefined {
1027
- const v = tmm.getRightMost();
1028
- return v == null ? undefined : typeof v === 'object' ? v.key : v;
1026
+ return tmm.getRightMost();
1029
1027
  }
1030
1028
 
1031
1029
  describe('TreeMultiMap — rangeSearch-driven semantics', () => {
@@ -1083,13 +1081,17 @@ describe('TreeMultiMap — rangeSearch-driven semantics', () => {
1083
1081
  const lo = tmm.getLeftMost(); // expected 12.9
1084
1082
  const hi = tmm.getRightMost(); // expected 199
1085
1083
 
1086
- const groups = tmm.rangeSearch(new Range(lo, hi, true, true), node => ({
1087
- key: node.key,
1088
- count: node.value!.length
1089
- }));
1084
+ if (lo !== undefined && hi !== undefined) {
1085
+ const groups = tmm.rangeSearch(new Range(lo, hi, true, true), node => ({
1086
+ key: node.key,
1087
+ count: node.value!.length
1088
+ }));
1090
1089
 
1091
- // 12.9:1 | 35.5:2 | 79.9:2 | 99:1 | 120:1 | 199:1
1092
- expect(groups.map(g => `${g.key}:${g.count}`).join(' | ')).toBe('12.9:1 | 35.5:2 | 79.9:2 | 99:1 | 120:1 | 199:1');
1090
+ // 12.9:1 | 35.5:2 | 79.9:2 | 99:1 | 120:1 | 199:1
1091
+ expect(groups.map(g => `${g.key}:${g.count}`).join(' | ')).toBe(
1092
+ '12.9:1 | 35.5:2 | 79.9:2 | 99:1 | 120:1 | 199:1'
1093
+ );
1094
+ }
1093
1095
  });
1094
1096
 
1095
1097
  it('empty TreeMultiMap → rangeSearch returns empty results', () => {
package/tsup.config.js CHANGED
@@ -12,6 +12,9 @@ export default defineConfig([
12
12
  globalName: "dataStructureTyped",
13
13
  platform: "browser",
14
14
  outExtension: () => ({ js: '.min.js' }),
15
+ esbuildOptions(options) {
16
+ options.drop = ['debugger']
17
+ }
15
18
  },
16
19
  {
17
20
  entry: { "data-structure-typed": "src/index.ts" },
@@ -24,5 +27,8 @@ export default defineConfig([
24
27
  globalName: "dataStructureTyped",
25
28
  platform: "browser",
26
29
  outExtension: () => ({ js: '.js' }),
30
+ esbuildOptions(options) {
31
+ options.drop = ['debugger']
32
+ }
27
33
  }
28
34
  ]);
@@ -17,6 +17,9 @@ const commonConfig = {
17
17
  outExtension() {
18
18
  return { js: '.mjs' };
19
19
  },
20
+ esbuildOptions(options) {
21
+ options.drop = ['debugger']
22
+ },
20
23
 
21
24
  // The true ultimate solution: automatic cleaning up of comments after the build is complete
22
25
  onSuccess: async () => {
@@ -15,6 +15,9 @@ export default defineConfig([
15
15
  target: "es2022",
16
16
  outExtension() {
17
17
  return { js: ".mjs" };
18
+ },
19
+ esbuildOptions(options) {
20
+ options.drop = ['debugger']
18
21
  }
19
22
  },
20
23
 
@@ -32,6 +35,9 @@ export default defineConfig([
32
35
  target: "es2018",
33
36
  outExtension() {
34
37
  return { js: ".mjs" };
38
+ },
39
+ esbuildOptions(options) {
40
+ options.drop = ['debugger']
35
41
  }
36
42
  },
37
43
 
@@ -49,6 +55,9 @@ export default defineConfig([
49
55
  target: "es2022",
50
56
  outExtension() {
51
57
  return { js: ".cjs" };
58
+ },
59
+ esbuildOptions(options) {
60
+ options.drop = ['debugger']
52
61
  }
53
62
  },
54
63
 
@@ -66,6 +75,9 @@ export default defineConfig([
66
75
  target: "es2018",
67
76
  outExtension() {
68
77
  return { js: ".cjs" };
78
+ },
79
+ esbuildOptions(options) {
80
+ options.drop = ['debugger']
69
81
  }
70
82
  }
71
83
  ]);