@daaler/jutils 0.4.5 → 0.4.7

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/index.d.ts CHANGED
@@ -13,12 +13,13 @@ import WeakValueCache from "./cache/weak-value-cache.ts";
13
13
  import IdBasedLRUCache from "./cache/id-based-lru-cache.ts";
14
14
  import IdBasedCache from "./cache/id-based-cache.ts";
15
15
  import Notifications from "./notifications/notifications.ts";
16
- import { noop, noopn, pass } from "./op/noop.ts";
17
16
  import Exception from "./exception/exception.ts";
18
17
  import matchExceptions from "./exception/match-exceptions.ts";
19
18
  import { registerException, getException, getExceptionNoError } from "./exception/exceptions.ts";
20
19
  import NotImplementedError, { notImplemented } from "./error/not-implemented.ts";
21
20
  import recursiveMerge from "./data/recursive-merge.ts";
22
21
  export { interrupt, wait, timedifference, timefromnow, timefromx, zeroDate as zeroTime, // legacy naming
23
- zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, recursiveMerge, };
22
+ zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, recursiveMerge, };
23
+ export { default as isDigit } from "./string/is-digit.ts";
24
+ export { noop, noop1, noop2, noop3, noopn, pass } from "./op/noop.ts";
24
25
  export { default as DomUtils } from "./jdom/dom-utils.ts";
package/dist/index.js CHANGED
@@ -13,13 +13,14 @@ import WeakValueCache from "./cache/weak-value-cache.js";
13
13
  import IdBasedLRUCache from "./cache/id-based-lru-cache.js";
14
14
  import IdBasedCache from "./cache/id-based-cache.js";
15
15
  import Notifications from "./notifications/notifications.js";
16
- import { noop, noopn, pass } from "./op/noop.js";
17
16
  import Exception from "./exception/exception.js";
18
17
  import matchExceptions from "./exception/match-exceptions.js";
19
18
  import { registerException, getException, getExceptionNoError } from "./exception/exceptions.js";
20
19
  import NotImplementedError, { notImplemented } from "./error/not-implemented.js";
21
20
  import recursiveMerge from "./data/recursive-merge.js";
22
21
  export { interrupt, wait, timedifference, timefromnow, timefromx, zeroDate as zeroTime, // legacy naming
23
- zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, recursiveMerge, };
22
+ zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, recursiveMerge, };
23
+ export { default as isDigit } from "./string/is-digit.js";
24
+ export { noop, noop1, noop2, noop3, noopn, pass } from "./op/noop.js";
24
25
  export { default as DomUtils } from "./jdom/dom-utils.js";
25
26
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OA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AAM,mBAAmB,CAAC;AACrC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,aAAa,MAAM,kCAAkC,CAAC;AAC7D,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAC,YAAY,EAAC,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,mBAAmB,EAAC,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,cAAc,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EACN,SAAS,EACT,IAAI,EACJ,cAAc,EACd,WAAW,EACX,SAAS,EACT,QAAQ,IAAI,QAAQ,EAAE,gBAAgB;AACtC,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,EACP,MAAM,EACN,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,cAAc,GACd,CAAC;AAEF,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,IAAI,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC"}
@@ -5,6 +5,6 @@ export default class DomUtils {
5
5
  constructor(_document: Document | XMLDocument, _domParser: DOMParser, _xmlSerializer: XMLSerializer);
6
6
  createElement(tagname: string): HTMLElement;
7
7
  createTextNode(data: string): Text;
8
- parse(string: string): XMLDocument;
9
- serialize(dom: XMLDocument): string;
8
+ parse(string: string): HTMLElement;
9
+ serialize(dom: HTMLElement): string;
10
10
  }
@@ -14,7 +14,9 @@ export default class DomUtils {
14
14
  return this._document.createTextNode(data);
15
15
  }
16
16
  parse(string) {
17
- return this._domParser.parseFromString(string, "text/xml");
17
+ const outerDom = this._domParser.parseFromString(string, "text/xml");
18
+ const htmlElement = outerDom.documentElement;
19
+ return htmlElement;
18
20
  }
19
21
  serialize(dom) {
20
22
  return this._xmlSerializer.serializeToString(dom);
@@ -1 +1 @@
1
- {"version":3,"file":"dom-utils.js","sourceRoot":"","sources":["../../src/jdom/dom-utils.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC5B,SAAS,CAAU;IACnB,UAAU,CAAW;IACrB,cAAc,CAAe;IAE7B,YAAY,SAA8B,EAAC,UAAoB,EAAC,cAA4B;QAC3F,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACtC,CAAC;IAED,aAAa,CAAC,OAAc;QAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,cAAc,CAAC,IAAW;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,MAAa;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,EAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;IAED,SAAS,CAAC,GAAe;QACxB,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACnD,CAAC;CACD"}
1
+ {"version":3,"file":"dom-utils.js","sourceRoot":"","sources":["../../src/jdom/dom-utils.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC5B,SAAS,CAAU;IACnB,UAAU,CAAW;IACrB,cAAc,CAAe;IAE7B,YAAY,SAA8B,EAAC,UAAoB,EAAC,cAA4B;QAC3F,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACtC,CAAC;IAED,aAAa,CAAC,OAAc;QAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,cAAc,CAAC,IAAW;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,MAAa;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,EAAC,UAAU,CAAgB,CAAC;QACnF,MAAM,WAAW,GAAG,QAAQ,CAAC,eAAe,CAAC;QAC7C,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,SAAS,CAAC,GAAe;QACxB,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACnD,CAAC;CACD"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * return true if argument is single digit (0-9) character false otherwise
3
+ */
4
+ export default function isDigit(char: string): boolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * return true if argument is single digit (0-9) character false otherwise
3
+ */
4
+ export default function isDigit(char) {
5
+ return char <= "9" && char >= "0" && char.length === 1;
6
+ }
7
+ //# sourceMappingURL=is-digit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-digit.js","sourceRoot":"","sources":["../../src/string/is-digit.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAAW;IAC1C,OAAO,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC;AACxD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daaler/jutils",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "Utility functions for js",
5
5
  "author": "Jarno Parviainen - jarno.parviainen@gmail.com",
6
6
  "license": "UNLICENSED",