mol_time_all 1.1.814 → 1.1.816

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/node.audit.js CHANGED
@@ -1 +1 @@
1
- console.info("Audit passed")
1
+ console.info( '%c ▫ $mol_build ▫ Audit passed', 'color:forestgreen; font-weight:bolder' )
package/node.deps.json CHANGED
@@ -1 +1 @@
1
- {"files":["mam.ts","LICENSE","README.md","yarn.lock","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/index.html","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/time/readme.md","mol/time/base/base.ts","mol/time/duration/readme.md","mol/time/duration/duration.ts","mol/fail/fail.ts","mol/time/moment/moment.ts","mol/time/moment/readme.md","mol/time/interval/readme.md","mol/time/interval/interval.ts","mol/time/all/package.json","mol/time/all/all.meta.tree"],"mods":{},"deps_in":{"mol/time":{"mol/time/all":-9007199254740991,"mol/time/moment":-9007199254740991,"mol/time/duration":-9007199254740991,"mol/time/base":-9007199254740991,"mol/time/interval":-9007199254740991},"mol":{"mol/time":-9007199254740991,"mol/fail":-9007199254740991},"":{"mol":-9007199254740991},"mol/time/moment":{"mol/time/all":-9000,"mol/time/interval":-2},"mol/time/duration":{"mol/time/moment":-2,"mol/time/all":-9000,"mol/time/interval":-2},"mol/time/base":{"mol/time/duration":-1,"mol/time/moment":-1,"mol/time/interval":-1},"mol/fail":{"mol/time/moment":-2},"mol/time/interval":{"mol/time/all":-9000}},"deps_out":{"mol/time/all":{"mol/time":-9007199254740991,"mol/time/moment":-9000,"mol/time/duration":-9000,"mol/time/interval":-9000},"mol/time":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/time/moment":{"mol/time":-9007199254740991,"mol/time/duration":-2,"mol/fail":-2,"mol/time/base":-1},"mol/time/duration":{"mol/time":-9007199254740991,"mol/time/base":-1},"mol/time/base":{"mol/time":-9007199254740991},"mol/fail":{"mol":-9007199254740991},"mol/time/interval":{"mol/time":-9007199254740991,"mol/time/moment":-2,"mol/time/duration":-2,"mol/time/base":-1}},"sloc":{"ts":604,"LICENSE":113,"md":705,"lock":955,"js":9,"json":95,"tree":44,"CNAME":1,"html":1},"deps":{"mol/time/all":{"..":-9007199254740991,"/mol/time/moment":-9000,"/mol/time/duration":-9000,"/mol/time/interval":-9000},"mol/time":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/time/moment":{"..":-9007199254740991,"/mol/time/moment/weekdays":-1,"/mol/time/moment/config":-1,"/mol/time/duration/config":-2,"/mol/fail":-2,"/mol/time/moment":-1,"/mol/time/base":-1,"/mol/time/duration":-2,"/mol/time/moment/patterns":-4},"mol/time/duration":{"..":-9007199254740991,"/mol/time/duration/config":-1,"/mol/time/duration":-1,"/mol/time/base":-1},"mol/time/base":{"..":-9007199254740991,"/mol/time/base":-1},"mol/fail":{"..":-9007199254740991,"/mol/fail":-1},"mol/time/interval":{"..":-9007199254740991,"/mol/time/interval/config":-1,"/mol/time/moment/config":-2,"/mol/time/duration/config":-2,"/mol/time/interval":-1,"/mol/time/base":-1,"/mol/time/duration":-2,"/mol/time/moment":-2}}}
1
+ {"files":["mam.ts","LICENSE","README.md","yarn.lock","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/index.html","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/time/readme.md","mol/time/base/base.ts","mol/time/duration/readme.md","mol/time/duration/duration.ts","mol/fail/fail.ts","mol/time/moment/moment.ts","mol/time/moment/readme.md","mol/time/interval/readme.md","mol/time/interval/interval.ts","mol/time/all/package.json","mol/time/all/all.meta.tree"],"mods":{},"deps_in":{"mol/time":{"mol/time/all":-9007199254740991,"mol/time/moment":-9007199254740991,"mol/time/duration":-9007199254740991,"mol/time/base":-9007199254740991,"mol/time/interval":-9007199254740991},"mol":{"mol/time":-9007199254740991,"mol/fail":-9007199254740991},"":{"mol":-9007199254740991},"mol/time/moment":{"mol/time/all":-9000,"mol/time/interval":-2},"mol/time/duration":{"mol/time/moment":-2,"mol/time/all":-9000,"mol/time/interval":-2},"mol/time/base":{"mol/time/duration":-1,"mol/time/moment":-1,"mol/time/interval":-1},"mol/fail":{"mol/time/moment":-2},"mol/time/interval":{"mol/time/all":-9000}},"deps_out":{"mol/time/all":{"mol/time":-9007199254740991,"mol/time/moment":-9000,"mol/time/duration":-9000,"mol/time/interval":-9000},"mol/time":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/time/moment":{"mol/time":-9007199254740991,"mol/time/duration":-2,"mol/fail":-2,"mol/time/base":-1},"mol/time/duration":{"mol/time":-9007199254740991,"mol/time/base":-1},"mol/time/base":{"mol/time":-9007199254740991},"mol/fail":{"mol":-9007199254740991},"mol/time/interval":{"mol/time":-9007199254740991,"mol/time/moment":-2,"mol/time/duration":-2,"mol/time/base":-1}},"sloc":{"ts":604,"LICENSE":113,"md":705,"lock":944,"js":9,"json":95,"tree":44,"CNAME":1,"html":1},"deps":{"mol/time/all":{"..":-9007199254740991,"/mol/time/moment":-9000,"/mol/time/duration":-9000,"/mol/time/interval":-9000},"mol/time":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/time/moment":{"..":-9007199254740991,"/mol/time/moment/weekdays":-1,"/mol/time/moment/config":-1,"/mol/time/duration/config":-2,"/mol/fail":-2,"/mol/time/moment":-1,"/mol/time/base":-1,"/mol/time/duration":-2,"/mol/time/moment/patterns":-4},"mol/time/duration":{"..":-9007199254740991,"/mol/time/duration/config":-1,"/mol/time/duration":-1,"/mol/time/base":-1},"mol/time/base":{"..":-9007199254740991,"/mol/time/base":-1},"mol/fail":{"..":-9007199254740991,"/mol/fail":-1},"mol/time/interval":{"..":-9007199254740991,"/mol/time/interval/config":-1,"/mol/time/moment/config":-2,"/mol/time/duration/config":-2,"/mol/time/interval":-1,"/mol/time/base":-1,"/mol/time/duration":-2,"/mol/time/moment":-2}}}
package/node.test.js CHANGED
@@ -1810,17 +1810,6 @@ var $;
1810
1810
  ;
1811
1811
  "use strict";
1812
1812
  var $;
1813
- (function ($) {
1814
- function $mol_dom_serialize(node) {
1815
- const serializer = new $mol_dom_context.XMLSerializer;
1816
- return serializer.serializeToString(node);
1817
- }
1818
- $.$mol_dom_serialize = $mol_dom_serialize;
1819
- })($ || ($ = {}));
1820
- //mol/dom/serialize/serialize.ts
1821
- ;
1822
- "use strict";
1823
- var $;
1824
1813
  (function ($) {
1825
1814
  function $mol_assert_ok(value) {
1826
1815
  if (value)
@@ -1841,14 +1830,12 @@ var $;
1841
1830
  handler();
1842
1831
  }
1843
1832
  catch (error) {
1844
- if (!ErrorRight)
1845
- return error;
1846
1833
  $.$mol_fail = fail;
1847
1834
  if (typeof ErrorRight === 'string') {
1848
1835
  $mol_assert_equal(error.message, ErrorRight);
1849
1836
  }
1850
1837
  else {
1851
- $mol_assert_ok(error instanceof ErrorRight);
1838
+ $mol_assert_equal(error instanceof ErrorRight, true);
1852
1839
  }
1853
1840
  return error;
1854
1841
  }
@@ -1858,58 +1845,47 @@ var $;
1858
1845
  $mol_fail(new Error('Not failed'));
1859
1846
  }
1860
1847
  $.$mol_assert_fail = $mol_assert_fail;
1861
- function $mol_assert_equal(...args) {
1862
- for (let i = 0; i < args.length; ++i) {
1863
- for (let j = 0; j < args.length; ++j) {
1864
- if (i === j)
1865
- continue;
1866
- if (Number.isNaN(args[i]) && Number.isNaN(args[j]))
1867
- continue;
1868
- if (args[i] !== args[j])
1869
- $mol_fail(new Error(`Not equal (${i + 1}:${j + 1})\n${args[i]}\n${args[j]}`));
1870
- }
1871
- }
1848
+ function $mol_assert_like(...args) {
1849
+ $mol_assert_equal(...args);
1872
1850
  }
1873
- $.$mol_assert_equal = $mol_assert_equal;
1851
+ $.$mol_assert_like = $mol_assert_like;
1874
1852
  function $mol_assert_unique(...args) {
1875
1853
  for (let i = 0; i < args.length; ++i) {
1876
1854
  for (let j = 0; j < args.length; ++j) {
1877
1855
  if (i === j)
1878
1856
  continue;
1879
- if (args[i] === args[j] || (Number.isNaN(args[i]) && Number.isNaN(args[j]))) {
1880
- $mol_fail(new Error(`args[${i}] = args[${j}] = ${args[i]}`));
1881
- }
1857
+ if (!$mol_compare_deep(args[i], args[j]))
1858
+ continue;
1859
+ $mol_fail(new Error(`args[${i}] = args[${j}] = ${args[i]}`));
1882
1860
  }
1883
1861
  }
1884
1862
  }
1885
1863
  $.$mol_assert_unique = $mol_assert_unique;
1886
- function $mol_assert_like(head, ...tail) {
1887
- for (let [index, value] of Object.entries(tail)) {
1888
- if (!$mol_compare_deep(value, head)) {
1889
- const print = (val) => {
1890
- if (!val)
1891
- return val;
1892
- if (typeof val !== 'object')
1893
- return val;
1894
- if ('outerHTML' in val)
1895
- return val.outerHTML;
1896
- try {
1897
- return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
1898
- }
1899
- catch (error) {
1900
- console.error(error);
1901
- return val;
1902
- }
1903
- };
1904
- return $mol_fail(new Error(`Not like (1:${+index + 2})\n${print(head)}\n---\n${print(value)}`));
1905
- }
1864
+ function $mol_assert_equal(...args) {
1865
+ for (let i = 1; i < args.length; ++i) {
1866
+ if ($mol_compare_deep(args[0], args[i]))
1867
+ continue;
1868
+ if (args[0] instanceof $mol_dom_context.Element && args[i] instanceof $mol_dom_context.Element && args[0].outerHTML === args[i].outerHTML)
1869
+ continue;
1870
+ return $mol_fail(new Error(`args[0] ≠ args[${i}]\n${print(args[0])}\n---\n${print(args[i])}`));
1906
1871
  }
1907
1872
  }
1908
- $.$mol_assert_like = $mol_assert_like;
1909
- function $mol_assert_dom(left, right) {
1910
- $mol_assert_equal($mol_dom_serialize(left), $mol_dom_serialize(right));
1911
- }
1912
- $.$mol_assert_dom = $mol_assert_dom;
1873
+ $.$mol_assert_equal = $mol_assert_equal;
1874
+ const print = (val) => {
1875
+ if (!val)
1876
+ return val;
1877
+ if (typeof val !== 'object')
1878
+ return val;
1879
+ if ('outerHTML' in val)
1880
+ return val.outerHTML;
1881
+ try {
1882
+ return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
1883
+ }
1884
+ catch (error) {
1885
+ console.error(error);
1886
+ return val;
1887
+ }
1888
+ };
1913
1889
  })($ || ($ = {}));
1914
1890
  //mol/assert/assert.ts
1915
1891
  ;
@@ -1930,10 +1906,10 @@ var $;
1930
1906
  $mol_assert_equal(2, 2, 2);
1931
1907
  },
1932
1908
  'two must be unique'() {
1933
- $mol_assert_unique([3], [3]);
1909
+ $mol_assert_unique([2], [3]);
1934
1910
  },
1935
1911
  'three must be unique'() {
1936
- $mol_assert_unique([3], [3], [3]);
1912
+ $mol_assert_unique([1], [2], [3]);
1937
1913
  },
1938
1914
  'two must be alike'() {
1939
1915
  $mol_assert_like([3], [3]);
@@ -2264,7 +2240,7 @@ var $;
2264
2240
  };
2265
2241
  }
2266
2242
  error(message, Class = Error) {
2267
- return new Class(`${message}${this}`);
2243
+ return new Class(`${message} (${this})`);
2268
2244
  }
2269
2245
  span(row, col, length) {
2270
2246
  return new $mol_span(this.uri, this.source, row, col, length);
@@ -2279,11 +2255,11 @@ var $;
2279
2255
  if (end < 0)
2280
2256
  end += len;
2281
2257
  if (begin < 0 || begin > len)
2282
- this.$.$mol_fail(`Begin value '${begin}' out of range ${this}`);
2258
+ this.$.$mol_fail(this.error(`Begin value '${begin}' out of range`, RangeError));
2283
2259
  if (end < 0 || end > len)
2284
- this.$.$mol_fail(`End value '${end}' out of range ${this}`);
2260
+ this.$.$mol_fail(this.error(`End value '${end}' out of range`, RangeError));
2285
2261
  if (end < begin)
2286
- this.$.$mol_fail(`End value '${end}' can't be less than begin value ${this}`);
2262
+ this.$.$mol_fail(this.error(`End value '${end}' can't be less than begin value`, RangeError));
2287
2263
  return this.span(this.row, this.col + begin, end - begin);
2288
2264
  }
2289
2265
  }
@@ -2330,14 +2306,14 @@ var $;
2330
2306
  },
2331
2307
  'slice span - out of range'($) {
2332
2308
  const span = new $mol_span('test.ts', '', 1, 3, 5);
2333
- $mol_assert_fail(() => span.slice(-1, 3));
2334
- $mol_assert_fail(() => span.slice(1, 6));
2335
- $mol_assert_fail(() => span.slice(1, 10));
2309
+ $mol_assert_fail(() => span.slice(-1, 3), `End value '3' can't be less than begin value (test.ts#1:3/5)`);
2310
+ $mol_assert_fail(() => span.slice(1, 6), `End value '6' out of range (test.ts#1:3/5)`);
2311
+ $mol_assert_fail(() => span.slice(1, 10), `End value '10' out of range (test.ts#1:3/5)`);
2336
2312
  },
2337
2313
  'error handling'($) {
2338
2314
  const span = new $mol_span('test.ts', '', 1, 3, 4);
2339
- const error = span.error('Some error\n');
2340
- $mol_assert_equal(error.message, 'Some error\ntest.ts#1:3/4');
2315
+ const error = span.error('Some error');
2316
+ $mol_assert_equal(error.message, 'Some error (test.ts#1:3/4)');
2341
2317
  }
2342
2318
  });
2343
2319
  })($ || ($ = {}));