@arcgis/toolkit 5.0.0-next.17 → 5.0.0-next.170

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/LICENSE.md CHANGED
@@ -4,10 +4,14 @@ COPYRIGHT © Esri
4
4
 
5
5
  All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
6
6
 
7
- This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
7
+ This material is licensed for use under the [Esri Master License Agreement (MLA)](https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf), and is bound by the terms of that agreement.
8
+ You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
8
9
 
9
- See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
10
+ For additional information, contact:
11
+ Environmental Systems Research Institute, Inc.
12
+ Attn: Contracts and Legal Services Department
13
+ 380 New York Street
14
+ Redlands, California, USA 92373
15
+ USA
10
16
 
11
- For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA
12
-
13
- email: contracts@esri.com
17
+ email: legal@esri.com
package/README.md CHANGED
@@ -8,6 +8,5 @@ It is not intended to be used directly, but rather used as a dependency by other
8
8
 
9
9
  ## License
10
10
 
11
- COPYRIGHT © Esri
12
-
13
- This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package.
11
+ This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.0/LICENSE.txt.
12
+ For third party notices, see https://js.arcgis.com/5.0/third-party-notices.txt.
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const mappedFind = (array, callback) => {
4
- for (let i = 0; i < array.length; i++) {
4
+ const length = array.length;
5
+ for (let i = 0; i < length; ++i) {
5
6
  const value = callback(array[i], i);
6
7
  if (value != null) {
7
8
  return value ?? void 0;
@@ -1,4 +1,4 @@
1
- import { nil } from '../type';
1
+ import { nil } from '../type/index.ts';
2
2
  /**
3
3
  * A combination of map and find.
4
4
  * Find a value in an array, and return its mapped variant.
@@ -1,4 +1,4 @@
1
- import { nil } from '../type';
1
+ import { nil } from '../type/index.ts';
2
2
  /**
3
3
  * A combination of map and find.
4
4
  * Find a value in an array, and return its mapped variant.
@@ -1,5 +1,6 @@
1
1
  const mappedFind = (array, callback) => {
2
- for (let i = 0; i < array.length; i++) {
2
+ const length = array.length;
3
+ for (let i = 0; i < length; ++i) {
3
4
  const value = callback(array[i], i);
4
5
  if (value != null) {
5
6
  return value ?? void 0;
@@ -31,7 +31,7 @@ function getSlotAssignedElements(slot, selector) {
31
31
  }
32
32
  const classes = (...classes2) => {
33
33
  const effectiveClasses = [];
34
- for (let i = 0; i < classes2.length; i++) {
34
+ for (let i = 0; i < classes2.length; ++i) {
35
35
  const arg = classes2[i];
36
36
  if (typeof arg === "string") {
37
37
  effectiveClasses.push(arg);
@@ -1,5 +1,5 @@
1
- import { nil } from '../type';
2
- export * from './slots';
1
+ import { nil } from '../type/index.ts';
2
+ export * from './slots.ts';
3
3
  /**
4
4
  * Combine multiple class names into a single string.
5
5
  *
@@ -76,7 +76,7 @@ export declare function unsafeGetCalciteModeName(el: HTMLElement): "dark" | "lig
76
76
  * expected to respect what was set by the consumer.
77
77
  *
78
78
  * @remarks
79
- * Prefer [useDirection()](https://qawebgis.esri.com/components/lumina/controllers/useDirection)
79
+ * Prefer [useDirection()](https://webgis.esri.com/references/lumina/controllers/useDirection)
80
80
  * to ensure your component is responsive to direction changes.
81
81
  */
82
82
  export declare const unsafeGetElementDirection: (el: HTMLElement) => "ltr" | "rtl";
@@ -1,5 +1,5 @@
1
- import { nil } from '../type';
2
- export * from './slots';
1
+ import { nil } from '../type/index.ts';
2
+ export * from './slots.ts';
3
3
  /**
4
4
  * Combine multiple class names into a single string.
5
5
  *
@@ -76,7 +76,7 @@ export declare function unsafeGetCalciteModeName(el: HTMLElement): "dark" | "lig
76
76
  * expected to respect what was set by the consumer.
77
77
  *
78
78
  * @remarks
79
- * Prefer [useDirection()](https://qawebgis.esri.com/components/lumina/controllers/useDirection)
79
+ * Prefer [useDirection()](https://webgis.esri.com/references/lumina/controllers/useDirection)
80
80
  * to ensure your component is responsive to direction changes.
81
81
  */
82
82
  export declare const unsafeGetElementDirection: (el: HTMLElement) => "ltr" | "rtl";
package/dist/dom/index.js CHANGED
@@ -29,7 +29,7 @@ function getSlotAssignedElements(slot, selector) {
29
29
  }
30
30
  const classes = (...classes2) => {
31
31
  const effectiveClasses = [];
32
- for (let i = 0; i < classes2.length; i++) {
32
+ for (let i = 0; i < classes2.length; ++i) {
33
33
  const arg = classes2[i];
34
34
  if (typeof arg === "string") {
35
35
  effectiveClasses.push(arg);
@@ -14,7 +14,7 @@ export declare function slotChangeHasContent(event: Event): boolean;
14
14
  * Returns a string of textContent if the target `slot` element from the `onSlotchange` event has any text content.
15
15
  *
16
16
  * @param event The event.
17
- * @returns {string} The slots text.
17
+ * @returns The slots text.
18
18
  *
19
19
  * @example
20
20
  * ```tsx
@@ -73,9 +73,9 @@ export declare function slotChangeHasAssignedElement(event: Event): boolean;
73
73
  /**
74
74
  * Returns the assigned elements on a `slot` element from the `onSlotchange` event.
75
75
  *
76
- * @param {Event} event The event.
77
- * @param {string} selector The CSS selector string to filter the returned elements by.
78
- * @returns {Element[]} An array of elements.
76
+ * @param event The event.
77
+ * @param selector The CSS selector string to filter the returned elements by.
78
+ * @returns An array of elements.
79
79
  *
80
80
  * @example
81
81
  * ```tsx
@@ -86,8 +86,8 @@ export declare function slotChangeGetAssignedElements<T extends Element>(event:
86
86
  /**
87
87
  * Returns the assigned elements on a `slot` element, filtered by an optional css selector.
88
88
  *
89
- * @param {HTMLSlotElement} slot The slot element.
90
- * @param {string} selector CSS selector string to filter the returned elements by.
91
- * @returns {Element[]} An array of elements.
89
+ * @param slot The slot element.
90
+ * @param selector CSS selector string to filter the returned elements by.
91
+ * @returns An array of elements.
92
92
  */
93
93
  export declare function getSlotAssignedElements<T extends Element>(slot: HTMLSlotElement, selector?: string): T[];
@@ -14,7 +14,7 @@ export declare function slotChangeHasContent(event: Event): boolean;
14
14
  * Returns a string of textContent if the target `slot` element from the `onSlotchange` event has any text content.
15
15
  *
16
16
  * @param event The event.
17
- * @returns {string} The slots text.
17
+ * @returns The slots text.
18
18
  *
19
19
  * @example
20
20
  * ```tsx
@@ -73,9 +73,9 @@ export declare function slotChangeHasAssignedElement(event: Event): boolean;
73
73
  /**
74
74
  * Returns the assigned elements on a `slot` element from the `onSlotchange` event.
75
75
  *
76
- * @param {Event} event The event.
77
- * @param {string} selector The CSS selector string to filter the returned elements by.
78
- * @returns {Element[]} An array of elements.
76
+ * @param event The event.
77
+ * @param selector The CSS selector string to filter the returned elements by.
78
+ * @returns An array of elements.
79
79
  *
80
80
  * @example
81
81
  * ```tsx
@@ -86,8 +86,8 @@ export declare function slotChangeGetAssignedElements<T extends Element>(event:
86
86
  /**
87
87
  * Returns the assigned elements on a `slot` element, filtered by an optional css selector.
88
88
  *
89
- * @param {HTMLSlotElement} slot The slot element.
90
- * @param {string} selector CSS selector string to filter the returned elements by.
91
- * @returns {Element[]} An array of elements.
89
+ * @param slot The slot element.
90
+ * @param selector CSS selector string to filter the returned elements by.
91
+ * @returns An array of elements.
92
92
  */
93
93
  export declare function getSlotAssignedElements<T extends Element>(slot: HTMLSlotElement, selector?: string): T[];
@@ -10,12 +10,12 @@
10
10
  * - `process.env.NODE_ENV === "development"`
11
11
  * - `process.env.NODE_ENV === "test"`
12
12
  *
13
- * [Documentation](https://qawebgis.esri.com/components/lumina/publishing#internal-esri-environment)
13
+ * [Documentation](https://webgis.esri.com/references/lumina/publishing#internal-esri-environment)
14
14
  *
15
15
  * @remarks
16
16
  * This function is primary for usage in support packages. In Lumina component
17
17
  * packages, simpler alternatives are provided:
18
- * https://qawebgis.esri.com/components/lumina/publishing#bundling-code-conditionally
18
+ * https://webgis.esri.com/references/lumina/publishing#bundling-code-conditionally
19
19
  */
20
20
  export declare const isEsriInternalEnv: () => boolean;
21
21
  /**
@@ -10,12 +10,12 @@
10
10
  * - `process.env.NODE_ENV === "development"`
11
11
  * - `process.env.NODE_ENV === "test"`
12
12
  *
13
- * [Documentation](https://qawebgis.esri.com/components/lumina/publishing#internal-esri-environment)
13
+ * [Documentation](https://webgis.esri.com/references/lumina/publishing#internal-esri-environment)
14
14
  *
15
15
  * @remarks
16
16
  * This function is primary for usage in support packages. In Lumina component
17
17
  * packages, simpler alternatives are provided:
18
- * https://qawebgis.esri.com/components/lumina/publishing#bundling-code-conditionally
18
+ * https://webgis.esri.com/references/lumina/publishing#bundling-code-conditionally
19
19
  */
20
20
  export declare const isEsriInternalEnv: () => boolean;
21
21
  /**
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const dom_index = require("../dom/index.cjs");
4
+ const log_index = require("../log/index.cjs");
4
5
  const supportedLocalesArray = "ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(
5
6
  ","
6
7
  );
@@ -40,12 +41,14 @@ const fetchBundle = async (locale, path) => {
40
41
  if (process.env.NODE_ENV !== "production") {
41
42
  const is404ViteFallback = String(error).includes(`Unexpected token '<', "<!doctype "... is not valid JSON`);
42
43
  if (is404ViteFallback) {
43
- console.error(`[404] Localization strings not found at ${filePath}`);
44
+ log_index.log("error", "intl", `Localization strings not found at ${filePath}`);
44
45
  } else {
45
- console.error(`Error fetching localization strings at ${filePath}`, error);
46
+ log_index.log("error", "intl", `Error fetching localization strings at ${filePath}`, { detail: { error } });
46
47
  }
47
48
  } else {
48
- console.error(error);
49
+ log_index.log("error", "intl", `An unknown error occurred while fetching localization strings at ${filePath}`, {
50
+ detail: { error }
51
+ });
49
52
  }
50
53
  return {};
51
54
  }
@@ -81,7 +84,9 @@ const startLocaleObserver = (element, getAssetsPath, onUpdated, assetName) => {
81
84
  onUpdated(newResult);
82
85
  }
83
86
  result = newResult;
84
- }).catch(console.error);
87
+ }).catch((error) => {
88
+ log_index.log("error", "intl", "Error updating component locale state", { detail: { error } });
89
+ });
85
90
  queueMicrotask(callback);
86
91
  return dom_index.observeAncestorsMutation(element, ["lang"], callback);
87
92
  };
@@ -2,7 +2,7 @@ declare const supportedLocalesArray: ["ar", "bg", "bs", "ca", "cs", "da", "de",
2
2
  /**
3
3
  * The list of supported locales for ArcGIS Maps SDK for JavaScript components.
4
4
  */
5
- export declare const supportedLocales: Set<"hr" | "th" | "tr" | "ar" | "bg" | "bs" | "ca" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "he" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "lv" | "nl" | "nb" | "no" | "pl" | "pt-BR" | "pt-PT" | "ro" | "ru" | "sk" | "sl" | "sr" | "sv" | "uk" | "vi" | "zh-CN" | "zh-HK" | "zh-TW">;
5
+ export declare const supportedLocales: Set<"hr" | "th" | "tr" | "el" | "ar" | "bg" | "bs" | "ca" | "cs" | "da" | "de" | "en" | "es" | "et" | "fi" | "fr" | "he" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "lv" | "nl" | "nb" | "no" | "pl" | "pt-BR" | "pt-PT" | "ro" | "ru" | "sk" | "sl" | "sr" | "sv" | "uk" | "vi" | "zh-CN" | "zh-HK" | "zh-TW">;
6
6
  /**
7
7
  * TypeScript union type for each locale supported by WebGIS SDK
8
8
  */
@@ -23,7 +23,7 @@ export declare const defaultLocale = "en";
23
23
  *
24
24
  * @remarks
25
25
  * Rather than using this function directly, prefer the
26
- * [useT9n()](https://qawebgis.esri.com/components/lumina/controllers/useT9n)
26
+ * [useT9n()](https://webgis.esri.com/references/lumina/controllers/useT9n)
27
27
  * controller.
28
28
  *
29
29
  * @remarks
@@ -39,7 +39,7 @@ export declare const defaultLocale = "en";
39
39
  * );
40
40
  * ```
41
41
  *
42
- * @see [Lumina asset handling](https://qawebgis.esri.com/components/lumina/assets)
42
+ * @see [Lumina asset handling](https://webgis.esri.com/references/lumina/assets)
43
43
  */
44
44
  export declare const fetchT9nStringsBundle: <Strings extends GenericT9nStrings>(locale: string, assetsPath: string, prefix?: string) => Promise<Strings>;
45
45
  /**
@@ -55,7 +55,7 @@ export interface GenericT9nStrings {
55
55
  *
56
56
  * @returns an object with the `lang` and `t9nLocale` properties.
57
57
  *
58
- * @see [lang vs t9nLocale](https://qawebgis.esri.com/components/lumina/controllers/useT9n#difference-between-lang-and-t9nlocale).
58
+ * @see [lang vs t9nLocale](https://webgis.esri.com/references/lumina/controllers/useT9n#difference-between-lang-and-t9nlocale).
59
59
  */
60
60
  export declare const getElementLocale: (element: HTMLElement) => {
61
61
  readonly lang: string;
@@ -103,7 +103,7 @@ export interface LocaleObserverResult<Strings extends GenericT9nStrings = Generi
103
103
  *
104
104
  * @remarks
105
105
  * Rather than using this function directly, prefer the
106
- * [useT9n()](https://qawebgis.esri.com/components/lumina/controllers/useT9n)
106
+ * [useT9n()](https://webgis.esri.com/references/lumina/controllers/useT9n)
107
107
  * controller.
108
108
  *
109
109
  * @example
@@ -2,7 +2,7 @@ declare const supportedLocalesArray: ["ar", "bg", "bs", "ca", "cs", "da", "de",
2
2
  /**
3
3
  * The list of supported locales for ArcGIS Maps SDK for JavaScript components.
4
4
  */
5
- export declare const supportedLocales: Set<"hr" | "th" | "tr" | "ar" | "bg" | "bs" | "ca" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "he" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "lv" | "nl" | "nb" | "no" | "pl" | "pt-BR" | "pt-PT" | "ro" | "ru" | "sk" | "sl" | "sr" | "sv" | "uk" | "vi" | "zh-CN" | "zh-HK" | "zh-TW">;
5
+ export declare const supportedLocales: Set<"hr" | "th" | "tr" | "el" | "ar" | "bg" | "bs" | "ca" | "cs" | "da" | "de" | "en" | "es" | "et" | "fi" | "fr" | "he" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "lv" | "nl" | "nb" | "no" | "pl" | "pt-BR" | "pt-PT" | "ro" | "ru" | "sk" | "sl" | "sr" | "sv" | "uk" | "vi" | "zh-CN" | "zh-HK" | "zh-TW">;
6
6
  /**
7
7
  * TypeScript union type for each locale supported by WebGIS SDK
8
8
  */
@@ -23,7 +23,7 @@ export declare const defaultLocale = "en";
23
23
  *
24
24
  * @remarks
25
25
  * Rather than using this function directly, prefer the
26
- * [useT9n()](https://qawebgis.esri.com/components/lumina/controllers/useT9n)
26
+ * [useT9n()](https://webgis.esri.com/references/lumina/controllers/useT9n)
27
27
  * controller.
28
28
  *
29
29
  * @remarks
@@ -39,7 +39,7 @@ export declare const defaultLocale = "en";
39
39
  * );
40
40
  * ```
41
41
  *
42
- * @see [Lumina asset handling](https://qawebgis.esri.com/components/lumina/assets)
42
+ * @see [Lumina asset handling](https://webgis.esri.com/references/lumina/assets)
43
43
  */
44
44
  export declare const fetchT9nStringsBundle: <Strings extends GenericT9nStrings>(locale: string, assetsPath: string, prefix?: string) => Promise<Strings>;
45
45
  /**
@@ -55,7 +55,7 @@ export interface GenericT9nStrings {
55
55
  *
56
56
  * @returns an object with the `lang` and `t9nLocale` properties.
57
57
  *
58
- * @see [lang vs t9nLocale](https://qawebgis.esri.com/components/lumina/controllers/useT9n#difference-between-lang-and-t9nlocale).
58
+ * @see [lang vs t9nLocale](https://webgis.esri.com/references/lumina/controllers/useT9n#difference-between-lang-and-t9nlocale).
59
59
  */
60
60
  export declare const getElementLocale: (element: HTMLElement) => {
61
61
  readonly lang: string;
@@ -103,7 +103,7 @@ export interface LocaleObserverResult<Strings extends GenericT9nStrings = Generi
103
103
  *
104
104
  * @remarks
105
105
  * Rather than using this function directly, prefer the
106
- * [useT9n()](https://qawebgis.esri.com/components/lumina/controllers/useT9n)
106
+ * [useT9n()](https://webgis.esri.com/references/lumina/controllers/useT9n)
107
107
  * controller.
108
108
  *
109
109
  * @example
@@ -1,4 +1,5 @@
1
1
  import { getElementAttribute, observeAncestorsMutation } from "../dom/index.js";
2
+ import { log } from "../log/index.js";
2
3
  const supportedLocalesArray = "ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(
3
4
  ","
4
5
  );
@@ -38,12 +39,14 @@ const fetchBundle = async (locale, path) => {
38
39
  if (process.env.NODE_ENV !== "production") {
39
40
  const is404ViteFallback = String(error).includes(`Unexpected token '<', "<!doctype "... is not valid JSON`);
40
41
  if (is404ViteFallback) {
41
- console.error(`[404] Localization strings not found at ${filePath}`);
42
+ log("error", "intl", `Localization strings not found at ${filePath}`);
42
43
  } else {
43
- console.error(`Error fetching localization strings at ${filePath}`, error);
44
+ log("error", "intl", `Error fetching localization strings at ${filePath}`, { detail: { error } });
44
45
  }
45
46
  } else {
46
- console.error(error);
47
+ log("error", "intl", `An unknown error occurred while fetching localization strings at ${filePath}`, {
48
+ detail: { error }
49
+ });
47
50
  }
48
51
  return {};
49
52
  }
@@ -79,7 +82,9 @@ const startLocaleObserver = (element, getAssetsPath, onUpdated, assetName) => {
79
82
  onUpdated(newResult);
80
83
  }
81
84
  result = newResult;
82
- }).catch(console.error);
85
+ }).catch((error) => {
86
+ log("error", "intl", "Error updating component locale state", { detail: { error } });
87
+ });
83
88
  queueMicrotask(callback);
84
89
  return observeAncestorsMutation(element, ["lang"], callback);
85
90
  };
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const loggedMessages = /* @__PURE__ */ new Set();
4
+ let esriConfig;
5
+ const setEsriConfig = (config) => {
6
+ esriConfig = config;
7
+ };
8
+ const getContextString = (context) => {
9
+ if (typeof context === "string") {
10
+ return context;
11
+ }
12
+ if ("el" in context) {
13
+ return context.el.localName;
14
+ }
15
+ if ("localName" in context) {
16
+ return context.localName;
17
+ }
18
+ return context.declaredClass;
19
+ };
20
+ const log = (level, context, message, options) => {
21
+ const contextString = getContextString(context);
22
+ if (options?.once) {
23
+ const key = `${level}${contextString}${message}`;
24
+ if (loggedMessages.has(key)) {
25
+ return;
26
+ }
27
+ loggedMessages.add(key);
28
+ }
29
+ let memorySafeDetail;
30
+ if (options?.detail) {
31
+ memorySafeDetail = {};
32
+ for (const [key, value] of Object.entries(options.detail)) {
33
+ if ((typeof value === "object" || typeof value === "function") && value !== null) {
34
+ const weakRefValue = new WeakRef(value);
35
+ Object.defineProperty(memorySafeDetail, key, {
36
+ get() {
37
+ return weakRefValue.deref();
38
+ }
39
+ });
40
+ } else {
41
+ memorySafeDetail[key] = value;
42
+ }
43
+ }
44
+ esriConfig?.log.interceptors?.forEach(
45
+ (interceptor) => interceptor(level, contextString, message, memorySafeDetail)
46
+ );
47
+ console[level](`[${contextString}]: ${message}`, memorySafeDetail);
48
+ } else {
49
+ esriConfig?.log.interceptors?.forEach((interceptor) => interceptor(level, contextString, message));
50
+ console[level](`[${contextString}]: ${message}`);
51
+ }
52
+ };
53
+ const rethrowError = (context) => {
54
+ const prefix = `[${getContextString(context)}] `;
55
+ return (error) => {
56
+ const errorToRethrow = error instanceof Error && error.message ? error : new Error(String(error));
57
+ errorToRethrow.message = `${prefix}${errorToRethrow.message}`;
58
+ setTimeout(() => {
59
+ throw error;
60
+ });
61
+ };
62
+ };
63
+ const composeMissingPropertyMessage = (property) => (
64
+ //#endregion composeMissingPropertyMessage
65
+ `The property \`${property.toString()}\` is required but missing.`
66
+ );
67
+ const composeEmptyPropertyMessage = (property) => (
68
+ //#endregion composeEmptyPropertyMessage
69
+ `The property \`${property.toString()}\` is empty but must have at least one element.`
70
+ );
71
+ const logDeprecatedProperty = (context, oldName, newName, options) => (
72
+ //#endregion logDeprecatedProperty
73
+ log("warn", context, `\`${oldName.toString()}\` is deprecated. Use \`${newName.toString()}\` instead.`, options)
74
+ );
75
+ exports.composeEmptyPropertyMessage = composeEmptyPropertyMessage;
76
+ exports.composeMissingPropertyMessage = composeMissingPropertyMessage;
77
+ exports.log = log;
78
+ exports.logDeprecatedProperty = logDeprecatedProperty;
79
+ exports.rethrowError = rethrowError;
80
+ exports.setEsriConfig = setEsriConfig;
@@ -0,0 +1,128 @@
1
+ export type LogLevel = "error" | "info" | "warn";
2
+ type CustomElementLike = {
3
+ el: {
4
+ localName: string;
5
+ };
6
+ } | {
7
+ localName: string;
8
+ };
9
+ type AccessorLike = {
10
+ declaredClass: string;
11
+ };
12
+ export type LogContext = AccessorLike | CustomElementLike | string;
13
+ type LogOptions = {
14
+ /** Whether the message should only be logged once. */
15
+ once?: boolean;
16
+ /** Additional objects to log after `message`. Use this to avoid memory leaks when logging objects to the console. Each object value will be automatically wrapped in a `WeakRef` before logging so it can be garbage-collected. */
17
+ detail?: Record<string, unknown>;
18
+ };
19
+ type EsriConfig = {
20
+ log: {
21
+ /**
22
+ * @link {https://developers.arcgis.com/javascript/latest/references/core/config/#LogInterceptor}
23
+ */
24
+ interceptors?: ((level: LogLevel | "none", module: string, ...args: any[]) => void)[];
25
+ };
26
+ };
27
+ /**
28
+ * Workaround for setting {@link https://developers.arcgis.com/javascript/latest/references/core/config/#log log interceptors} and maintaining compatibility with {@link https://devtopia.esri.com/WebGIS/arcgis-websceneviewer-app/blob/8f0a1bbcf12d1193134d94589d9e187f0afa72fa/src/js/support/ApiLoggerInstrumentation.ts#L17 js-api's interceptor usage}.
29
+ * @see {@link https://devtopia.esri.com/WebGIS/arcgis-js-api/discussions/74935}
30
+ * @param config {@link https://developers.arcgis.com/javascript/latest/references/core/config/}
31
+ * @example
32
+ * ```ts
33
+ * // IMPORTANT: do this only in config.ts or another early-loaded module
34
+ * import esriConfig from "@arcgis/core/config.js";
35
+ * import { setEsriConfig } from "@arcgis/toolkit/log";
36
+ *
37
+ * setEsriConfig(esriConfig);
38
+ *
39
+ * // either here or in another file, you can add your interceptors
40
+ * // and they will be respected when log is called later on
41
+ * esriConfig.log.interceptors?.push(yourInterceptor);
42
+ * ```
43
+ */
44
+ export declare const setEsriConfig: (config: EsriConfig) => void;
45
+ /**
46
+ * Helper utility for logging messages in a consistent manner.
47
+ *
48
+ * @param level The log level
49
+ * @param context The context of the log message (e.g., `this` inside a Lit-like component, or just a custom string)
50
+ * @param message A custom message to log
51
+ * @param options Additional options for logging, such as to provide a context object
52
+ *
53
+ * @see [setEsriConfig](#setEsriConfig)
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * // Basic usage
58
+ * log("error", this, "message to log");
59
+ * ```
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * // Optional usage
64
+ * log("warn", this, "message to log", {
65
+ * once: true,
66
+ * detail: { object1, object2 }
67
+ * });
68
+ */
69
+ export declare const log: (level: LogLevel, context: LogContext, message: string, options?: LogOptions) => void;
70
+ /**
71
+ * Rethrows an error and prepends context information to the error message. The error is
72
+ * thrown asynchronously to avoid interrupting the current execution stack, so it cannot be caught
73
+ * with `try/catch` and will bubble to the global object.
74
+ * @param context From where the error is being thrown (e.g., `this` inside a Lit-like component, or just a custom string)
75
+ * @returns A function that can be used in `try-catch`/`.catch` to rethrow an error
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * try {
80
+ * functionThatMightThrow();
81
+ * } catch (error) {
82
+ * rethrowError(this)(error);
83
+ * }
84
+ * ```
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * promise.then().catch(rethrowError("context string"));
89
+ * ```
90
+ */
91
+ export declare const rethrowError: (context: LogContext) => ((error: unknown) => void);
92
+ type LogContextOrObject = Exclude<LogContext, string> | object;
93
+ type InferPropertyType<T extends LogContextOrObject> = [object] extends [T] ? string : keyof T;
94
+ /**
95
+ * Returns a string that can be used in log messages for missing required properties.
96
+ * @param property The name of the required property
97
+ * @example
98
+ * ```ts
99
+ * // returns "The property `x` is required but missing."
100
+ * composeMissingPropertyMessage<YourClass>("x");
101
+ * // you don't need to provide a generic type argument if you don't have one
102
+ * composeMissingPropertyMessage("object.sub.property");
103
+ * ```
104
+ */
105
+ export declare const composeMissingPropertyMessage: <T extends LogContextOrObject = object>(property: InferPropertyType<T>) => string;
106
+ /**
107
+ * Returns a string that can be used in log messages for empty required arrays.
108
+ * @param property The name of the required property
109
+ * @example
110
+ * ```ts
111
+ * // returns "The property `x` is empty but must have at least one element."
112
+ * composeEmptyPropertyMessage<YourClass>("x");
113
+ * // you don't need to provide a generic type argument if you don't have one
114
+ * composeEmptyPropertyMessage("object.sub.property");
115
+ * ```
116
+ */
117
+ export declare const composeEmptyPropertyMessage: <T extends LogContextOrObject = object>(property: InferPropertyType<T>) => string;
118
+ /**
119
+ * Logs a warning message for deprecated object properties.
120
+ * @example
121
+ * ```ts
122
+ * logDeprecatedProperty(this, "oldName", "newName", {
123
+ * once: true,
124
+ * });
125
+ * ```
126
+ */
127
+ export declare const logDeprecatedProperty: <T extends LogContext>(context: T, oldName: keyof T, newName: keyof T, options?: LogOptions) => ReturnType<typeof log>;
128
+ export {};
@@ -0,0 +1,128 @@
1
+ export type LogLevel = "error" | "info" | "warn";
2
+ type CustomElementLike = {
3
+ el: {
4
+ localName: string;
5
+ };
6
+ } | {
7
+ localName: string;
8
+ };
9
+ type AccessorLike = {
10
+ declaredClass: string;
11
+ };
12
+ export type LogContext = AccessorLike | CustomElementLike | string;
13
+ type LogOptions = {
14
+ /** Whether the message should only be logged once. */
15
+ once?: boolean;
16
+ /** Additional objects to log after `message`. Use this to avoid memory leaks when logging objects to the console. Each object value will be automatically wrapped in a `WeakRef` before logging so it can be garbage-collected. */
17
+ detail?: Record<string, unknown>;
18
+ };
19
+ type EsriConfig = {
20
+ log: {
21
+ /**
22
+ * @link {https://developers.arcgis.com/javascript/latest/references/core/config/#LogInterceptor}
23
+ */
24
+ interceptors?: ((level: LogLevel | "none", module: string, ...args: any[]) => void)[];
25
+ };
26
+ };
27
+ /**
28
+ * Workaround for setting {@link https://developers.arcgis.com/javascript/latest/references/core/config/#log log interceptors} and maintaining compatibility with {@link https://devtopia.esri.com/WebGIS/arcgis-websceneviewer-app/blob/8f0a1bbcf12d1193134d94589d9e187f0afa72fa/src/js/support/ApiLoggerInstrumentation.ts#L17 js-api's interceptor usage}.
29
+ * @see {@link https://devtopia.esri.com/WebGIS/arcgis-js-api/discussions/74935}
30
+ * @param config {@link https://developers.arcgis.com/javascript/latest/references/core/config/}
31
+ * @example
32
+ * ```ts
33
+ * // IMPORTANT: do this only in config.ts or another early-loaded module
34
+ * import esriConfig from "@arcgis/core/config.js";
35
+ * import { setEsriConfig } from "@arcgis/toolkit/log";
36
+ *
37
+ * setEsriConfig(esriConfig);
38
+ *
39
+ * // either here or in another file, you can add your interceptors
40
+ * // and they will be respected when log is called later on
41
+ * esriConfig.log.interceptors?.push(yourInterceptor);
42
+ * ```
43
+ */
44
+ export declare const setEsriConfig: (config: EsriConfig) => void;
45
+ /**
46
+ * Helper utility for logging messages in a consistent manner.
47
+ *
48
+ * @param level The log level
49
+ * @param context The context of the log message (e.g., `this` inside a Lit-like component, or just a custom string)
50
+ * @param message A custom message to log
51
+ * @param options Additional options for logging, such as to provide a context object
52
+ *
53
+ * @see [setEsriConfig](#setEsriConfig)
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * // Basic usage
58
+ * log("error", this, "message to log");
59
+ * ```
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * // Optional usage
64
+ * log("warn", this, "message to log", {
65
+ * once: true,
66
+ * detail: { object1, object2 }
67
+ * });
68
+ */
69
+ export declare const log: (level: LogLevel, context: LogContext, message: string, options?: LogOptions) => void;
70
+ /**
71
+ * Rethrows an error and prepends context information to the error message. The error is
72
+ * thrown asynchronously to avoid interrupting the current execution stack, so it cannot be caught
73
+ * with `try/catch` and will bubble to the global object.
74
+ * @param context From where the error is being thrown (e.g., `this` inside a Lit-like component, or just a custom string)
75
+ * @returns A function that can be used in `try-catch`/`.catch` to rethrow an error
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * try {
80
+ * functionThatMightThrow();
81
+ * } catch (error) {
82
+ * rethrowError(this)(error);
83
+ * }
84
+ * ```
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * promise.then().catch(rethrowError("context string"));
89
+ * ```
90
+ */
91
+ export declare const rethrowError: (context: LogContext) => ((error: unknown) => void);
92
+ type LogContextOrObject = Exclude<LogContext, string> | object;
93
+ type InferPropertyType<T extends LogContextOrObject> = [object] extends [T] ? string : keyof T;
94
+ /**
95
+ * Returns a string that can be used in log messages for missing required properties.
96
+ * @param property The name of the required property
97
+ * @example
98
+ * ```ts
99
+ * // returns "The property `x` is required but missing."
100
+ * composeMissingPropertyMessage<YourClass>("x");
101
+ * // you don't need to provide a generic type argument if you don't have one
102
+ * composeMissingPropertyMessage("object.sub.property");
103
+ * ```
104
+ */
105
+ export declare const composeMissingPropertyMessage: <T extends LogContextOrObject = object>(property: InferPropertyType<T>) => string;
106
+ /**
107
+ * Returns a string that can be used in log messages for empty required arrays.
108
+ * @param property The name of the required property
109
+ * @example
110
+ * ```ts
111
+ * // returns "The property `x` is empty but must have at least one element."
112
+ * composeEmptyPropertyMessage<YourClass>("x");
113
+ * // you don't need to provide a generic type argument if you don't have one
114
+ * composeEmptyPropertyMessage("object.sub.property");
115
+ * ```
116
+ */
117
+ export declare const composeEmptyPropertyMessage: <T extends LogContextOrObject = object>(property: InferPropertyType<T>) => string;
118
+ /**
119
+ * Logs a warning message for deprecated object properties.
120
+ * @example
121
+ * ```ts
122
+ * logDeprecatedProperty(this, "oldName", "newName", {
123
+ * once: true,
124
+ * });
125
+ * ```
126
+ */
127
+ export declare const logDeprecatedProperty: <T extends LogContext>(context: T, oldName: keyof T, newName: keyof T, options?: LogOptions) => ReturnType<typeof log>;
128
+ export {};
@@ -0,0 +1,80 @@
1
+ const loggedMessages = /* @__PURE__ */ new Set();
2
+ let esriConfig;
3
+ const setEsriConfig = (config) => {
4
+ esriConfig = config;
5
+ };
6
+ const getContextString = (context) => {
7
+ if (typeof context === "string") {
8
+ return context;
9
+ }
10
+ if ("el" in context) {
11
+ return context.el.localName;
12
+ }
13
+ if ("localName" in context) {
14
+ return context.localName;
15
+ }
16
+ return context.declaredClass;
17
+ };
18
+ const log = (level, context, message, options) => {
19
+ const contextString = getContextString(context);
20
+ if (options?.once) {
21
+ const key = `${level}${contextString}${message}`;
22
+ if (loggedMessages.has(key)) {
23
+ return;
24
+ }
25
+ loggedMessages.add(key);
26
+ }
27
+ let memorySafeDetail;
28
+ if (options?.detail) {
29
+ memorySafeDetail = {};
30
+ for (const [key, value] of Object.entries(options.detail)) {
31
+ if ((typeof value === "object" || typeof value === "function") && value !== null) {
32
+ const weakRefValue = new WeakRef(value);
33
+ Object.defineProperty(memorySafeDetail, key, {
34
+ get() {
35
+ return weakRefValue.deref();
36
+ }
37
+ });
38
+ } else {
39
+ memorySafeDetail[key] = value;
40
+ }
41
+ }
42
+ esriConfig?.log.interceptors?.forEach(
43
+ (interceptor) => interceptor(level, contextString, message, memorySafeDetail)
44
+ );
45
+ console[level](`[${contextString}]: ${message}`, memorySafeDetail);
46
+ } else {
47
+ esriConfig?.log.interceptors?.forEach((interceptor) => interceptor(level, contextString, message));
48
+ console[level](`[${contextString}]: ${message}`);
49
+ }
50
+ };
51
+ const rethrowError = (context) => {
52
+ const prefix = `[${getContextString(context)}] `;
53
+ return (error) => {
54
+ const errorToRethrow = error instanceof Error && error.message ? error : new Error(String(error));
55
+ errorToRethrow.message = `${prefix}${errorToRethrow.message}`;
56
+ setTimeout(() => {
57
+ throw error;
58
+ });
59
+ };
60
+ };
61
+ const composeMissingPropertyMessage = (property) => (
62
+ //#endregion composeMissingPropertyMessage
63
+ `The property \`${property.toString()}\` is required but missing.`
64
+ );
65
+ const composeEmptyPropertyMessage = (property) => (
66
+ //#endregion composeEmptyPropertyMessage
67
+ `The property \`${property.toString()}\` is empty but must have at least one element.`
68
+ );
69
+ const logDeprecatedProperty = (context, oldName, newName, options) => (
70
+ //#endregion logDeprecatedProperty
71
+ log("warn", context, `\`${oldName.toString()}\` is deprecated. Use \`${newName.toString()}\` instead.`, options)
72
+ );
73
+ export {
74
+ composeEmptyPropertyMessage,
75
+ composeMissingPropertyMessage,
76
+ log,
77
+ logDeprecatedProperty,
78
+ rethrowError,
79
+ setEsriConfig
80
+ };
@@ -1,4 +1,4 @@
1
- import { nil } from '../type';
1
+ import { nil } from '../type/index.ts';
2
2
  /**
3
3
  * Safeguard to ensure that an item is not undefined.
4
4
  * @param item The item to check.
@@ -1,4 +1,4 @@
1
- import { nil } from '../type';
1
+ import { nil } from '../type/index.ts';
2
2
  /**
3
3
  * Safeguard to ensure that an item is not undefined.
4
4
  * @param item The item to check.
@@ -72,9 +72,7 @@ const getMinorVersion = (version) => {
72
72
  };
73
73
  const getPreamble = (version) => (
74
74
  //#endregion getPreamble
75
- `All material copyright Esri, All Rights Reserved, unless otherwise specified.
76
- See https://js.arcgis.com/${getMinorVersion(version)}/esri/copyright.txt for details.
77
- v${version}`
75
+ `COPYRIGHT Esri - https://js.arcgis.com/${getMinorVersion(version)}/LICENSE.txt`
78
76
  );
79
77
  const setValuesInString = (message, values = {}) => (message ?? "").replace(/\{(?<valueName>.*?)\}/gu, (match, valueName) => values[valueName] ?? match);
80
78
  exports.addLtrMark = addLtrMark;
@@ -42,7 +42,7 @@ export declare const quoteString: (value: string) => string;
42
42
  * Create a filter expression from a filter word.
43
43
  *
44
44
  * @remarks Once browser support permits, use `RegExp.escape()` instead.
45
- * @todo DEPRECATE
45
+ * @privateRemarks TODO: DEPRECATE
46
46
  */
47
47
  export declare const createFilterExpression: (filterWord: string) => RegExp;
48
48
  /**
@@ -88,12 +88,12 @@ export declare const getMinorVersion: (version: string) => string;
88
88
  * notice at the top of a file.
89
89
  * The preamble text contains the version number and a link to the license.
90
90
  * The version number should normally come from package.json.
91
+ *
92
+ * @see https://webgis.esri.com/webgis/platform-guidelines/licensing
91
93
  * @example
92
94
  * ```ts
93
- * const preamble = getPreamble("4.34.0-next.123");
94
- * // All material copyright Esri, All Rights Reserved, unless otherwise specified.
95
- * // See https://js.arcgis.com/4.34/esri/copyright.txt for details.
96
- * // v4.34.0-next.123
95
+ * const preamble = getPreamble("5.0.1-next.456");
96
+ * // COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt
97
97
  * ```
98
98
  */
99
99
  export declare const getPreamble: (version: string) => string;
@@ -101,6 +101,6 @@ export declare const getPreamble: (version: string) => string;
101
101
  * Replace values in a string using the format {valueName} with the value from the values object.
102
102
  * If the value is not found in the values object, then the value is not replaced.
103
103
  *
104
- * @deprecated Import from https://next.gha.afd.arcgis.com/javascript/latest/api-reference/esri-intl.html#substitute instead
104
+ * @deprecated Import from https://next.gha.afd.arcgis.com/javascript/latest/references/core/intl/#substitute instead
105
105
  */
106
106
  export declare const setValuesInString: (message: string | null | undefined, values?: Record<string, string>) => string;
@@ -42,7 +42,7 @@ export declare const quoteString: (value: string) => string;
42
42
  * Create a filter expression from a filter word.
43
43
  *
44
44
  * @remarks Once browser support permits, use `RegExp.escape()` instead.
45
- * @todo DEPRECATE
45
+ * @privateRemarks TODO: DEPRECATE
46
46
  */
47
47
  export declare const createFilterExpression: (filterWord: string) => RegExp;
48
48
  /**
@@ -88,12 +88,12 @@ export declare const getMinorVersion: (version: string) => string;
88
88
  * notice at the top of a file.
89
89
  * The preamble text contains the version number and a link to the license.
90
90
  * The version number should normally come from package.json.
91
+ *
92
+ * @see https://webgis.esri.com/webgis/platform-guidelines/licensing
91
93
  * @example
92
94
  * ```ts
93
- * const preamble = getPreamble("4.34.0-next.123");
94
- * // All material copyright Esri, All Rights Reserved, unless otherwise specified.
95
- * // See https://js.arcgis.com/4.34/esri/copyright.txt for details.
96
- * // v4.34.0-next.123
95
+ * const preamble = getPreamble("5.0.1-next.456");
96
+ * // COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt
97
97
  * ```
98
98
  */
99
99
  export declare const getPreamble: (version: string) => string;
@@ -101,6 +101,6 @@ export declare const getPreamble: (version: string) => string;
101
101
  * Replace values in a string using the format {valueName} with the value from the values object.
102
102
  * If the value is not found in the values object, then the value is not replaced.
103
103
  *
104
- * @deprecated Import from https://next.gha.afd.arcgis.com/javascript/latest/api-reference/esri-intl.html#substitute instead
104
+ * @deprecated Import from https://next.gha.afd.arcgis.com/javascript/latest/references/core/intl/#substitute instead
105
105
  */
106
106
  export declare const setValuesInString: (message: string | null | undefined, values?: Record<string, string>) => string;
@@ -70,9 +70,7 @@ const getMinorVersion = (version) => {
70
70
  };
71
71
  const getPreamble = (version) => (
72
72
  //#endregion getPreamble
73
- `All material copyright Esri, All Rights Reserved, unless otherwise specified.
74
- See https://js.arcgis.com/${getMinorVersion(version)}/esri/copyright.txt for details.
75
- v${version}`
73
+ `COPYRIGHT Esri - https://js.arcgis.com/${getMinorVersion(version)}/LICENSE.txt`
76
74
  );
77
75
  const setValuesInString = (message, values = {}) => (message ?? "").replace(/\{(?<valueName>.*?)\}/gu, (match, valueName) => values[valueName] ?? match);
78
76
  export {
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const typeTest = 0;
4
+ exports.typeTest = typeTest;
@@ -13,3 +13,17 @@ export type IHandle = {
13
13
  * @deprecated Import type { nil } from `@arcgis/toolkit/type` instead
14
14
  */
15
15
  export type Nil = nil;
16
+ /**
17
+ * A helper for doing TypeScript type tests.
18
+ * This complements the TypeScript's `satisfies` operator.
19
+ *
20
+ * See usage examples:
21
+ * https://webgis.esri.com/webgis/additional-resources/typescript-tips#use-satisfies-operator-for-type-tests
22
+ *
23
+ * During production end-application build, such type tests will be removed as
24
+ * they have no runtime impact.
25
+ *
26
+ * @privateRemarks
27
+ * Using `0` over `undefined` to take fewer bytes if minifier is disabled.
28
+ */
29
+ export declare const typeTest: unknown;
@@ -13,3 +13,17 @@ export type IHandle = {
13
13
  * @deprecated Import type { nil } from `@arcgis/toolkit/type` instead
14
14
  */
15
15
  export type Nil = nil;
16
+ /**
17
+ * A helper for doing TypeScript type tests.
18
+ * This complements the TypeScript's `satisfies` operator.
19
+ *
20
+ * See usage examples:
21
+ * https://webgis.esri.com/webgis/additional-resources/typescript-tips#use-satisfies-operator-for-type-tests
22
+ *
23
+ * During production end-application build, such type tests will be removed as
24
+ * they have no runtime impact.
25
+ *
26
+ * @privateRemarks
27
+ * Using `0` over `undefined` to take fewer bytes if minifier is disabled.
28
+ */
29
+ export declare const typeTest: unknown;
@@ -0,0 +1,4 @@
1
+ const typeTest = 0;
2
+ export {
3
+ typeTest
4
+ };
@@ -13,6 +13,6 @@ export declare const hasSameOrigin: (url1: string | null | undefined, url2: stri
13
13
  * @returns True if the string is a URL.
14
14
  *
15
15
  * @remarks If browser support permits, use https://developer.mozilla.org/en-US/docs/Web/API/URL/parse_static instead
16
- * @todo DEPRECATE
16
+ * @privateRemarks TODO: DEPRECATE
17
17
  */
18
18
  export declare const isURL: (url: string) => boolean;
@@ -13,6 +13,6 @@ export declare const hasSameOrigin: (url1: string | null | undefined, url2: stri
13
13
  * @returns True if the string is a URL.
14
14
  *
15
15
  * @remarks If browser support permits, use https://developer.mozilla.org/en-US/docs/Web/API/URL/parse_static instead
16
- * @todo DEPRECATE
16
+ * @privateRemarks TODO: DEPRECATE
17
17
  */
18
18
  export declare const isURL: (url: string) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/toolkit",
3
- "version": "5.0.0-next.17",
3
+ "version": "5.0.0-next.170",
4
4
  "description": "Collection of common internal patterns and utilities for ArcGIS Maps SDK for JavaScript components.",
5
5
  "homepage": "https://developers.arcgis.com/javascript/latest/",
6
6
  "sideEffects": false,
@@ -31,6 +31,11 @@
31
31
  "import": "./dist/intl/index.js",
32
32
  "require": "./dist/intl/index.cjs"
33
33
  },
34
+ "./log": {
35
+ "types": "./dist/log/index.d.ts",
36
+ "import": "./dist/log/index.js",
37
+ "require": "./dist/log/index.cjs"
38
+ },
34
39
  "./number": {
35
40
  "types": "./dist/number/index.d.ts",
36
41
  "import": "./dist/number/index.js",
@@ -52,7 +57,9 @@
52
57
  "require": "./dist/string/index.cjs"
53
58
  },
54
59
  "./type": {
55
- "types": "./dist/type/index.d.ts"
60
+ "types": "./dist/type/index.d.ts",
61
+ "import": "./dist/type/index.js",
62
+ "require": "./dist/type/index.cjs"
56
63
  },
57
64
  "./url": {
58
65
  "types": "./dist/url/index.d.ts",