@balena/odata-parser 4.2.9 → 4.2.10

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,3 +1,14 @@
1
+ - commits:
2
+ - subject: Avoid unnecessary allocations for date binds
3
+ hash: f5d8d9b67611e732288eb4979d7707f2a007ff5f
4
+ body: ""
5
+ footer:
6
+ Change-type: patch
7
+ change-type: patch
8
+ author: Pagan Gazzard
9
+ version: 4.2.10
10
+ title: ""
11
+ date: 2025-10-16T14:34:04.729Z
1
12
  - commits:
2
13
  - subject: Replace `CollapseObjectArray` with `Object.fromEntries`
3
14
  hash: cff575f1888896b9278adda63988df3922aae6c7
@@ -8,7 +19,7 @@
8
19
  author: Pagan Gazzard
9
20
  version: 4.2.9
10
21
  title: ""
11
- date: 2025-10-16T13:59:19.198Z
22
+ date: 2025-10-16T14:25:34.129Z
12
23
  - commits:
13
24
  - subject: Update dependency lint-staged to v16
14
25
  hash: 1ad6c3e66d76d9fba07440f75e719f210505f9d9
package/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file
4
4
  automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
5
5
  This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ # v4.2.10
8
+ ## (2025-10-16)
9
+
10
+ * Avoid unnecessary allocations for date binds [Pagan Gazzard]
11
+
7
12
  # v4.2.9
8
13
  ## (2025-10-16)
9
14
 
package/odata-parser.js CHANGED
@@ -536,7 +536,7 @@ function peg$parse(input, options) {
536
536
  if (firstNonNullIndex != null) {
537
537
  binds.splice(firstNonNullIndex, totalBoundIndexes);
538
538
  }
539
- return Bind('List', bindValues);
539
+ return Bind(['List', bindValues]);
540
540
  }
541
541
  function peg$f37(methodName) { return [] }
542
542
  function peg$f38(methodName, args) { return args.length === methods[methodName] || (Array.isArray(methods[methodName]) && methods[methodName].includes(args.length)) }
@@ -607,20 +607,20 @@ function peg$parse(input, options) {
607
607
  function peg$f91() { return '\'' }
608
608
  function peg$f92(text) { return decodeURIComponent(text.join('')) }
609
609
  function peg$f93(param) { return { bind: '@' + param } }
610
- function peg$f94(n) { return Bind('Real', n) }
611
- function peg$f95(n) { return Bind('Integer', n) }
610
+ function peg$f94(n) { return Bind(['Real', n]) }
611
+ function peg$f95(n) { return Bind(['Integer', n]) }
612
612
  function peg$f96() { return 'Date Time' }
613
613
  function peg$f97() { return 'Date' }
614
614
  function peg$f98(type, date) { return Date.parse(date) }
615
615
  function peg$f99(type, date) { return isNaN(date) }
616
616
  function peg$f100(type, date) { return [type, date] }
617
- function peg$f101(d) { return Bind(d[0], d[1]) }
618
- function peg$f102(b) { return Bind('Boolean', b) }
617
+ function peg$f101(d) { return Bind(d) }
618
+ function peg$f102(b) { return Bind(['Boolean', b]) }
619
619
  function peg$f103(resource) {
620
- const bind = Bind('ContentReference', resource)
620
+ const bind = Bind(['ContentReference', resource])
621
621
  return { resource: bind, key: bind }
622
622
  }
623
- function peg$f104(t) { return Bind('Text', t) }
623
+ function peg$f104(t) { return Bind(['Text', t]) }
624
624
  let peg$currPos = options.peg$currPos | 0;
625
625
  let peg$savedPos = peg$currPos;
626
626
  const peg$posDetailsCache = [{ line: 1, column: 1 }];
@@ -5460,8 +5460,8 @@ function peg$parse(input, options) {
5460
5460
  precedence = 0;
5461
5461
  };
5462
5462
 
5463
- function Bind(type, value) {
5464
- binds.push([type, value])
5463
+ function Bind(bind) {
5464
+ binds.push(bind)
5465
5465
  return { bind: binds.length - 1 }
5466
5466
  }
5467
5467
 
@@ -74,8 +74,8 @@
74
74
  precedence = 0;
75
75
  };
76
76
 
77
- function Bind(type, value) {
78
- binds.push([type, value])
77
+ function Bind(bind) {
78
+ binds.push(bind)
79
79
  return { bind: binds.length - 1 }
80
80
  }
81
81
  }
@@ -351,7 +351,7 @@ GroupedPrimitive =
351
351
  if (firstNonNullIndex != null) {
352
352
  binds.splice(firstNonNullIndex, totalBoundIndexes);
353
353
  }
354
- return Bind('List', bindValues);
354
+ return Bind(['List', bindValues]);
355
355
  }
356
356
 
357
357
  FilterMethodCallExpression =
@@ -704,11 +704,11 @@ ParameterAlias =
704
704
 
705
705
  NumberBind =
706
706
  n:Number
707
- { return Bind('Real', n) }
707
+ { return Bind(['Real', n]) }
708
708
 
709
709
  UnsignedIntegerBind =
710
710
  n:UnsignedInteger
711
- { return Bind('Integer', n) }
711
+ { return Bind(['Integer', n]) }
712
712
 
713
713
  Date =
714
714
  type:(
@@ -726,23 +726,23 @@ Date =
726
726
 
727
727
  DateBind =
728
728
  d:Date
729
- { return Bind(d[0], d[1]) }
729
+ { return Bind(d) }
730
730
 
731
731
  BooleanBind =
732
732
  b:Boolean
733
- { return Bind('Boolean', b) }
733
+ { return Bind(['Boolean', b]) }
734
734
 
735
735
  ContentReference =
736
736
  '$'
737
737
  resource:ResourceName
738
738
  {
739
- const bind = Bind('ContentReference', resource)
739
+ const bind = Bind(['ContentReference', resource])
740
740
  return { resource: bind, key: bind }
741
741
  }
742
742
 
743
743
  QuotedTextBind =
744
744
  t:QuotedText
745
- { return Bind('Text', t) }
745
+ { return Bind(['Text', t]) }
746
746
 
747
747
  boundary =
748
748
  ( &'('
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/odata-parser",
3
- "version": "4.2.9",
3
+ "version": "4.2.10",
4
4
  "description": "An OData parser written in OMeta",
5
5
  "type": "commonjs",
6
6
  "main": "odata-parser.js",
@@ -40,6 +40,6 @@
40
40
  "npm": ">=8.1.0"
41
41
  },
42
42
  "versionist": {
43
- "publishedAt": "2025-10-16T13:59:19.285Z"
43
+ "publishedAt": "2025-10-16T14:34:04.859Z"
44
44
  }
45
45
  }