@bbn/bbn 2.0.84 → 2.0.86

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.
@@ -2,7 +2,7 @@ import { Temporal } from 'temporal-polyfill';
2
2
  export default class bbnDtDuration {
3
3
  #private;
4
4
  static fromUnit(value: number, unit: string): bbnDtDuration;
5
- constructor(y: Temporal.Duration | number | object, m?: number, d?: number, h?: number, i?: number, s?: number, ms?: number, unit?: string);
5
+ constructor(y: Temporal.Duration | number | object, m?: number, w?: number, d?: number, h?: number, i?: number, s?: number, ms?: number, unit?: string);
6
6
  get value(): Temporal.Duration;
7
7
  years(remaining?: boolean): number;
8
8
  months(remaining?: boolean): number;
@@ -32,7 +32,7 @@ class bbnDtDuration {
32
32
  const dur = new Temporal.Duration(...ctx);
33
33
  return new bbnDtDuration(dur);
34
34
  }
35
- constructor(y, m, d, h, i, s, ms, unit) {
35
+ constructor(y, m, w, d, h, i, s, ms, unit) {
36
36
  _bbnDtDuration_instances.add(this);
37
37
  _bbnDtDuration_value.set(this, void 0);
38
38
  _bbnDtDuration_unit.set(this, void 0);
@@ -43,7 +43,7 @@ class bbnDtDuration {
43
43
  __classPrivateFieldSet(this, _bbnDtDuration_value, new Temporal.Duration(y.years || 0, y.months || 0, y.weeks || 0, y.days || 0, y.hours || 0, y.minutes || 0, y.seconds || 0, y.milliseconds || 0, 0, 0), "f");
44
44
  }
45
45
  else {
46
- __classPrivateFieldSet(this, _bbnDtDuration_value, new Temporal.Duration(y || 0, m || 0, d || 0, h || 0, i || 0, s || 0, ms || 0, 0, 0), "f");
46
+ __classPrivateFieldSet(this, _bbnDtDuration_value, new Temporal.Duration(y || 0, m || 0, w || 0, d || 0, h || 0, i || 0, s || 0, ms || 0, 0, 0), "f");
47
47
  }
48
48
  const realUnit = unitsCorrespondence[unit || ''] || unit;
49
49
  __classPrivateFieldSet(this, _bbnDtDuration_unit, realUnit || 'ms', "f");
@@ -140,7 +140,7 @@ class bbnDtDuration {
140
140
  const delta = { [field]: value };
141
141
  const newDuration = __classPrivateFieldGet(this, _bbnDtDuration_value, "f").add(delta);
142
142
  // Adapt this constructor call to however you now construct your duration:
143
- return new bbnDtDuration(newDuration, undefined, undefined, undefined, undefined, undefined, undefined, __classPrivateFieldGet(this, _bbnDtDuration_unit, "f"));
143
+ return new bbnDtDuration(newDuration, undefined, undefined, undefined, undefined, undefined, undefined, undefined, __classPrivateFieldGet(this, _bbnDtDuration_unit, "f"));
144
144
  }
145
145
  subtract(value, unit) {
146
146
  return this.add(-value, unit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.84",
3
+ "version": "2.0.86",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",