@alwatr/dedupe 1.1.6 → 1.1.8

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.8](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.7...@alwatr/dedupe@1.1.8) (2024-11-02)
7
+
8
+ **Note:** Version bump only for package @alwatr/dedupe
9
+
10
+ ## [1.1.7](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.6...@alwatr/dedupe@1.1.7) (2024-10-25)
11
+
12
+ **Note:** Version bump only for package @alwatr/dedupe
13
+
6
14
  ## [1.1.6](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.5...@alwatr/dedupe@1.1.6) (2024-10-12)
7
15
 
8
16
  **Note:** Version bump only for package @alwatr/dedupe
@@ -11,18 +19,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
19
 
12
20
  ### Bug Fixes
13
21
 
14
- * use new `global-this` package & remove global type ([63f5a3b](https://github.com/Alwatr/nanolib/commit/63f5a3b07f6d73d0c213cd893a382d5bfe1c4c34)) by @mohammadhonarvar
22
+ - use new `global-this` package & remove global type ([63f5a3b](https://github.com/Alwatr/nanolib/commit/63f5a3b07f6d73d0c213cd893a382d5bfe1c4c34)) by @mohammadhonarvar
15
23
 
16
24
  ### Code Refactoring
17
25
 
18
- * prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @mohammadhonarvar
19
- * use new `global-this` package ([42510b9](https://github.com/Alwatr/nanolib/commit/42510b9ae0e385206a902db093d188949f1cb84e)) by @mohammadhonarvar
26
+ - prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @mohammadhonarvar
27
+ - use new `global-this` package ([42510b9](https://github.com/Alwatr/nanolib/commit/42510b9ae0e385206a902db093d188949f1cb84e)) by @mohammadhonarvar
20
28
 
21
29
  ## [1.1.4](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.3...@alwatr/dedupe@1.1.4) (2024-10-11)
22
30
 
23
31
  ### Miscellaneous Chores
24
32
 
25
- * include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @AliMD
33
+ - include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @AliMD
26
34
 
27
35
  ## [1.1.3](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.2...@alwatr/dedupe@1.1.3) (2024-10-11)
28
36
 
@@ -32,7 +40,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
32
40
 
33
41
  ### Dependencies update
34
42
 
35
- * bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
43
+ - bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
36
44
 
37
45
  ## [1.1.1](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.0...@alwatr/dedupe@1.1.1) (2024-10-08)
38
46
 
@@ -42,29 +50,29 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
42
50
 
43
51
  ### Features
44
52
 
45
- * **dedupe:** add `definePackage` to use `deduplicate` for backward compatibility ([990b994](https://github.com/Alwatr/nanolib/commit/990b994ff7a633f6f337a5b96cdd82dc9638c0d6)) by @AliMD
46
- * **dedupe:** refactor & new api ([393d873](https://github.com/Alwatr/nanolib/commit/393d8730456749e88fc01b7680c025889de53f36)) by @mohammadhonarvar
53
+ - **dedupe:** add `definePackage` to use `deduplicate` for backward compatibility ([990b994](https://github.com/Alwatr/nanolib/commit/990b994ff7a633f6f337a5b96cdd82dc9638c0d6)) by @AliMD
54
+ - **dedupe:** refactor & new api ([393d873](https://github.com/Alwatr/nanolib/commit/393d8730456749e88fc01b7680c025889de53f36)) by @mohammadhonarvar
47
55
 
48
56
  ### Bug Fixes
49
57
 
50
- * all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @mohammadhonarvar
51
- * **dedupe:** add a missing `import` & use `__package_name__` ([1ebbe92](https://github.com/Alwatr/nanolib/commit/1ebbe926549ce11111a791f8d72c9d296597c803)) by @mohammadhonarvar
52
- * **dedupe:** update `demo` based on new API ([650f159](https://github.com/Alwatr/nanolib/commit/650f1591c754231ca7d0c36a9cf98384af30aa44)) by @mohammadhonarvar
58
+ - all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @mohammadhonarvar
59
+ - **dedupe:** add a missing `import` & use `__package_name__` ([1ebbe92](https://github.com/Alwatr/nanolib/commit/1ebbe926549ce11111a791f8d72c9d296597c803)) by @mohammadhonarvar
60
+ - **dedupe:** update `demo` based on new API ([650f159](https://github.com/Alwatr/nanolib/commit/650f1591c754231ca7d0c36a9cf98384af30aa44)) by @mohammadhonarvar
53
61
 
54
62
  ### Code Refactoring
55
63
 
56
- * update Dictionary type definitions ([c94cbc4](https://github.com/Alwatr/nanolib/commit/c94cbc4523864e2cc47828ccf5508b68945ac2b8)) by @AliMD
57
- * use new type-helper global types and remove all import types ([08b5d08](https://github.com/Alwatr/nanolib/commit/08b5d08c03c7c315382337239de0426462f384b8)) by @AliMD
64
+ - update Dictionary type definitions ([c94cbc4](https://github.com/Alwatr/nanolib/commit/c94cbc4523864e2cc47828ccf5508b68945ac2b8)) by @AliMD
65
+ - use new type-helper global types and remove all import types ([08b5d08](https://github.com/Alwatr/nanolib/commit/08b5d08c03c7c315382337239de0426462f384b8)) by @AliMD
58
66
 
59
67
  ### Miscellaneous Chores
60
68
 
61
- * **dedupe:** change the license to AGPL-3.0 ([f48165c](https://github.com/Alwatr/nanolib/commit/f48165c4cc9aa0bfc5cf433500fd3de3d45fc8ab)) by @ArmanAsadian
62
- * Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @AliMD
69
+ - **dedupe:** change the license to AGPL-3.0 ([f48165c](https://github.com/Alwatr/nanolib/commit/f48165c4cc9aa0bfc5cf433500fd3de3d45fc8ab)) by @ArmanAsadian
70
+ - Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @AliMD
63
71
 
64
72
  ### Dependencies update
65
73
 
66
- * bump @types/node ([3d80fed](https://github.com/Alwatr/nanolib/commit/3d80fedaf720af792feb060c2f81c737ebb84e11)) by @dependabot[bot]
67
- * **dedupe:** update ([ce988ec](https://github.com/Alwatr/nanolib/commit/ce988ec4cf0f4be8fa0fb026eae65c31acc7055e)) by @mohammadhonarvar
74
+ - bump @types/node ([3d80fed](https://github.com/Alwatr/nanolib/commit/3d80fedaf720af792feb060c2f81c737ebb84e11)) by @dependabot[bot]
75
+ - **dedupe:** update ([ce988ec](https://github.com/Alwatr/nanolib/commit/ce988ec4cf0f4be8fa0fb026eae65c31acc7055e)) by @mohammadhonarvar
68
76
 
69
77
  ## [1.0.14](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.13...@alwatr/dedupe@1.0.14) (2024-09-21)
70
78
 
@@ -74,42 +82,42 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
74
82
 
75
83
  ### Dependencies update
76
84
 
77
- * bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
78
- * update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @AliMD
85
+ - bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
86
+ - update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @AliMD
79
87
 
80
88
  ## [1.0.12](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.11...@alwatr/dedupe@1.0.12) (2024-08-31)
81
89
 
82
90
  ### Miscellaneous Chores
83
91
 
84
- * Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
92
+ - Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
85
93
 
86
94
  ## [1.0.11](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.10...@alwatr/dedupe@1.0.11) (2024-08-31)
87
95
 
88
96
  ### Bug Fixes
89
97
 
90
- * **dedupe:** duplicate_dedupe not work issue ([bdf6f52](https://github.com/Alwatr/nanolib/commit/bdf6f52bbb3730e6d791f5f1cba9a4ebe2510e34)) by @AliMD
98
+ - **dedupe:** duplicate_dedupe not work issue ([bdf6f52](https://github.com/Alwatr/nanolib/commit/bdf6f52bbb3730e6d791f5f1cba9a4ebe2510e34)) by @AliMD
91
99
 
92
100
  ### Code Refactoring
93
101
 
94
- * **dedupe:** prevent throw error on duplicate package and just log it ([9d2b657](https://github.com/Alwatr/nanolib/commit/9d2b6570616c63604b138f2df2e2166afe16c482)) by @AliMD
102
+ - **dedupe:** prevent throw error on duplicate package and just log it ([9d2b657](https://github.com/Alwatr/nanolib/commit/9d2b6570616c63604b138f2df2e2166afe16c482)) by @AliMD
95
103
 
96
104
  ## [1.0.10](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.9...@alwatr/dedupe@1.0.10) (2024-08-31)
97
105
 
98
106
  ### Dependencies update
99
107
 
100
- * update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @AliMD
108
+ - update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @AliMD
101
109
 
102
110
  ## [1.0.9](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.8...@alwatr/dedupe@1.0.9) (2024-07-04)
103
111
 
104
112
  ### Dependencies update
105
113
 
106
- * update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
114
+ - update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
107
115
 
108
116
  ## [1.0.8](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.7...@alwatr/dedupe@1.0.8) (2024-05-12)
109
117
 
110
118
  ### Dependencies update
111
119
 
112
- * upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @AliMD
120
+ - upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @AliMD
113
121
 
114
122
  ## [1.0.7](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.6...@alwatr/dedupe@1.0.7) (2024-04-25)
115
123
 
@@ -123,7 +131,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
123
131
 
124
132
  ### Miscellaneous Chores
125
133
 
126
- * **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @AliMD
134
+ - **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @AliMD
127
135
 
128
136
  ## [1.0.4](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.3...@alwatr/dedupe@1.0.4) (2024-01-24)
129
137
 
package/dist/main.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /* @alwatr/dedupe v1.1.6 */
1
+ /* @alwatr/dedupe v1.1.8 */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -28,21 +28,23 @@ module.exports = __toCommonJS(main_exports);
28
28
  var import_global_this = require("@alwatr/global-this");
29
29
  var import_package_tracer = require("@alwatr/package-tracer");
30
30
  var import_polyfill_has_own = require("@alwatr/polyfill-has-own");
31
- __dev_mode__: import_package_tracer.packageTracer.add("@alwatr/dedupe", "1.1.6");
31
+ __dev_mode__: import_package_tracer.packageTracer.add("@alwatr/dedupe", "1.1.8");
32
32
  var globalThis_ = (0, import_global_this.getGlobalThis)();
33
33
  if (typeof globalThis_.__alwatr_dedupe__ === "undefined") {
34
- globalThis_.__alwatr_dedupe__ = "1.1.6";
34
+ globalThis_.__alwatr_dedupe__ = "1.1.8";
35
35
  } else {
36
36
  if (globalThis_.__alwatr_dedupe__ === true) {
37
37
  globalThis_.__alwatr_dedupe__ = "1.0.x";
38
38
  }
39
- console.error(new Error("duplication_detected", {
40
- cause: {
41
- name: "@alwatr/dedupe",
42
- oldVersion: globalThis_.__alwatr_dedupe__,
43
- newVersion: "1.1.6"
44
- }
45
- }));
39
+ console.error(
40
+ new Error("duplication_detected", {
41
+ cause: {
42
+ name: "@alwatr/dedupe",
43
+ oldVersion: globalThis_.__alwatr_dedupe__,
44
+ newVersion: "1.1.8"
45
+ }
46
+ })
47
+ );
46
48
  }
47
49
  var list = {};
48
50
  function deduplicate(args) {
package/dist/main.cjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import {getGlobalThis} from '@alwatr/global-this';\nimport {packageTracer} from '@alwatr/package-tracer';\nimport '@alwatr/polyfill-has-own';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\nconst globalThis_ = getGlobalThis<{__alwatr_dedupe__: string | true}>();\n\nif (typeof globalThis_.__alwatr_dedupe__ === 'undefined') {\n globalThis_.__alwatr_dedupe__ = __package_version__;\n}\nelse {\n if (globalThis_.__alwatr_dedupe__ === true) {\n globalThis_.__alwatr_dedupe__ = '1.0.x';\n }\n\n console.error(new Error('duplication_detected', {\n cause: {\n name: __package_name__,\n oldVersion: globalThis_.__alwatr_dedupe__,\n newVersion: __package_version__\n },\n }));\n}\n\nconst list: DictionaryOpt<true> = {};\n\n/**\n * Prevent duplication in any entities like loading node packages.\n * @param name package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * deduplicate({name: __package_name__, strict: true});\n * ```\n */\nexport function deduplicate(args: {name: string, strict?: true}): void {\n if (Object.hasOwn(list, args.name)) {\n const error = new Error('duplication_detected', {\n cause: {\n name: args.name,\n },\n });\n\n if (args.strict) {\n throw error;\n }\n else {\n console.error(error);\n }\n }\n\n list[args.name] = true;\n}\n\ndeduplicate({name: __package_name__});\n\n/**\n * Old `definePackage` for backward compatibility.\n * @deprecated Use `deduplicate` instead.\n*/\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function definePackage(packageName: string, _?:string): void {\n console.warn('`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.');\n deduplicate({name: packageName});\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAC5B,4BAA4B;AAC5B,8BAAO;AAEP,aAAc,qCAAc,IAAI,kBAAkB,OAAmB;AAErE,IAAM,kBAAc,kCAAkD;AAEtE,IAAI,OAAO,YAAY,sBAAsB,aAAa;AACxD,cAAY,oBAAoB;AAClC,OACK;AACH,MAAI,YAAY,sBAAsB,MAAM;AAC1C,gBAAY,oBAAoB;AAAA,EAClC;AAEA,UAAQ,MAAM,IAAI,MAAM,wBAAwB;AAAA,IAC9C,OAAO;AAAA,MACL,MAAM;AAAA,MACN,YAAY,YAAY;AAAA,MACxB,YAAY;AAAA,IACd;AAAA,EACF,CAAC,CAAC;AACJ;AAEA,IAAM,OAA4B,CAAC;AAY5B,SAAS,YAAY,MAA2C;AACrE,MAAI,OAAO,OAAO,MAAM,KAAK,IAAI,GAAG;AAClC,UAAM,QAAQ,IAAI,MAAM,wBAAwB;AAAA,MAC9C,OAAO;AAAA,QACL,MAAM,KAAK;AAAA,MACb;AAAA,IACF,CAAC;AAED,QAAI,KAAK,QAAQ;AACf,YAAM;AAAA,IACR,OACK;AACH,cAAQ,MAAM,KAAK;AAAA,IACrB;AAAA,EACF;AAEA,OAAK,KAAK,IAAI,IAAI;AACpB;AAEA,YAAY,EAAC,MAAM,iBAAgB,CAAC;AAO7B,SAAS,cAAc,aAAqB,GAAiB;AAClE,UAAQ,KAAK,+EAA+E;AAC5F,cAAY,EAAC,MAAM,YAAW,CAAC;AACjC;",
4
+ "sourcesContent": ["import {getGlobalThis} from '@alwatr/global-this';\nimport {packageTracer} from '@alwatr/package-tracer';\nimport '@alwatr/polyfill-has-own';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\nconst globalThis_ = getGlobalThis<{__alwatr_dedupe__: string | true}>();\n\nif (typeof globalThis_.__alwatr_dedupe__ === 'undefined') {\n globalThis_.__alwatr_dedupe__ = __package_version__;\n}\nelse {\n if (globalThis_.__alwatr_dedupe__ === true) {\n globalThis_.__alwatr_dedupe__ = '1.0.x';\n }\n\n console.error(\n new Error('duplication_detected', {\n cause: {\n name: __package_name__,\n oldVersion: globalThis_.__alwatr_dedupe__,\n newVersion: __package_version__,\n },\n }),\n );\n}\n\nconst list: DictionaryOpt<true> = {};\n\n/**\n * Prevent duplication in any entities like loading node packages.\n * @param name package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * deduplicate({name: __package_name__, strict: true});\n * ```\n */\nexport function deduplicate(args: {name: string; strict?: true}): void {\n if (Object.hasOwn(list, args.name)) {\n const error = new Error('duplication_detected', {\n cause: {\n name: args.name,\n },\n });\n\n if (args.strict) {\n throw error;\n }\n else {\n console.error(error);\n }\n }\n\n list[args.name] = true;\n}\n\ndeduplicate({name: __package_name__});\n\n/**\n * Old `definePackage` for backward compatibility.\n * @deprecated Use `deduplicate` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function definePackage(packageName: string, _?: string): void {\n console.warn('`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.');\n deduplicate({name: packageName});\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAC5B,4BAA4B;AAC5B,8BAAO;AAEP,aAAc,qCAAc,IAAI,kBAAkB,OAAmB;AAErE,IAAM,kBAAc,kCAAkD;AAEtE,IAAI,OAAO,YAAY,sBAAsB,aAAa;AACxD,cAAY,oBAAoB;AAClC,OACK;AACH,MAAI,YAAY,sBAAsB,MAAM;AAC1C,gBAAY,oBAAoB;AAAA,EAClC;AAEA,UAAQ;AAAA,IACN,IAAI,MAAM,wBAAwB;AAAA,MAChC,OAAO;AAAA,QACL,MAAM;AAAA,QACN,YAAY,YAAY;AAAA,QACxB,YAAY;AAAA,MACd;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEA,IAAM,OAA4B,CAAC;AAY5B,SAAS,YAAY,MAA2C;AACrE,MAAI,OAAO,OAAO,MAAM,KAAK,IAAI,GAAG;AAClC,UAAM,QAAQ,IAAI,MAAM,wBAAwB;AAAA,MAC9C,OAAO;AAAA,QACL,MAAM,KAAK;AAAA,MACb;AAAA,IACF,CAAC;AAED,QAAI,KAAK,QAAQ;AACf,YAAM;AAAA,IACR,OACK;AACH,cAAQ,MAAM,KAAK;AAAA,IACrB;AAAA,EACF;AAEA,OAAK,KAAK,IAAI,IAAI;AACpB;AAEA,YAAY,EAAC,MAAM,iBAAgB,CAAC;AAO7B,SAAS,cAAc,aAAqB,GAAkB;AACnE,UAAQ,KAAK,+EAA+E;AAC5F,cAAY,EAAC,MAAM,YAAW,CAAC;AACjC;",
6
6
  "names": []
7
7
  }
package/dist/main.d.ts CHANGED
@@ -16,6 +16,6 @@ export declare function deduplicate(args: {
16
16
  /**
17
17
  * Old `definePackage` for backward compatibility.
18
18
  * @deprecated Use `deduplicate` instead.
19
- */
19
+ */
20
20
  export declare function definePackage(packageName: string, _?: string): void;
21
21
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA,OAAO,0BAA0B,CAAC;AAyBlC;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,IAAI,CAAA;CAAC,GAAG,IAAI,CAiBrE;AAID;;;EAGE;AAEF,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,EAAC,MAAM,GAAG,IAAI,CAGlE"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA,OAAO,0BAA0B,CAAC;AA2BlC;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,IAAI,CAAA;CAAC,GAAG,IAAI,CAiBrE;AAID;;;GAGG;AAEH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAGnE"}
package/dist/main.mjs CHANGED
@@ -1,24 +1,26 @@
1
- /* @alwatr/dedupe v1.1.6 */
1
+ /* @alwatr/dedupe v1.1.8 */
2
2
 
3
3
  // src/main.ts
4
4
  import { getGlobalThis } from "@alwatr/global-this";
5
5
  import { packageTracer } from "@alwatr/package-tracer";
6
6
  import "@alwatr/polyfill-has-own";
7
- __dev_mode__: packageTracer.add("@alwatr/dedupe", "1.1.6");
7
+ __dev_mode__: packageTracer.add("@alwatr/dedupe", "1.1.8");
8
8
  var globalThis_ = getGlobalThis();
9
9
  if (typeof globalThis_.__alwatr_dedupe__ === "undefined") {
10
- globalThis_.__alwatr_dedupe__ = "1.1.6";
10
+ globalThis_.__alwatr_dedupe__ = "1.1.8";
11
11
  } else {
12
12
  if (globalThis_.__alwatr_dedupe__ === true) {
13
13
  globalThis_.__alwatr_dedupe__ = "1.0.x";
14
14
  }
15
- console.error(new Error("duplication_detected", {
16
- cause: {
17
- name: "@alwatr/dedupe",
18
- oldVersion: globalThis_.__alwatr_dedupe__,
19
- newVersion: "1.1.6"
20
- }
21
- }));
15
+ console.error(
16
+ new Error("duplication_detected", {
17
+ cause: {
18
+ name: "@alwatr/dedupe",
19
+ oldVersion: globalThis_.__alwatr_dedupe__,
20
+ newVersion: "1.1.8"
21
+ }
22
+ })
23
+ );
22
24
  }
23
25
  var list = {};
24
26
  function deduplicate(args) {
package/dist/main.mjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import {getGlobalThis} from '@alwatr/global-this';\nimport {packageTracer} from '@alwatr/package-tracer';\nimport '@alwatr/polyfill-has-own';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\nconst globalThis_ = getGlobalThis<{__alwatr_dedupe__: string | true}>();\n\nif (typeof globalThis_.__alwatr_dedupe__ === 'undefined') {\n globalThis_.__alwatr_dedupe__ = __package_version__;\n}\nelse {\n if (globalThis_.__alwatr_dedupe__ === true) {\n globalThis_.__alwatr_dedupe__ = '1.0.x';\n }\n\n console.error(new Error('duplication_detected', {\n cause: {\n name: __package_name__,\n oldVersion: globalThis_.__alwatr_dedupe__,\n newVersion: __package_version__\n },\n }));\n}\n\nconst list: DictionaryOpt<true> = {};\n\n/**\n * Prevent duplication in any entities like loading node packages.\n * @param name package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * deduplicate({name: __package_name__, strict: true});\n * ```\n */\nexport function deduplicate(args: {name: string, strict?: true}): void {\n if (Object.hasOwn(list, args.name)) {\n const error = new Error('duplication_detected', {\n cause: {\n name: args.name,\n },\n });\n\n if (args.strict) {\n throw error;\n }\n else {\n console.error(error);\n }\n }\n\n list[args.name] = true;\n}\n\ndeduplicate({name: __package_name__});\n\n/**\n * Old `definePackage` for backward compatibility.\n * @deprecated Use `deduplicate` instead.\n*/\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function definePackage(packageName: string, _?:string): void {\n console.warn('`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.');\n deduplicate({name: packageName});\n}\n"],
5
- "mappings": ";;;AAAA,SAAQ,qBAAoB;AAC5B,SAAQ,qBAAoB;AAC5B,OAAO;AAEP,aAAc,eAAc,IAAI,kBAAkB,OAAmB;AAErE,IAAM,cAAc,cAAkD;AAEtE,IAAI,OAAO,YAAY,sBAAsB,aAAa;AACxD,cAAY,oBAAoB;AAClC,OACK;AACH,MAAI,YAAY,sBAAsB,MAAM;AAC1C,gBAAY,oBAAoB;AAAA,EAClC;AAEA,UAAQ,MAAM,IAAI,MAAM,wBAAwB;AAAA,IAC9C,OAAO;AAAA,MACL,MAAM;AAAA,MACN,YAAY,YAAY;AAAA,MACxB,YAAY;AAAA,IACd;AAAA,EACF,CAAC,CAAC;AACJ;AAEA,IAAM,OAA4B,CAAC;AAY5B,SAAS,YAAY,MAA2C;AACrE,MAAI,OAAO,OAAO,MAAM,KAAK,IAAI,GAAG;AAClC,UAAM,QAAQ,IAAI,MAAM,wBAAwB;AAAA,MAC9C,OAAO;AAAA,QACL,MAAM,KAAK;AAAA,MACb;AAAA,IACF,CAAC;AAED,QAAI,KAAK,QAAQ;AACf,YAAM;AAAA,IACR,OACK;AACH,cAAQ,MAAM,KAAK;AAAA,IACrB;AAAA,EACF;AAEA,OAAK,KAAK,IAAI,IAAI;AACpB;AAEA,YAAY,EAAC,MAAM,iBAAgB,CAAC;AAO7B,SAAS,cAAc,aAAqB,GAAiB;AAClE,UAAQ,KAAK,+EAA+E;AAC5F,cAAY,EAAC,MAAM,YAAW,CAAC;AACjC;",
4
+ "sourcesContent": ["import {getGlobalThis} from '@alwatr/global-this';\nimport {packageTracer} from '@alwatr/package-tracer';\nimport '@alwatr/polyfill-has-own';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\nconst globalThis_ = getGlobalThis<{__alwatr_dedupe__: string | true}>();\n\nif (typeof globalThis_.__alwatr_dedupe__ === 'undefined') {\n globalThis_.__alwatr_dedupe__ = __package_version__;\n}\nelse {\n if (globalThis_.__alwatr_dedupe__ === true) {\n globalThis_.__alwatr_dedupe__ = '1.0.x';\n }\n\n console.error(\n new Error('duplication_detected', {\n cause: {\n name: __package_name__,\n oldVersion: globalThis_.__alwatr_dedupe__,\n newVersion: __package_version__,\n },\n }),\n );\n}\n\nconst list: DictionaryOpt<true> = {};\n\n/**\n * Prevent duplication in any entities like loading node packages.\n * @param name package name including scope. e.g. `@scope/package-name`\n * @param version package version (optional)\n *\n * @example\n * ```typescript\n * deduplicate({name: __package_name__, strict: true});\n * ```\n */\nexport function deduplicate(args: {name: string; strict?: true}): void {\n if (Object.hasOwn(list, args.name)) {\n const error = new Error('duplication_detected', {\n cause: {\n name: args.name,\n },\n });\n\n if (args.strict) {\n throw error;\n }\n else {\n console.error(error);\n }\n }\n\n list[args.name] = true;\n}\n\ndeduplicate({name: __package_name__});\n\n/**\n * Old `definePackage` for backward compatibility.\n * @deprecated Use `deduplicate` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function definePackage(packageName: string, _?: string): void {\n console.warn('`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.');\n deduplicate({name: packageName});\n}\n"],
5
+ "mappings": ";;;AAAA,SAAQ,qBAAoB;AAC5B,SAAQ,qBAAoB;AAC5B,OAAO;AAEP,aAAc,eAAc,IAAI,kBAAkB,OAAmB;AAErE,IAAM,cAAc,cAAkD;AAEtE,IAAI,OAAO,YAAY,sBAAsB,aAAa;AACxD,cAAY,oBAAoB;AAClC,OACK;AACH,MAAI,YAAY,sBAAsB,MAAM;AAC1C,gBAAY,oBAAoB;AAAA,EAClC;AAEA,UAAQ;AAAA,IACN,IAAI,MAAM,wBAAwB;AAAA,MAChC,OAAO;AAAA,QACL,MAAM;AAAA,QACN,YAAY,YAAY;AAAA,QACxB,YAAY;AAAA,MACd;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEA,IAAM,OAA4B,CAAC;AAY5B,SAAS,YAAY,MAA2C;AACrE,MAAI,OAAO,OAAO,MAAM,KAAK,IAAI,GAAG;AAClC,UAAM,QAAQ,IAAI,MAAM,wBAAwB;AAAA,MAC9C,OAAO;AAAA,QACL,MAAM,KAAK;AAAA,MACb;AAAA,IACF,CAAC;AAED,QAAI,KAAK,QAAQ;AACf,YAAM;AAAA,IACR,OACK;AACH,cAAQ,MAAM,KAAK;AAAA,IACrB;AAAA,EACF;AAEA,OAAK,KAAK,IAAI,IAAI;AACpB;AAEA,YAAY,EAAC,MAAM,iBAAgB,CAAC;AAO7B,SAAS,cAAc,aAAqB,GAAkB;AACnE,UAAQ,KAAK,+EAA+E;AAC5F,cAAY,EAAC,MAAM,YAAW,CAAC;AACjC;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwatr/dedupe",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "A package manager helper tool for debug list of defined (imported) packages in your ecosystem and prevent to duplicate import (install) multiple versions of the same package in your project (deduplicate packages).",
5
5
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
6
  "keywords": [
@@ -68,16 +68,16 @@
68
68
  "clean": "rm -rfv dist *.tsbuildinfo"
69
69
  },
70
70
  "dependencies": {
71
- "@alwatr/global-this": "^1.0.1",
72
- "@alwatr/package-tracer": "^1.0.6",
73
- "@alwatr/polyfill-has-own": "^1.1.6"
71
+ "@alwatr/global-this": "^1.0.3",
72
+ "@alwatr/package-tracer": "^1.0.8",
73
+ "@alwatr/polyfill-has-own": "^1.1.8"
74
74
  },
75
75
  "devDependencies": {
76
- "@alwatr/nano-build": "^2.0.2",
76
+ "@alwatr/nano-build": "^2.0.4",
77
77
  "@alwatr/prettier-config": "^1.0.6",
78
- "@alwatr/tsconfig-base": "^1.3.2",
79
- "@alwatr/type-helper": "^2.0.2",
78
+ "@alwatr/tsconfig-base": "^1.3.3",
79
+ "@alwatr/type-helper": "^2.0.3",
80
80
  "typescript": "^5.6.3"
81
81
  },
82
- "gitHead": "15d12342d2e69fbb6129675cce620132c5bd0bfc"
82
+ "gitHead": "5aecc962a161034aa9213dcc5fb3c1cece9eaca2"
83
83
  }