@arcgis/toolkit 4.34.0-next.61

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.
Files changed (43) hide show
  1. package/LICENSE.md +13 -0
  2. package/README.md +21 -0
  3. package/dist/array/index.cjs +12 -0
  4. package/dist/array/index.d.cts +12 -0
  5. package/dist/array/index.d.ts +12 -0
  6. package/dist/array/index.js +12 -0
  7. package/dist/dom/index.cjs +161 -0
  8. package/dist/dom/index.d.cts +115 -0
  9. package/dist/dom/index.d.ts +115 -0
  10. package/dist/dom/index.js +161 -0
  11. package/dist/error/index.cjs +36 -0
  12. package/dist/error/index.d.cts +32 -0
  13. package/dist/error/index.d.ts +32 -0
  14. package/dist/error/index.js +36 -0
  15. package/dist/function/index.cjs +16 -0
  16. package/dist/function/index.d.cts +19 -0
  17. package/dist/function/index.d.ts +19 -0
  18. package/dist/function/index.js +16 -0
  19. package/dist/intl/index.cjs +103 -0
  20. package/dist/intl/index.d.cts +121 -0
  21. package/dist/intl/index.d.ts +121 -0
  22. package/dist/intl/index.js +103 -0
  23. package/dist/predicate/index.cjs +8 -0
  24. package/dist/predicate/index.d.cts +24 -0
  25. package/dist/predicate/index.d.ts +24 -0
  26. package/dist/predicate/index.js +8 -0
  27. package/dist/promise/index.cjs +30 -0
  28. package/dist/promise/index.d.cts +46 -0
  29. package/dist/promise/index.d.ts +46 -0
  30. package/dist/promise/index.js +30 -0
  31. package/dist/string/index.cjs +91 -0
  32. package/dist/string/index.d.cts +102 -0
  33. package/dist/string/index.d.ts +102 -0
  34. package/dist/string/index.js +91 -0
  35. package/dist/tests/utils.d.cts +1 -0
  36. package/dist/tests/utils.d.ts +1 -0
  37. package/dist/type/index.d.cts +15 -0
  38. package/dist/type/index.d.ts +15 -0
  39. package/dist/url/index.cjs +26 -0
  40. package/dist/url/index.d.cts +18 -0
  41. package/dist/url/index.d.ts +18 -0
  42. package/dist/url/index.js +26 -0
  43. package/package.json +66 -0
@@ -0,0 +1,26 @@
1
+ const hasSameOrigin = (url1, url2, ignoreProtocol = false) => {
2
+ if (!url1 || !url2) {
3
+ return false;
4
+ }
5
+ const url1Obj = new URL(url1);
6
+ const url2Obj = new URL(url2);
7
+ if (!ignoreProtocol && url1Obj.protocol !== url2Obj.protocol) {
8
+ return false;
9
+ }
10
+ if (url1Obj.host == null || url2Obj.host == null) {
11
+ return false;
12
+ }
13
+ return url1Obj.host.toLowerCase() === url2Obj.host.toLowerCase() && url1Obj.port === url2Obj.port;
14
+ };
15
+ const isURL = (url) => {
16
+ try {
17
+ new URL(url);
18
+ return true;
19
+ } catch (e) {
20
+ return false;
21
+ }
22
+ };
23
+ export {
24
+ hasSameOrigin,
25
+ isURL
26
+ };
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@arcgis/toolkit",
3
+ "version": "4.34.0-next.61",
4
+ "description": "Collection of common internal patterns and utilities for ArcGIS Maps SDK for JavaScript components.",
5
+ "homepage": "https://developers.arcgis.com/javascript/latest/",
6
+ "sideEffects": false,
7
+ "type": "module",
8
+ "exports": {
9
+ "./array": {
10
+ "types": "./dist/array/index.d.ts",
11
+ "import": "./dist/array/index.js",
12
+ "require": "./dist/array/index.cjs"
13
+ },
14
+ "./dom": {
15
+ "types": "./dist/dom/index.d.ts",
16
+ "import": "./dist/dom/index.js",
17
+ "require": "./dist/dom/index.cjs"
18
+ },
19
+ "./error": {
20
+ "types": "./dist/error/index.d.ts",
21
+ "import": "./dist/error/index.js",
22
+ "require": "./dist/error/index.cjs"
23
+ },
24
+ "./function": {
25
+ "types": "./dist/function/index.d.ts",
26
+ "import": "./dist/function/index.js",
27
+ "require": "./dist/function/index.cjs"
28
+ },
29
+ "./intl": {
30
+ "types": "./dist/intl/index.d.ts",
31
+ "import": "./dist/intl/index.js",
32
+ "require": "./dist/intl/index.cjs"
33
+ },
34
+ "./predicate": {
35
+ "types": "./dist/predicate/index.d.ts",
36
+ "import": "./dist/predicate/index.js",
37
+ "require": "./dist/predicate/index.cjs"
38
+ },
39
+ "./promise": {
40
+ "types": "./dist/promise/index.d.ts",
41
+ "import": "./dist/promise/index.js",
42
+ "require": "./dist/promise/index.cjs"
43
+ },
44
+ "./string": {
45
+ "types": "./dist/string/index.d.ts",
46
+ "import": "./dist/string/index.js",
47
+ "require": "./dist/string/index.cjs"
48
+ },
49
+ "./type": {
50
+ "types": "./dist/type/index.d.ts"
51
+ },
52
+ "./url": {
53
+ "types": "./dist/url/index.d.ts",
54
+ "import": "./dist/url/index.js",
55
+ "require": "./dist/url/index.cjs"
56
+ },
57
+ "./package.json": "./package.json"
58
+ },
59
+ "files": [
60
+ "dist/"
61
+ ],
62
+ "license": "SEE LICENSE IN LICENSE.md",
63
+ "dependencies": {
64
+ "tslib": "^2.8.1"
65
+ }
66
+ }