@softwear/latestcollectioncore 1.0.85 → 1.0.87

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.
@@ -52,11 +52,11 @@ function propFunction(propertyName, getPropertyName, obj) {
52
52
  var _a, _b;
53
53
  const positionOfDot = propertyName.indexOf('.');
54
54
  if (positionOfDot < 0)
55
- return getPropertyName(propertyName);
55
+ return obj[propertyName];
56
56
  const table = propertyName.substring(0, positionOfDot);
57
57
  const field = propertyName.substring(positionOfDot + 1);
58
58
  if (table == 'transaction')
59
- return getPropertyName(field);
59
+ return obj[field];
60
60
  return ((_b = (_a = globalRelations[table]) === null || _a === void 0 ? void 0 : _a[obj[globalJoinableTables[table]]]) === null || _b === void 0 ? void 0 : _b[field]) || '~ ?';
61
61
  }
62
62
  const lower = (s) => s.toLowerCase();
@@ -135,7 +135,7 @@ function aggregator({ beginTimestamp, endTimestamp, filterExpression, aggregatio
135
135
  const filterGranularity = Object.entries(globalJoinableTables)
136
136
  .filter((join) => filterExpression.includes(join[0] + '.'))
137
137
  .map((join) => join[1]);
138
- filterDependencyEvaluator = (0, filtrex_1.compileExpression)(filterGranularity.join('+'));
138
+ filterDependencyEvaluator = (0, filtrex_1.compileExpression)(filterGranularity.join('+'), filtrexOptions);
139
139
  }
140
140
  const aggregationEvaluator = buildAggregationEvaluator(aggregationExpression);
141
141
  // Maintain a cache of evaluated aggregationExpressions
@@ -147,7 +147,7 @@ function aggregator({ beginTimestamp, endTimestamp, filterExpression, aggregatio
147
147
  let aggregationDependencyExpression = aggregationGranularity.join('+');
148
148
  if (!aggregationDependencyExpression)
149
149
  aggregationDependencyExpression = '"N.A."';
150
- const aggregationDependencyEvaluator = (0, filtrex_1.compileExpression)(aggregationDependencyExpression);
150
+ const aggregationDependencyEvaluator = (0, filtrex_1.compileExpression)(aggregationDependencyExpression, filtrexOptions);
151
151
  return function (transaction) {
152
152
  if (filter) {
153
153
  const filterDependency = filterDependencyEvaluator(transaction);
package/dist/ean13.d.ts CHANGED
@@ -1 +1 @@
1
- export default function (baseNumberAsString: string): number;
1
+ export default function (baseNumberAsString: string): string;
package/dist/ean13.js CHANGED
@@ -14,6 +14,6 @@ function default_1(baseNumberAsString) {
14
14
  return remainder === 0 ? 0 : 10 - remainder;
15
15
  };
16
16
  const checkDigit = calculateCheckDigit(baseNumberAsString);
17
- return Number(baseNumberAsString) * 10 + checkDigit;
17
+ return baseNumberAsString + checkDigit;
18
18
  }
19
19
  exports.default = default_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.85",
3
+ "version": "1.0.87",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -79,10 +79,10 @@ let globalNrAggegationExpressions = 0 // tracks the # aggregations rows so we ca
79
79
  */
80
80
  function propFunction(propertyName: string, getPropertyName: Function, obj: Record<string, any>): any {
81
81
  const positionOfDot = propertyName.indexOf('.')
82
- if (positionOfDot < 0) return getPropertyName(propertyName)
82
+ if (positionOfDot < 0) return obj[propertyName]
83
83
  const table = propertyName.substring(0, positionOfDot)
84
84
  const field = propertyName.substring(positionOfDot + 1)
85
- if (table == 'transaction') return getPropertyName(field)
85
+ if (table == 'transaction') return obj[field]
86
86
  return globalRelations[table]?.[obj[globalJoinableTables[table]]]?.[field] || '~ ?'
87
87
  }
88
88
 
@@ -177,7 +177,7 @@ function aggregator({
177
177
  const filterGranularity = Object.entries(globalJoinableTables)
178
178
  .filter((join) => filterExpression.includes(join[0] + '.'))
179
179
  .map((join) => join[1])
180
- filterDependencyEvaluator = compileExpression(filterGranularity.join('+'))
180
+ filterDependencyEvaluator = compileExpression(filterGranularity.join('+'), filtrexOptions)
181
181
  }
182
182
  const aggregationEvaluator = buildAggregationEvaluator(aggregationExpression)
183
183
  // Maintain a cache of evaluated aggregationExpressions
@@ -189,7 +189,7 @@ function aggregator({
189
189
 
190
190
  let aggregationDependencyExpression = aggregationGranularity.join('+')
191
191
  if (!aggregationDependencyExpression) aggregationDependencyExpression = '"N.A."'
192
- const aggregationDependencyEvaluator = compileExpression(aggregationDependencyExpression)
192
+ const aggregationDependencyEvaluator = compileExpression(aggregationDependencyExpression, filtrexOptions)
193
193
  return function (transaction: TransactionI): void {
194
194
  if (filter) {
195
195
  const filterDependency = filterDependencyEvaluator(transaction)
package/src/ean13.ts CHANGED
@@ -1,4 +1,4 @@
1
- export default function (baseNumberAsString: string): number {
1
+ export default function (baseNumberAsString: string): string {
2
2
  const calculateCheckDigit = function (baseNumberAsString: string): number {
3
3
  if (!Number(baseNumberAsString) || baseNumberAsString.length !== 12) {
4
4
  throw Error(`Not an EAN 13 base number. Must have a number with 12 digits, got ${baseNumberAsString}`)
@@ -16,5 +16,5 @@ export default function (baseNumberAsString: string): number {
16
16
  return remainder === 0 ? 0 : 10 - remainder
17
17
  }
18
18
  const checkDigit = calculateCheckDigit(baseNumberAsString)
19
- return Number(baseNumberAsString) * 10 + checkDigit
19
+ return baseNumberAsString + checkDigit
20
20
  }
@@ -10,8 +10,9 @@ describe('ean13 function', function () {
10
10
  })
11
11
  })
12
12
  it('should calculate a valid check digit', function () {
13
- expect(ean13('123456789012')).to.equal(1234567890128)
14
- expect(ean13('201480005032')).to.equal(2014800050323)
15
- expect(ean13('201480000006')).to.equal(2014800000069)
13
+ expect(ean13('123456789012')).to.equal('1234567890128')
14
+ expect(ean13('201480005032')).to.equal('2014800050323')
15
+ expect(ean13('201480000006')).to.equal('2014800000069')
16
+ expect(ean13('088779175220')).to.equal('0887791752208')
16
17
  })
17
18
  })