@daaler/jutils 0.4.3 → 0.4.4

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/browser.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./index.js";
2
- export { jwindow, jdocument, domParser, xmlSerializer } from "./jdom/jdom-browser.js";
1
+ export * from "./index.ts";
2
+ export { jwindow, jdocument, domParser, xmlSerializer } from "./jdom/jdom-browser.ts";
@@ -1,4 +1,4 @@
1
- import Exception from "./exception.js";
1
+ import Exception from "./exception.ts";
2
2
  type ExceptionClass = typeof Exception;
3
3
  declare const registerException: (_Exception: ExceptionClass) => void;
4
4
  declare const getException: (typeId: string) => typeof Exception;
package/dist/index.d.ts CHANGED
@@ -1,23 +1,23 @@
1
- import interrupt from "./async-tricks/interrupt.js";
2
- import wait from "./async-tricks/wait.js";
3
- import timedifference from "./time/timedifference.js";
4
- import timefromnow from "./time/timefromnow.js";
5
- import timefromx from "./time/timefromx.js";
6
- import zeroDate from "./time/zero-date.js";
7
- import maxDate from "./time/max-date.js";
8
- import JSchema from "./jschema/jschema.js";
9
- import UUID from "./jschema/uuid.js";
10
- import Integer from "./jschema/integer.js";
11
- import jdebug from "./debug/jdebug.js";
12
- import WeakValueCache from "./cache/weak-value-cache.js";
13
- import IdBasedLRUCache from "./cache/id-based-lru-cache.js";
14
- import IdBasedCache from "./cache/id-based-cache.js";
15
- import Notifications from "./notifications/notifications.js";
16
- import { noop, noopn, pass } from "./op/noop.js";
17
- import Exception from "./exception/exception.js";
18
- import matchExceptions from "./exception/match-exceptions.js";
19
- import { registerException, getException, getExceptionNoError } from "./exception/exceptions.js";
20
- import NotImplementedError, { notImplemented } from "./error/not-implemented.js";
21
- import recursiveMerge from "./data/recursive-merge.js";
1
+ import interrupt from "./async-tricks/interrupt.ts";
2
+ import wait from "./async-tricks/wait.ts";
3
+ import timedifference from "./time/timedifference.ts";
4
+ import timefromnow from "./time/timefromnow.ts";
5
+ import timefromx from "./time/timefromx.ts";
6
+ import zeroDate from "./time/zero-date.ts";
7
+ import maxDate from "./time/max-date.ts";
8
+ import JSchema from "./jschema/jschema.ts";
9
+ import UUID from "./jschema/uuid.ts";
10
+ import Integer from "./jschema/integer.ts";
11
+ import jdebug from "./debug/jdebug.ts";
12
+ import WeakValueCache from "./cache/weak-value-cache.ts";
13
+ import IdBasedLRUCache from "./cache/id-based-lru-cache.ts";
14
+ import IdBasedCache from "./cache/id-based-cache.ts";
15
+ import Notifications from "./notifications/notifications.ts";
16
+ import { noop, noopn, pass } from "./op/noop.ts";
17
+ import Exception from "./exception/exception.ts";
18
+ import matchExceptions from "./exception/match-exceptions.ts";
19
+ import { registerException, getException, getExceptionNoError } from "./exception/exceptions.ts";
20
+ import NotImplementedError, { notImplemented } from "./error/not-implemented.ts";
21
+ import recursiveMerge from "./data/recursive-merge.ts";
22
22
  export { interrupt, wait, timedifference, timefromnow, timefromx, zeroDate as zeroTime, // legacy naming
23
23
  zeroDate, maxDate, JSchema, UUID, Integer, jdebug, WeakValueCache, IdBasedLRUCache, IdBasedCache, Notifications, noop, noopn, pass, Exception, matchExceptions, registerException, getException, getExceptionNoError, NotImplementedError, notImplemented, recursiveMerge, };
@@ -0,0 +1,5 @@
1
+ declare const jdocument: import("linkedom/types/xml/document").XMLDocument;
2
+ declare const jwindow: Window & typeof globalThis;
3
+ declare function serializeDomToXml(dom: XMLDocument): string;
4
+ declare function parseXmlToDom(xml: string): import("linkedom/types/xml/document").XMLDocument;
5
+ export { jwindow, jdocument, parseXmlToDom, serializeDomToXml };
@@ -0,0 +1,14 @@
1
+ import { DOMParser } from "linkedom";
2
+ const domParser = new DOMParser();
3
+ const jdocument = domParser.parseFromString("", "text/xml");
4
+ const jwindow = jdocument.defaultView;
5
+ function serializeDomToXml(dom) {
6
+ const xml = dom.toString();
7
+ return xml;
8
+ }
9
+ function parseXmlToDom(xml) {
10
+ const dom = domParser.parseFromString(xml, "text/xml");
11
+ return dom;
12
+ }
13
+ export { jwindow, jdocument, parseXmlToDom, serializeDomToXml };
14
+ //# sourceMappingURL=jdom-node-linkedom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jdom-node-linkedom.js","sourceRoot":"","sources":["../../src/jdom/jdom-node-linkedom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIrC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;AAClC,MAAM,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,EAAE,EAAC,UAAU,CAAC,CAAC;AAC3D,MAAM,OAAO,GAAG,SAAS,CAAC,WAAW,CAAC;AAEtC,SAAS,iBAAiB,CAAC,GAAe;IACzC,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC3B,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,SAAS,aAAa,CAAC,GAAU;IAChC,MAAM,GAAG,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,EAAC,UAAU,CAAC,CAAC;IACtD,OAAO,GAAG,CAAC;AACZ,CAAC;AAID,OAAO,EAAE,OAAO,EAAC,SAAS,EAAC,aAAa,EAAC,iBAAiB,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import JType from "./jtype.js";
1
+ import JType from "./jtype.ts";
2
2
  export default abstract class Integer extends JType {
3
3
  static readonly _kind = "Integer";
4
4
  static isInteger: (number: unknown) => boolean;
@@ -1,7 +1,7 @@
1
- import type JSchema from "./jschema.js";
2
- import type any from "./any.js";
3
- import type { IntegerConstructor } from "./integer.js";
4
- import type { TupleConstructor } from "./tuple.js";
1
+ import type JSchema from "./jschema.ts";
2
+ import type any from "./any.ts";
3
+ import type { IntegerConstructor } from "./integer.ts";
4
+ import type { TupleConstructor } from "./tuple.ts";
5
5
  export type SchemaDefinition = null | JSchema<any> | StringConstructor | {
6
6
  type: StringConstructor;
7
7
  } | NumberConstructor | {
@@ -1,4 +1,4 @@
1
- import type { SchemaDefinition, InferSchemaType } from "./jschema-types.js";
1
+ import type { SchemaDefinition, InferSchemaType } from "./jschema-types.ts";
2
2
  export default class JSchema<T extends SchemaDefinition> {
3
3
  _schema: InferSchemaType<T>;
4
4
  get schema(): InferSchemaType<T>;
@@ -1,5 +1,5 @@
1
- import JType from "./jtype.js";
1
+ import JType from "./jtype.ts";
2
2
  export default abstract class Tuple extends JType {
3
- static readonly _kind = "Tuple";
3
+ static readonly _kind?: "Tuple" | undefined;
4
4
  }
5
5
  export type TupleConstructor = typeof Tuple;
@@ -1 +1 @@
1
- {"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../src/jschema/tuple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAI/B,MAAM,CAAC,OAAO,OAAgB,KAAM,SAAQ,KAAK;IAChD,MAAM,CAAU,KAAK,GAAG,OAAO,CAAC;;AAChC,CAAC"}
1
+ {"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../src/jschema/tuple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAI/B,MAAM,CAAC,OAAO,OAAgB,KAAM,SAAQ,KAAK;IAChD,MAAM,CAAU,KAAK,GAAI,OAAO,CAAC;;AACjC,CAAC"}
package/dist/node.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./index.js";
2
- export { jwindow, jdocument, domParser, xmlSerializer } from "./jdom/jdom-node.js";
3
- export { default as randomInteger } from "./random/random-integer-node.js";
1
+ export * from "./index.ts";
2
+ export { jwindow, jdocument, domParser, xmlSerializer } from "./jdom/jdom-node.ts";
3
+ export { default as randomInteger } from "./random/random-integer-node.ts";
@@ -1,2 +1,2 @@
1
- import type { Options, LayoutStyle } from "./types.js";
1
+ import type { Options, LayoutStyle } from "./types.ts";
2
2
  export default function calculateStyle(width: number, height: number, options: Options): LayoutStyle;
@@ -1,5 +1,5 @@
1
1
  import { RefObject } from "react";
2
- import { type Dimensions } from "./types.js";
2
+ import { type Dimensions } from "./types.ts";
3
3
  /**
4
4
  * Measure an element in the browser ui
5
5
  * @param element Element to measure
@@ -1 +1 @@
1
- {"version":3,"file":"useElementDimensions.js","sourceRoot":"","sources":["../../src/react/useElementDimensions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAC,eAAe,EAAY,MAAM,OAAO,CAAC;AAK3D;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,OAA8B;IAC1E,MAAM,CAAE,UAAU,EAAC,aAAa,CAAE,GAAG,QAAQ,CAAa,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAA;IAEhE,MAAM,YAAY,GAAG,GAAG,EAAE;QACzB,IAAG,CAAC,OAAO,CAAC,OAAO;YAAE,OAAO;QAC5B,MAAM,EAAE,WAAW,EAAC,YAAY,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;QACrD,aAAa,CAAC,CAAE,WAAW,EAAC,YAAY,CAAE,CAAC,CAAC;IAC7C,CAAC,CAAC;IAEF,eAAe,CAAC,GAAG,EAAE;QACpB,YAAY,EAAE,CAAC;QACf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAC/C,OAAO,GAAG,EAAE,GAAG,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA,CAAC,CAAC,CAAA;IACpE,CAAC,EAAC,CAAE,OAAO,CAAE,CAAC,CAAA;IAEd,OAAO,UAAU,CAAC;AACnB,CAAC;AAAA,CAAC"}
1
+ {"version":3,"file":"useElementDimensions.js","sourceRoot":"","sources":["../../src/react/useElementDimensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAC,eAAe,EAAY,MAAM,OAAO,CAAC;AAK3D;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,OAA8B;IAC1E,MAAM,CAAE,UAAU,EAAC,aAAa,CAAE,GAAG,QAAQ,CAAa,CAAC,CAAC,EAAC,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JLocation.js","sourceRoot":"","sources":["../../src/react/useJLocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAC,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,IAAI,CAAC;AAIpB,MAAM,CAAC,OAAO,UAAU,YAAY;IACnC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAE5B,MAAM,SAAS,GAAG;QACjB,GAAG,QAAQ;QACX,MAAM;QACN,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtD,CAAC;IAEF,OAAO,SAAS,CAAC;AAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useJNavigate.js","sourceRoot":"","sources":["../../src/react/useJNavigate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,MAAM,IAAI,CAAC;AAQpB,MAAM,CAAC,OAAO,UAAU,YAAY;IACnC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,SAAS,SAAS,CAAC,IAAW,EAAC,OAAwB;QACtD,MAAM,EAAE,KAAK,EAAC,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC;QAC7C,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACpE,QAAQ,CAAC,WAAW,EAAC,eAAe,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC"}
1
+ {"version":3,"file":"useJNavigate.js","sourceRoot":"","sources":["../../src/react/useJNavigate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,MAAM,IAAI,CAAC;AAQpB,MAAM,CAAC,OAAO,UAAU,YAAY;IACnC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,SAAS,SAAS,CAAC,IAAW,EAAC,OAAwB;QACtD,MAAM,EAAE,KAAK,EAAC,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC;QAC7C,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACpE,QAAQ,CAAC,WAAW,EAAC,eAAe,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { RefObject } from "react";
2
- import type { Options, LayoutStyle } from "./types.js";
2
+ import type { Options, LayoutStyle } from "./types.ts";
3
3
  /**
4
4
  * Measure an element in the browser ui
5
5
  * @param element Element to measure
@@ -1 +1 @@
1
- {"version":3,"file":"useLayoutStyle.js","sourceRoot":"","sources":["../../src/react/useLayoutStyle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAC,eAAe,EAAY,MAAM,OAAO,CAAC;AAE3D,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAIzD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,OAA8B,EAAC,UAAgB,EAAE;IACvF,MAAM,CAAE,WAAW,EAAC,cAAc,CAAE,GAAG,QAAQ,CAAc,CAAE,QAAQ,EAAC,KAAK,CAAE,CAAC,CAAC;IAEjF,MAAM,YAAY,GAAG,GAAG,EAAE;QACzB,IAAG,CAAC,OAAO,CAAC,OAAO;YAAE,OAAO;QAC5B,MAAM,EAAE,WAAW,EAAC,YAAY,EAA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CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAC/C,OAAO,GAAG,EAAE,GAAG,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA,CAAC,CAAC,CAAA;IACpE,CAAC,EAAC,CAAE,OAAO,CAAE,CAAC,CAAA;IAEd,OAAO,WAAW,CAAC;AACpB,CAAC;AAAA,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useToggle.js","sourceRoot":"","sources":["../../src/react/useToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIjC,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,eAAqB,KAAK;IAC3D,MAAM,CAAE,KAAK,EAAC,QAAQ,CAAE,GAAG,QAAQ,CAAU,YAAY,CAAC,CAAC;IAE3D,MAAM,MAAM,GAAG,GAAG,EAAE;QACnB,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,EAAE;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,GAAG,EAAE;QACrB,QAAQ,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CAAE,KAAK,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,CAAE,CAAC;AAC1C,CAAC;AAAA,CAAC"}
1
+ {"version":3,"file":"useToggle.js","sourceRoot":"","sources":["../../src/react/useToggle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIjC,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,eAAqB,KAAK;IAC3D,MAAM,CAAE,KAAK,EAAC,QAAQ,CAAE,GAAG,QAAQ,CAAU,YAAY,CAAC,CAAC;IAE3D,MAAM,MAAM,GAAG,GAAG,EAAE;QACnB,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,EAAE;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,GAAG,EAAE;QACrB,QAAQ,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CAAE,KAAK,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,CAAE,CAAC;AAC1C,CAAC;AAAA,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Options, LayoutStyle } from "./types.js";
1
+ import type { Options, LayoutStyle } from "./types.ts";
2
2
  /**
3
3
  * Measure browser window inner size
4
4
  * @return layout style ("large", "narrow", or "short"), navbar position ("top" or "left")
@@ -1 +1 @@
1
- {"version":3,"file":"useWindowLayoutStyle.js","sourceRoot":"","sources":["../../src/react/useWindowLayoutStyle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAC,eAAe,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAIzD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,UAAgB,EAAE;IAC9D,MAAM,CAAE,WAAW,EAAC,cAAc,CAAE,GAAG,QAAQ,CAAc,CAAE,QAAQ,EAAC,KAAK,CAAE,CAAC,CAAC;IAEjF,MAAM,YAAY,GAAG,GAAG,EAAE;QACzB,MAAM,EAAE,UAAU,EAAC,WAAW,EAAE,GAAG,MAAM,CAAC;QAC1C,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,EAAC,WAAW,EAAC,OAAO,CAAC,CAAC;QAC7D,cAAc,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,eAAe,CAAC,GAAG,EAAE;QACpB,YAAY,EAAE,CAAC;QACf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAC/C,OAAO,GAAG,EAAE,GAAG,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA,CAAC,CAAC,CAAA;IACpE,CAAC,EAAC,EAAE,CAAC,CAAA;IAEL,OAAO,WAAW,CAAC;AACpB,CAAC;AAAA,CAAC"}
1
+ {"version":3,"file":"useWindowLayoutStyle.js","sourceRoot":"","sources":["../../src/react/useWindowLayoutStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAC,eAAe,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAIzD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,UAAgB,EAAE;IAC9D,MAAM,CAAE,WAAW,EAAC,cAAc,CAAE,GAAG,QAAQ,CAAc,CAAE,QAAQ,EAAC,KAAK,CAAE,CAAC,CAAC;IAEjF,MAAM,YAAY,GAAG,GAAG,EAAE;QACzB,MAAM,EAAE,UAAU,EAAC,WAAW,EAAE,GAAG,MAAM,CAAC;QAC1C,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,EAAC,WAAW,EAAC,OAAO,CAAC,CAAC;QAC7D,cAAc,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,eAAe,CAAC,GAAG,EAAE;QACpB,YAAY,EAAE,CAAC;QACf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAC/C,OAAO,GAAG,EAAE,GAAG,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA,CAAC,CAAC,CAAA;IACpE,CAAC,EAAC,EAAE,CAAC,CAAA;IAEL,OAAO,WAAW,CAAC;AACpB,CAAC;AAAA,CAAC"}
package/dist/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from "./browser.js";
2
- export { default as useToggle } from "./react/useToggle.js";
3
- export { default as useLayoutStyle } from "./react/useLayoutStyle.js";
4
- export { default as useWindowLayoutStyle } from "./react/useWindowLayoutStyle.js";
5
- export { default as useElementDimensions } from "./react/useElementDimensions.js";
6
- export { default as useJLocation } from "./react/useJLocation.js";
7
- export { default as useJNavigate } from "./react/useJNavigate.js";
1
+ export * from "./browser.ts";
2
+ export { default as useToggle } from "./react/useToggle.ts";
3
+ export { default as useLayoutStyle } from "./react/useLayoutStyle.ts";
4
+ export { default as useWindowLayoutStyle } from "./react/useWindowLayoutStyle.ts";
5
+ export { default as useElementDimensions } from "./react/useElementDimensions.ts";
6
+ export { default as useJLocation } from "./react/useJLocation.ts";
7
+ export { default as useJNavigate } from "./react/useJNavigate.ts";
package/package.json CHANGED
@@ -1,50 +1,55 @@
1
1
  {
2
- "name": "@daaler/jutils",
3
- "version": "0.4.3",
4
- "description": "Utility functions for js",
5
- "author": "Jarno Parviainen - jarno.parviainen@gmail.com",
6
- "license": "UNLICENSED",
7
- "type": "module",
8
- "main": "dist/index.js",
9
- "types": "dist/index.d.ts",
10
- "exports": {
11
- ".": "./dist/index.js",
12
- "./node": "./dist/node.js",
13
- "./browser": "./dist/browser.js",
14
- "./react": "./dist/react.js"
15
- },
16
- "files": [
17
- "dist"
18
- ],
19
- "scripts": {
20
- "build": "tsc",
21
- "clean": "rm -r dist",
22
- "test:run": "node --expose-gc --test",
23
- "test": "npm run build && npm run test:run",
24
- "publish-to-npm": "npm run clean && npm run build && npm publish --access public",
25
- "install:peers": "npm install --no-save $(node -p \"Object.entries(require('./package.json').peerDependencies).map(([name, version]) => name + '@' + version).join(' ')\")"
26
- },
27
- "devDependencies": {
28
- "@types/node": "^24.1.0"
29
- },
30
- "peerDependencies": {
31
- "jsdom": "^27.0.0",
32
- "qs": "^6.14.0",
33
- "react": "^19.1.0",
34
- "react-router-dom": "^7.7.0"
35
- },
36
- "peerDependenciesMeta": {
37
- "jsdom": {
38
- "optional": true
39
- },
40
- "qs": {
41
- "optional": true
42
- },
43
- "react": {
44
- "optional": true
45
- },
46
- "react-router-dom": {
47
- "optional": true
48
- }
49
- }
50
- }
2
+ "name": "@daaler/jutils",
3
+ "version": "0.4.4",
4
+ "description": "Utility functions for js",
5
+ "author": "Jarno Parviainen - jarno.parviainen@gmail.com",
6
+ "license": "UNLICENSED",
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": "./dist/index.js",
12
+ "./node": "./dist/node.js",
13
+ "./browser": "./dist/browser.js",
14
+ "./react": "./dist/react.js",
15
+ "./jdom-node-linkedom": "./dist/jdom/jdom-node-linkedom.js"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "devDependencies": {
21
+ "@types/node": "^24.1.0",
22
+ "typescript": "^5.9.3"
23
+ },
24
+ "peerDependencies": {
25
+ "jsdom": "^27.0.0",
26
+ "linkedom": "^0.18.12",
27
+ "qs": "^6.14.0",
28
+ "react": "^19.1.0",
29
+ "react-router-dom": "^7.7.0"
30
+ },
31
+ "peerDependenciesMeta": {
32
+ "jsdom": {
33
+ "optional": true
34
+ },
35
+ "linkedom": {
36
+ "optional": true
37
+ },
38
+ "qs": {
39
+ "optional": true
40
+ },
41
+ "react": {
42
+ "optional": true
43
+ },
44
+ "react-router-dom": {
45
+ "optional": true
46
+ }
47
+ },
48
+ "scripts": {
49
+ "build": "pnpm tsc",
50
+ "clean": "rm -r dist",
51
+ "test:run": "NODE_OPTIONS=--expose-gc node --test",
52
+ "test": "pnpm run build && pnpm run test:run",
53
+ "publish-to-npm": "pnpm run clean && pnpm run build && pnpm publish --access public"
54
+ }
55
+ }