@bbn/bbn 2.0.81 → 2.0.82

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.
package/dist/dt.js CHANGED
@@ -9,7 +9,6 @@ import bbnDtDuration from './dt/classes/duration.js';
9
9
  import _ from './_.js';
10
10
  import parse from './dt/functions/parse.js';
11
11
  import guessFormat from './dt/functions/guessFormat.js';
12
- import getRow from './fn/object/getRow.js';
13
12
  const patterns = [
14
13
  // MariaDB DATETIME "YYYY-MM-DD HH:MM:SS"
15
14
  {
@@ -261,8 +260,10 @@ dt.time = () => { };
261
260
  dt.date = () => { };
262
261
  dt.dateTime = () => { };
263
262
  dt.duration = (amount, unit) => {
264
- const realUnit = unitsCorrespondence[unit] ? getRow(units, d => d[0] === unitsCorrespondence[unit])[1] || undefined : undefined;
265
- return new bbnDtDuration(Temporal.Duration.from({ [realUnit + 's']: amount }));
263
+ if (amount instanceof Temporal.Duration) {
264
+ return new bbnDtDuration(amount);
265
+ }
266
+ return bbnDtDuration.fromUnit(amount, unit);
266
267
  };
267
268
  dt.zoned = () => { };
268
269
  dt.monthDay = () => { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.81",
3
+ "version": "2.0.82",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",