@bbn/bbn 2.0.56 → 2.0.58

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.
@@ -14,22 +14,26 @@ const lc = function (str, localeCode) {
14
14
  }
15
15
  };
16
16
  export default function parse(input, format, cls = 'auto', locale) {
17
- var _a, _b, _c, _d, _e, _f;
17
+ var _a, _b, _c, _d, _e, _f, _g;
18
18
  bbn.fn.log([input, format, cls]);
19
+ debugger;
19
20
  buildLocaleFromIntl();
20
21
  const TemporalAny = globalThis.Temporal;
21
22
  if (!TemporalAny) {
22
23
  throw new Error('Temporal API is required (load @js-temporal/polyfill)');
23
24
  }
24
25
  const T = TemporalAny;
26
+ if (!locale) {
27
+ locale = ((_a = bbn === null || bbn === void 0 ? void 0 : bbn.dt) === null || _a === void 0 ? void 0 : _a.locales) || {};
28
+ }
25
29
  const loc = {
26
- monthsLong: (_a = locale === null || locale === void 0 ? void 0 : locale.monthsLong) !== null && _a !== void 0 ? _a : bbn.dt.locales.monthsLong,
27
- monthsShort: (_b = locale === null || locale === void 0 ? void 0 : locale.monthsShort) !== null && _b !== void 0 ? _b : bbn.dt.locales.monthsShort,
28
- weekdaysLong: (_c = locale === null || locale === void 0 ? void 0 : locale.weekdaysLong) !== null && _c !== void 0 ? _c : bbn.dt.locales.weekdaysLong,
29
- weekdaysShort: (_d = locale === null || locale === void 0 ? void 0 : locale.weekdaysShort) !== null && _d !== void 0 ? _d : bbn.dt.locales.weekdaysShort
30
+ monthsLong: (_b = locale === null || locale === void 0 ? void 0 : locale.monthsLong) !== null && _b !== void 0 ? _b : bbn.dt.locales.monthsLong,
31
+ monthsShort: (_c = locale === null || locale === void 0 ? void 0 : locale.monthsShort) !== null && _c !== void 0 ? _c : bbn.dt.locales.monthsShort,
32
+ weekdaysLong: (_d = locale === null || locale === void 0 ? void 0 : locale.weekdaysLong) !== null && _d !== void 0 ? _d : bbn.dt.locales.weekdaysLong,
33
+ weekdaysShort: (_e = locale === null || locale === void 0 ? void 0 : locale.weekdaysShort) !== null && _e !== void 0 ? _e : bbn.dt.locales.weekdaysShort
30
34
  };
31
- const localeCode = ((bbn === null || bbn === void 0 ? void 0 : bbn.env) && ((_e = bbn.env) === null || _e === void 0 ? void 0 : _e.lang)) ||
32
- ((bbn === null || bbn === void 0 ? void 0 : bbn.dt) && ((_f = bbn.dt) === null || _f === void 0 ? void 0 : _f.locale)) ||
35
+ const localeCode = ((bbn === null || bbn === void 0 ? void 0 : bbn.env) && ((_f = bbn.env) === null || _f === void 0 ? void 0 : _f.lang)) ||
36
+ ((bbn === null || bbn === void 0 ? void 0 : bbn.dt) && ((_g = bbn.dt) === null || _g === void 0 ? void 0 : _g.locale)) ||
33
37
  Intl.DateTimeFormat().resolvedOptions().locale;
34
38
  const escapeRegex = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
35
39
  const makeTokenSpecs = () => [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.56",
3
+ "version": "2.0.58",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",