@alwatr/dedupe 5.5.30 → 6.0.0

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/main.js ADDED
@@ -0,0 +1,5 @@
1
+ /* 📦 @alwatr/dedupe v6.0.0 */
2
+ import{getGlobalThis as B}from"@alwatr/global-this";import{hasOwn as C}from"@alwatr/has-own";var j=B();if(typeof j.__alwatr_dedupe__>"u")j.__alwatr_dedupe__="6.0.0";else{if(j.__alwatr_dedupe__===!0)j.__alwatr_dedupe__="1.0.x";console.error(Error("duplication_detected",{cause:{name:"@alwatr/dedupe",oldVersion:j.__alwatr_dedupe__,newVersion:"6.0.0"}}))}var z={};function A(f){if(C(z,f.name)){let q=Error("duplication_detected",{cause:{name:f.name}});if(f.strict)throw q;else console.error(q)}z[f.name]=!0}A({name:"@alwatr/dedupe"});function F(f,q){console.warn("`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead."),A({name:f})}export{F as definePackage,A as deduplicate};
3
+
4
+ //# debugId=4F08EE9CEE9B949164756E2164756E21
5
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/main.ts"],
4
+ "sourcesContent": [
5
+ "import {getGlobalThis} from '@alwatr/global-this';\nimport {hasOwn} from '@alwatr/has-own';\n\nimport type {} from '@alwatr/nano-build';\nimport type {} from '@alwatr/type-helper';\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 (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"
6
+ ],
7
+ "mappings": ";AAAA,wBAAQ,4BACR,iBAAQ,wBAKR,IAAM,EAAc,EAAkD,EAEtE,GAAI,OAAO,EAAY,kBAAsB,IAC3C,EAAY,kBAAoB,QAE7B,KACH,GAAI,EAAY,oBAAsB,GACpC,EAAY,kBAAoB,QAGlC,QAAQ,MACF,MAAM,uBAAwB,CAChC,MAAO,CACL,KAAM,iBACN,WAAY,EAAY,kBACxB,WAAY,OACd,CACF,CAAC,CACH,EAGF,IAAM,EAA4B,CAAC,EAY5B,SAAS,CAAW,CAAC,EAA2C,CACrE,GAAI,EAAO,EAAM,EAAK,IAAI,EAAG,CAC3B,IAAM,EAAY,MAAM,uBAAwB,CAC9C,MAAO,CACL,KAAM,EAAK,IACb,CACF,CAAC,EAED,GAAI,EAAK,OACP,MAAM,EAGN,aAAQ,MAAM,CAAK,EAIvB,EAAK,EAAK,MAAQ,GAGpB,EAAY,CAAC,KAAM,gBAAgB,CAAC,EAO7B,SAAS,CAAa,CAAC,EAAqB,EAAkB,CACnE,QAAQ,KAAK,+EAA+E,EAC5F,EAAY,CAAC,KAAM,CAAW,CAAC",
8
+ "debugId": "4F08EE9CEE9B949164756E2164756E21",
9
+ "names": []
10
+ }
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
1
  {
2
2
  "name": "@alwatr/dedupe",
3
3
  "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).",
4
- "version": "5.5.30",
4
+ "version": "6.0.0",
5
5
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
6
  "bugs": "https://github.com/Alwatr/nanolib/issues",
7
7
  "dependencies": {
8
- "@alwatr/global-this": "5.6.9",
9
- "@alwatr/has-own": "5.6.7"
8
+ "@alwatr/global-this": "6.0.0",
9
+ "@alwatr/has-own": "6.0.0"
10
10
  },
11
11
  "devDependencies": {
12
- "@alwatr/nano-build": "6.4.1",
13
- "@alwatr/prettier-config": "6.0.2",
14
- "@alwatr/tsconfig-base": "6.0.4",
15
- "@alwatr/type-helper": "7.0.1",
12
+ "@alwatr/nano-build": "7.0.0",
13
+ "@alwatr/prettier-config": "7.0.0",
14
+ "@alwatr/tsconfig-base": "7.0.0",
15
+ "@alwatr/type-helper": "8.0.0",
16
16
  "typescript": "^5.9.3"
17
17
  },
18
18
  "exports": {
19
19
  ".": {
20
20
  "types": "./dist/main.d.ts",
21
- "import": "./dist/main.mjs",
22
- "require": "./dist/main.cjs"
21
+ "default": "./dist/main.js"
23
22
  }
24
23
  },
25
24
  "files": [
26
- "**/*.{js,mjs,cjs,map,d.ts,html,md,LEGAL.txt}",
25
+ "**/*.{js,mjs,cjs,ts,map,d.ts,html,LEGAL.txt}",
26
+ "README.md",
27
27
  "LICENSE",
28
28
  "!demo/**/*",
29
29
  "!**/*.test.js"
@@ -50,8 +50,6 @@
50
50
  "utils"
51
51
  ],
52
52
  "license": "MPL-2.0",
53
- "main": "./dist/main.cjs",
54
- "module": "./dist/main.mjs",
55
53
  "prettier": "@alwatr/prettier-config",
56
54
  "publishConfig": {
57
55
  "access": "public"
@@ -62,21 +60,21 @@
62
60
  "directory": "packages/dedupe"
63
61
  },
64
62
  "scripts": {
65
- "b": "yarn run build",
66
- "build": "yarn run build:ts && yarn run build:es",
67
- "build:es": "nano-build --preset=module",
63
+ "b": "bun run build",
64
+ "build": "bun run build:ts && bun run build:es",
65
+ "build:es": "nano-build --preset=module src/main.ts",
68
66
  "build:ts": "tsc --build",
69
- "c": "yarn run clean",
70
- "cb": "yarn run clean && yarn run build",
67
+ "c": "bun run clean",
68
+ "cb": "bun run clean && bun run build",
71
69
  "clean": "rm -rfv dist *.tsbuildinfo",
72
- "d": "yarn run build:es && DEBUG=1 yarn node",
73
- "w": "yarn run watch",
74
- "watch": "yarn run watch:ts & yarn run watch:es",
75
- "watch:es": "yarn run build:es --watch",
76
- "watch:ts": "yarn run build:ts --watch --preserveWatchOutput"
70
+ "d": "bun run build:es && DEBUG=1 bun",
71
+ "w": "bun run watch",
72
+ "watch": "bun run watch:ts & bun run watch:es",
73
+ "watch:es": "bun run build:es --watch",
74
+ "watch:ts": "bun run build:ts --watch --preserveWatchOutput"
77
75
  },
78
76
  "sideEffects": true,
79
77
  "type": "module",
80
78
  "types": "./dist/main.d.ts",
81
- "gitHead": "f9f9ba54b319ce8ccc6968059b222e89f4b5d149"
79
+ "gitHead": "056102a1c8a563bbae8a290b6830450f467322a3"
82
80
  }
package/src/main.ts ADDED
@@ -0,0 +1,69 @@
1
+ import {getGlobalThis} from '@alwatr/global-this';
2
+ import {hasOwn} from '@alwatr/has-own';
3
+
4
+ import type {} from '@alwatr/nano-build';
5
+ import type {} from '@alwatr/type-helper';
6
+
7
+ const globalThis_ = getGlobalThis<{__alwatr_dedupe__: string | true}>();
8
+
9
+ if (typeof globalThis_.__alwatr_dedupe__ === 'undefined') {
10
+ globalThis_.__alwatr_dedupe__ = __package_version__;
11
+ }
12
+ else {
13
+ if (globalThis_.__alwatr_dedupe__ === true) {
14
+ globalThis_.__alwatr_dedupe__ = '1.0.x';
15
+ }
16
+
17
+ console.error(
18
+ new Error('duplication_detected', {
19
+ cause: {
20
+ name: __package_name__,
21
+ oldVersion: globalThis_.__alwatr_dedupe__,
22
+ newVersion: __package_version__,
23
+ },
24
+ }),
25
+ );
26
+ }
27
+
28
+ const list: DictionaryOpt<true> = {};
29
+
30
+ /**
31
+ * Prevent duplication in any entities like loading node packages.
32
+ * @param name package name including scope. e.g. `@scope/package-name`
33
+ * @param version package version (optional)
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * deduplicate({name: __package_name__, strict: true});
38
+ * ```
39
+ */
40
+ export function deduplicate(args: {name: string; strict?: true}): void {
41
+ if (hasOwn(list, args.name)) {
42
+ const error = new Error('duplication_detected', {
43
+ cause: {
44
+ name: args.name,
45
+ },
46
+ });
47
+
48
+ if (args.strict) {
49
+ throw error;
50
+ }
51
+ else {
52
+ console.error(error);
53
+ }
54
+ }
55
+
56
+ list[args.name] = true;
57
+ }
58
+
59
+ deduplicate({name: __package_name__});
60
+
61
+ /**
62
+ * Old `definePackage` for backward compatibility.
63
+ * @deprecated Use `deduplicate` instead.
64
+ */
65
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
66
+ export function definePackage(packageName: string, _?: string): void {
67
+ console.warn('`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.');
68
+ deduplicate({name: packageName});
69
+ }
package/CHANGELOG.md DELETED
@@ -1,426 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [5.5.30](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.29...@alwatr/dedupe@5.5.30) (2026-02-18)
7
-
8
- **Note:** Version bump only for package @alwatr/dedupe
9
-
10
- ## [5.5.29](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.28...@alwatr/dedupe@5.5.29) (2025-12-23)
11
-
12
- **Note:** Version bump only for package @alwatr/dedupe
13
-
14
- ## [5.5.28](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.27...@alwatr/dedupe@5.5.28) (2025-12-13)
15
-
16
- **Note:** Version bump only for package @alwatr/dedupe
17
-
18
- ## [5.5.27](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.26...@alwatr/dedupe@5.5.27) (2025-12-10)
19
-
20
- **Note:** Version bump only for package @alwatr/dedupe
21
-
22
- ## [5.5.26](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.25...@alwatr/dedupe@5.5.26) (2025-11-18)
23
-
24
- ### 🐛 Bug Fixes
25
-
26
- * add type imports from @alwatr/nano-build and @alwatr/type-helper across multiple packages ([5ab7f15](https://github.com/Alwatr/nanolib/commit/5ab7f159ba57788bf8df40fa96a3027f589d5a77))
27
-
28
- ### 🔨 Code Refactoring
29
-
30
- * remove unnecessary type declarations from tsconfig.json files ([89bcc7d](https://github.com/Alwatr/nanolib/commit/89bcc7db839807110b80f8ba34414ea9734d9c75))
31
-
32
- ## [5.5.25](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.24...@alwatr/dedupe@5.5.25) (2025-11-15)
33
-
34
- **Note:** Version bump only for package @alwatr/dedupe
35
-
36
- ## [5.5.24](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.23...@alwatr/dedupe@5.5.24) (2025-11-15)
37
-
38
- **Note:** Version bump only for package @alwatr/dedupe
39
-
40
- ## [5.5.23](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.22...@alwatr/dedupe@5.5.23) (2025-11-06)
41
-
42
- ### 🐛 Bug Fixes
43
-
44
- * update package references and imports to use @alwatr/has-own instead of @alwatr/polyfill-has-own ([5441696](https://github.com/Alwatr/nanolib/commit/5441696dc7abbbd9e48c178c60dfde86c76b9517))
45
-
46
- ## [5.5.22](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.21...@alwatr/dedupe@5.5.22) (2025-11-04)
47
-
48
- **Note:** Version bump only for package @alwatr/dedupe
49
-
50
- ## [5.5.21](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.20...@alwatr/dedupe@5.5.21) (2025-10-06)
51
-
52
- ### 🔗 Dependencies update
53
-
54
- * bump the npm-dependencies group with 4 updates ([9825815](https://github.com/Alwatr/nanolib/commit/982581552bbb4b97dca52af5e93a80937f0c3109))
55
-
56
- ## [5.5.20](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.19...@alwatr/dedupe@5.5.20) (2025-09-27)
57
-
58
- ### 🧹 Miscellaneous Chores
59
-
60
- * exclude test files from package distribution ([86f4f2f](https://github.com/Alwatr/nanolib/commit/86f4f2f5985845c5cf3a3a9398de7b2f98ce53e7))
61
-
62
- ## [5.5.19](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.18...@alwatr/dedupe@5.5.19) (2025-09-22)
63
-
64
- **Note:** Version bump only for package @alwatr/dedupe
65
-
66
- ## [5.5.18](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.17...@alwatr/dedupe@5.5.18) (2025-09-22)
67
-
68
- **Note:** Version bump only for package @alwatr/dedupe
69
-
70
- ## [5.5.17](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.16...@alwatr/dedupe@5.5.17) (2025-09-21)
71
-
72
- **Note:** Version bump only for package @alwatr/dedupe
73
-
74
- ## [5.5.16](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.15...@alwatr/dedupe@5.5.16) (2025-09-20)
75
-
76
- ### 🐛 Bug Fixes
77
-
78
- * add sideEffects property to package.json files for better tree-shaking ([c7b9e74](https://github.com/Alwatr/nanolib/commit/c7b9e74e1920c8e35b438742de61883ca62da58c))
79
- * add sideEffects property to package.json files for better tree-shaking ([e8402c4](https://github.com/Alwatr/nanolib/commit/e8402c481a14a1f807a37aaa862a936713d26176))
80
-
81
- ### 🧹 Miscellaneous Chores
82
-
83
- * remove duplicate sideEffects property from multiple package.json files ([b123f86](https://github.com/Alwatr/nanolib/commit/b123f86be81481de2314aae9bb2eeb629743d24c))
84
-
85
- ## [5.5.15](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.14...@alwatr/dedupe@5.5.15) (2025-09-19)
86
-
87
- **Note:** Version bump only for package @alwatr/dedupe
88
-
89
- ## [5.5.14](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.13...@alwatr/dedupe@5.5.14) (2025-09-15)
90
-
91
- **Note:** Version bump only for package @alwatr/dedupe
92
-
93
- ## [5.5.13](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.12...@alwatr/dedupe@5.5.13) (2025-09-14)
94
-
95
- **Note:** Version bump only for package @alwatr/dedupe
96
-
97
- ## [5.5.12](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.11...@alwatr/dedupe@5.5.12) (2025-09-13)
98
-
99
- **Note:** Version bump only for package @alwatr/dedupe
100
-
101
- ## [5.5.11](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.10...@alwatr/dedupe@5.5.11) (2025-09-13)
102
-
103
- ### 🧹 Miscellaneous Chores
104
-
105
- * remove package-tracer dependency and related code from fetch package ([96fe4e9](https://github.com/Alwatr/nanolib/commit/96fe4e9552a205f218ceed187c55e4e904a07089))
106
-
107
- ## [5.5.10](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.9...@alwatr/dedupe@5.5.10) (2025-09-09)
108
-
109
- ### 🧹 Miscellaneous Chores
110
-
111
- * remove trailing newlines from contributing sections in README files ([e8ab1bc](https://github.com/Alwatr/nanolib/commit/e8ab1bc43e0addea5ccd4c897c2cec597cb9e15f))
112
-
113
- ## [5.5.9](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.8...@alwatr/dedupe@5.5.9) (2025-09-06)
114
-
115
- **Note:** Version bump only for package @alwatr/dedupe
116
-
117
- ## [5.5.8](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.7...@alwatr/dedupe@5.5.8) (2025-09-05)
118
-
119
- **Note:** Version bump only for package @alwatr/dedupe
120
-
121
- ## [5.5.7](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.6...@alwatr/dedupe@5.5.7) (2025-09-01)
122
-
123
- **Note:** Version bump only for package @alwatr/dedupe
124
-
125
- ## [5.5.6](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.5...@alwatr/dedupe@5.5.6) (2025-08-23)
126
-
127
- **Note:** Version bump only for package @alwatr/dedupe
128
-
129
- ## [5.5.5](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.3...@alwatr/dedupe@5.5.5) (2025-08-23)
130
-
131
- ### 🐛 Bug Fixes
132
-
133
- * update license from AGPL-3.0-only to MPL-2.0 ([d20968e](https://github.com/Alwatr/nanolib/commit/d20968e60cc89b1dcdf9b96507178da6ed562f55))
134
- * update package versions in multiple package.json files ([7638b1c](https://github.com/Alwatr/nanolib/commit/7638b1cafee2b4e0f97db7a89ac9fba6384b9b10))
135
-
136
- ### 🔨 Code Refactoring
137
-
138
- * Updated all package.json files in the project to change dependency version specifiers from "workspace:^" to "workspace:*" for consistency and to allow for more flexible version resolution. ([db6a4f7](https://github.com/Alwatr/nanolib/commit/db6a4f76deec2d1d8039978144e4bc51b6f1a0e3))
139
-
140
- ### 🧹 Miscellaneous Chores
141
-
142
- * reformat all package.json files ([ceda45d](https://github.com/Alwatr/nanolib/commit/ceda45de186667790474f729cb4b161a5148ce19))
143
-
144
- ### 🔗 Dependencies update
145
-
146
- * update TypeScript and Jest versions across all packages to improve compatibility and performance ([31baf36](https://github.com/Alwatr/nanolib/commit/31baf366101e92e27db66a21c849fb101f19be47))
147
-
148
- ## [5.5.4](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.3...@alwatr/dedupe@5.5.4) (2025-08-23)
149
-
150
- ### Code Refactoring
151
-
152
- * Updated all package.json files in the project to change dependency version specifiers from "workspace:^" to "workspace:*" for consistency and to allow for more flexible version resolution. ([db6a4f7](https://github.com/Alwatr/nanolib/commit/db6a4f76deec2d1d8039978144e4bc51b6f1a0e3)) by @alimd
153
-
154
- ## <small>5.5.3 (2025-04-15)</small>
155
-
156
- **Note:** Version bump only for package @alwatr/dedupe
157
-
158
- ## [5.5.2](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.1...@alwatr/dedupe@5.5.2) (2025-04-01)
159
-
160
- **Note:** Version bump only for package @alwatr/dedupe
161
-
162
- ## [5.5.1](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.5.0...@alwatr/dedupe@5.5.1) (2025-03-18)
163
-
164
- **Note:** Version bump only for package @alwatr/dedupe
165
-
166
- ## [5.5.0](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.4.0...@alwatr/dedupe@5.5.0) (2025-03-06)
167
-
168
- ### Miscellaneous Chores
169
-
170
- * update username casing in changelog entries ([9722ac9](https://github.com/Alwatr/nanolib/commit/9722ac9a078438a4e8ebfa5826ea70e0e3a52ca6)) by @
171
-
172
- ### Dependencies update
173
-
174
- * bump the development-dependencies group across 1 directory with 11 updates ([720c395](https://github.com/Alwatr/nanolib/commit/720c3954da55c929fe8fb16957121f4c51fb7f0c)) by @dependabot[bot]
175
-
176
- ## [5.4.0](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@5.3.1...@alwatr/dedupe@5.4.0) (2025-02-18)
177
-
178
- **Note:** Version bump only for package @alwatr/dedupe
179
-
180
- ## [5.3.1](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.8...@alwatr/dedupe@5.3.1) (2025-02-03)
181
-
182
- ## 5.3.0 (2025-02-03)
183
-
184
- ### Miscellaneous Chores
185
-
186
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @
187
-
188
- ### Dependencies update
189
-
190
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @
191
- * update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @
192
-
193
- ## 5.0.0 (2024-11-02)
194
-
195
- ### ⚠ BREAKING CHANGES
196
-
197
- * To simplify version management and ensure consistency, all nanolib packages now use the same version as @alwatr/nanolib. This may require updates to your project's dependencies.
198
-
199
- ### Code Refactoring
200
-
201
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
202
-
203
- ## [5.3.0](https://github.com/Alwatr/nanolib/compare/v5.2.1...v5.3.0) (2025-02-03)
204
-
205
- ### Miscellaneous Chores
206
-
207
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @ArmanAsadian
208
-
209
- ### Dependencies update
210
-
211
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @dependabot[bot]
212
- * update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @alimd
213
-
214
- ## 5.0.0 (2024-11-02)
215
-
216
- ### ⚠ BREAKING CHANGES
217
-
218
- * To simplify version management and ensure consistency, all nanolib packages now use the same version as @alwatr/nanolib. This may require updates to your project's dependencies.
219
-
220
- ### Features
221
-
222
- * **dedupe:** add `definePackage` to use `deduplicate` for backward compatibility ([990b994](https://github.com/Alwatr/nanolib/commit/990b994ff7a633f6f337a5b96cdd82dc9638c0d6)) by @
223
- * **dedupe:** new package ([77fcdf6](https://github.com/Alwatr/nanolib/commit/77fcdf6fc8701910a7d503b7fba89fd284f36833)) by @
224
- * **dedupe:** refactor & new api ([393d873](https://github.com/Alwatr/nanolib/commit/393d8730456749e88fc01b7680c025889de53f36)) by @
225
-
226
- ### Bug Fixes
227
-
228
- * __package_version__ global type ([de8a3f9](https://github.com/Alwatr/nanolib/commit/de8a3f93bdb5a786c42f56324072b4b9520ce3a1)) by @
229
- * all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @
230
- * **dedupe:** add a missing `import` & use `__package_name__` ([1ebbe92](https://github.com/Alwatr/nanolib/commit/1ebbe926549ce11111a791f8d72c9d296597c803)) by @
231
- * **dedupe:** duplicate_dedupe not work issue ([bdf6f52](https://github.com/Alwatr/nanolib/commit/bdf6f52bbb3730e6d791f5f1cba9a4ebe2510e34)) by @
232
- * **dedupe:** update `demo` based on new API ([650f159](https://github.com/Alwatr/nanolib/commit/650f1591c754231ca7d0c36a9cf98384af30aa44)) by @
233
- * use new `global-this` package & remove global type ([63f5a3b](https://github.com/Alwatr/nanolib/commit/63f5a3b07f6d73d0c213cd893a382d5bfe1c4c34)) by @
234
-
235
- ### Code Refactoring
236
-
237
- * **dedupe:** prevent throw error on duplicate package and just log it ([9d2b657](https://github.com/Alwatr/nanolib/commit/9d2b6570616c63604b138f2df2e2166afe16c482)) by @
238
- * prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @
239
- * update Dictionary type definitions ([c94cbc4](https://github.com/Alwatr/nanolib/commit/c94cbc4523864e2cc47828ccf5508b68945ac2b8)) by @
240
- * use new `global-this` package ([42510b9](https://github.com/Alwatr/nanolib/commit/42510b9ae0e385206a902db093d188949f1cb84e)) by @
241
- * use new type-helper global types and remove all import types ([08b5d08](https://github.com/Alwatr/nanolib/commit/08b5d08c03c7c315382337239de0426462f384b8)) by @
242
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
243
-
244
- ### Miscellaneous Chores
245
-
246
- * **dedupe:** change the license to AGPL-3.0 ([f48165c](https://github.com/Alwatr/nanolib/commit/f48165c4cc9aa0bfc5cf433500fd3de3d45fc8ab)) by @
247
- * **dedupe:** fix version ([9754409](https://github.com/Alwatr/nanolib/commit/9754409d978265ba2ce08a9f86af1d1e143940e4)) by @
248
- * **dedupe:** fix version ([9c5494a](https://github.com/Alwatr/nanolib/commit/9c5494a7297351ec36e7f1f293cc4c1a6f71cf8a)) by @
249
- * **deps-dev:** bump the development-dependencies group with 3 updates ([0e0ec0f](https://github.com/Alwatr/nanolib/commit/0e0ec0f7c66c849727563cabe0e88606aee49035)) by @
250
- * **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @
251
- * **deps:** update ([8e70dff](https://github.com/Alwatr/nanolib/commit/8e70dffb1e751496ef2e72d6cffd685f1fea44e3)) by @
252
- * **deps:** update ([f0b60d2](https://github.com/Alwatr/nanolib/commit/f0b60d24c9fae6190940baf95167a1175360d4b3)) by @
253
- * fix all typescript reference ([dea4c44](https://github.com/Alwatr/nanolib/commit/dea4c4414167602ea2f13888c6ecee24eb65ed93)) by @
254
- * include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @
255
- * Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @
256
- * Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
257
-
258
- ### Dependencies update
259
-
260
- * bump @types/node ([3d80fed](https://github.com/Alwatr/nanolib/commit/3d80fedaf720af792feb060c2f81c737ebb84e11)) by @
261
- * bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @
262
- * bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @
263
- * bump the development-dependencies group with 2 updates ([be5d6c2](https://github.com/Alwatr/nanolib/commit/be5d6c2d86b937f32cebc6848aaff85af07055dd)) by @
264
- * **dedupe:** update ([ce988ec](https://github.com/Alwatr/nanolib/commit/ce988ec4cf0f4be8fa0fb026eae65c31acc7055e)) by @
265
- * upd ([451d025](https://github.com/Alwatr/nanolib/commit/451d0255ba96ed55f897a6f44f62cf4e6d2b12be)) by @
266
- * update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @
267
- * update all ([53342f6](https://github.com/Alwatr/nanolib/commit/53342f67a8a013127f073540bc11929f1813c05c)) by @
268
- * update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @
269
- * update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
270
- * upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @
271
-
272
- ## [1.1.8](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.7...@alwatr/dedupe@1.1.8) (2024-11-02)
273
-
274
- **Note:** Version bump only for package @alwatr/dedupe
275
-
276
- ## [1.1.7](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.6...@alwatr/dedupe@1.1.7) (2024-10-25)
277
-
278
- **Note:** Version bump only for package @alwatr/dedupe
279
-
280
- ## [1.1.6](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.5...@alwatr/dedupe@1.1.6) (2024-10-12)
281
-
282
- **Note:** Version bump only for package @alwatr/dedupe
283
-
284
- ## [1.1.5](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.4...@alwatr/dedupe@1.1.5) (2024-10-11)
285
-
286
- ### Bug Fixes
287
-
288
- - use new `global-this` package & remove global type ([63f5a3b](https://github.com/Alwatr/nanolib/commit/63f5a3b07f6d73d0c213cd893a382d5bfe1c4c34)) by @mohammadhonarvar
289
-
290
- ### Code Refactoring
291
-
292
- - prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @mohammadhonarvar
293
- - use new `global-this` package ([42510b9](https://github.com/Alwatr/nanolib/commit/42510b9ae0e385206a902db093d188949f1cb84e)) by @mohammadhonarvar
294
-
295
- ## [1.1.4](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.3...@alwatr/dedupe@1.1.4) (2024-10-11)
296
-
297
- ### Miscellaneous Chores
298
-
299
- - include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @alimd
300
-
301
- ## [1.1.3](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.2...@alwatr/dedupe@1.1.3) (2024-10-11)
302
-
303
- **Note:** Version bump only for package @alwatr/dedupe
304
-
305
- ## [1.1.2](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.1...@alwatr/dedupe@1.1.2) (2024-10-10)
306
-
307
- ### Dependencies update
308
-
309
- - bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
310
-
311
- ## [1.1.1](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.0...@alwatr/dedupe@1.1.1) (2024-10-08)
312
-
313
- **Note:** Version bump only for package @alwatr/dedupe
314
-
315
- ## [1.1.0](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.14...@alwatr/dedupe@1.1.0) (2024-09-29)
316
-
317
- ### Features
318
-
319
- - **dedupe:** add `definePackage` to use `deduplicate` for backward compatibility ([990b994](https://github.com/Alwatr/nanolib/commit/990b994ff7a633f6f337a5b96cdd82dc9638c0d6)) by @alimd
320
- - **dedupe:** refactor & new api ([393d873](https://github.com/Alwatr/nanolib/commit/393d8730456749e88fc01b7680c025889de53f36)) by @mohammadhonarvar
321
-
322
- ### Bug Fixes
323
-
324
- - all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @mohammadhonarvar
325
- - **dedupe:** add a missing `import` & use `__package_name__` ([1ebbe92](https://github.com/Alwatr/nanolib/commit/1ebbe926549ce11111a791f8d72c9d296597c803)) by @mohammadhonarvar
326
- - **dedupe:** update `demo` based on new API ([650f159](https://github.com/Alwatr/nanolib/commit/650f1591c754231ca7d0c36a9cf98384af30aa44)) by @mohammadhonarvar
327
-
328
- ### Code Refactoring
329
-
330
- - update Dictionary type definitions ([c94cbc4](https://github.com/Alwatr/nanolib/commit/c94cbc4523864e2cc47828ccf5508b68945ac2b8)) by @alimd
331
- - use new type-helper global types and remove all import types ([08b5d08](https://github.com/Alwatr/nanolib/commit/08b5d08c03c7c315382337239de0426462f384b8)) by @alimd
332
-
333
- ### Miscellaneous Chores
334
-
335
- - **dedupe:** change the license to AGPL-3.0 ([f48165c](https://github.com/Alwatr/nanolib/commit/f48165c4cc9aa0bfc5cf433500fd3de3d45fc8ab)) by @ArmanAsadian
336
- - Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @alimd
337
-
338
- ### Dependencies update
339
-
340
- - bump @types/node ([3d80fed](https://github.com/Alwatr/nanolib/commit/3d80fedaf720af792feb060c2f81c737ebb84e11)) by @dependabot[bot]
341
- - **dedupe:** update ([ce988ec](https://github.com/Alwatr/nanolib/commit/ce988ec4cf0f4be8fa0fb026eae65c31acc7055e)) by @mohammadhonarvar
342
-
343
- ## [1.0.14](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.13...@alwatr/dedupe@1.0.14) (2024-09-21)
344
-
345
- **Note:** Version bump only for package @alwatr/dedupe
346
-
347
- ## [1.0.13](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.12...@alwatr/dedupe@1.0.13) (2024-09-15)
348
-
349
- ### Dependencies update
350
-
351
- - bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
352
- - update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @alimd
353
-
354
- ## [1.0.12](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.11...@alwatr/dedupe@1.0.12) (2024-08-31)
355
-
356
- ### Miscellaneous Chores
357
-
358
- - Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
359
-
360
- ## [1.0.11](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.10...@alwatr/dedupe@1.0.11) (2024-08-31)
361
-
362
- ### Bug Fixes
363
-
364
- - **dedupe:** duplicate_dedupe not work issue ([bdf6f52](https://github.com/Alwatr/nanolib/commit/bdf6f52bbb3730e6d791f5f1cba9a4ebe2510e34)) by @alimd
365
-
366
- ### Code Refactoring
367
-
368
- - **dedupe:** prevent throw error on duplicate package and just log it ([9d2b657](https://github.com/Alwatr/nanolib/commit/9d2b6570616c63604b138f2df2e2166afe16c482)) by @alimd
369
-
370
- ## [1.0.10](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.9...@alwatr/dedupe@1.0.10) (2024-08-31)
371
-
372
- ### Dependencies update
373
-
374
- - update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @alimd
375
-
376
- ## [1.0.9](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.8...@alwatr/dedupe@1.0.9) (2024-07-04)
377
-
378
- ### Dependencies update
379
-
380
- - update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
381
-
382
- ## [1.0.8](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.7...@alwatr/dedupe@1.0.8) (2024-05-12)
383
-
384
- ### Dependencies update
385
-
386
- - upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @alimd
387
-
388
- ## [1.0.7](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.6...@alwatr/dedupe@1.0.7) (2024-04-25)
389
-
390
- **Note:** Version bump only for package @alwatr/dedupe
391
-
392
- ## [1.0.6](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.5...@alwatr/dedupe@1.0.6) (2024-03-28)
393
-
394
- **Note:** Version bump only for package @alwatr/dedupe
395
-
396
- ## [1.0.5](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.4...@alwatr/dedupe@1.0.5) (2024-01-31)
397
-
398
- ### Miscellaneous Chores
399
-
400
- - **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @alimd
401
-
402
- ## [1.0.4](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.3...@alwatr/dedupe@1.0.4) (2024-01-24)
403
-
404
- **Note:** Version bump only for package @alwatr/dedupe
405
-
406
- ## [1.0.3](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.2...@alwatr/dedupe@1.0.3) (2024-01-20)
407
-
408
- **Note:** Version bump only for package @alwatr/dedupe
409
-
410
- ## [1.0.2](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.1...@alwatr/dedupe@1.0.2) (2024-01-16)
411
-
412
- **Note:** Version bump only for package @alwatr/dedupe
413
-
414
- ## [1.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.0.0...@alwatr/dedupe@1.0.1) (2024-01-08)
415
-
416
- **Note:** Version bump only for package @alwatr/dedupe
417
-
418
- # 1.0.0 (2024-01-03)
419
-
420
- ### Bug Fixes
421
-
422
- - `__package_version__` global type ([de8a3f9](https://github.com/Alwatr/nanolib/commit/de8a3f93bdb5a786c42f56324072b4b9520ce3a1)) by @
423
-
424
- ### Features
425
-
426
- - **dedupe:** new package ([77fcdf6](https://github.com/Alwatr/nanolib/commit/77fcdf6fc8701910a7d503b7fba89fd284f36833)) by @
package/dist/main.cjs DELETED
@@ -1,4 +0,0 @@
1
- /** 📦 @alwatr/dedupe v5.5.30 */
2
- __dev_mode__: console.debug("📦 @alwatr/dedupe v5.5.30");
3
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{deduplicate:()=>deduplicate,definePackage:()=>definePackage});module.exports=__toCommonJS(main_exports);var import_global_this=require("@alwatr/global-this");var import_has_own=require("@alwatr/has-own");var globalThis_=(0,import_global_this.getGlobalThis)();if(typeof globalThis_.__alwatr_dedupe__==="undefined"){globalThis_.__alwatr_dedupe__="5.5.30"}else{if(globalThis_.__alwatr_dedupe__===true){globalThis_.__alwatr_dedupe__="1.0.x"}console.error(new Error("duplication_detected",{cause:{name:"@alwatr/dedupe",oldVersion:globalThis_.__alwatr_dedupe__,newVersion:"5.5.30"}}))}var list={};function deduplicate(args){if((0,import_has_own.hasOwn)(list,args.name)){const error=new Error("duplication_detected",{cause:{name:args.name}});if(args.strict){throw error}else{console.error(error)}}list[args.name]=true}deduplicate({name:"@alwatr/dedupe"});function definePackage(packageName,_){console.warn("`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.");deduplicate({name:packageName})}0&&(module.exports={deduplicate,definePackage});
4
- //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import {getGlobalThis} from '@alwatr/global-this';\nimport {hasOwn} from '@alwatr/has-own';\n\nimport type {} from '@alwatr/nano-build';\nimport type {} from '@alwatr/type-helper';\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 (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": ";;qqBAAA,0KAA4B,+BAC5B,mBAAqB,2BAKrB,IAAM,eAAc,kCAAkD,EAEtE,GAAI,OAAO,YAAY,oBAAsB,YAAa,CACxD,YAAY,kBAAoB,QAClC,KACK,CACH,GAAI,YAAY,oBAAsB,KAAM,CAC1C,YAAY,kBAAoB,OAClC,CAEA,QAAQ,MACN,IAAI,MAAM,uBAAwB,CAChC,MAAO,CACL,KAAM,iBACN,WAAY,YAAY,kBACxB,WAAY,QACd,CACF,CAAC,CACH,CACF,CAEA,IAAM,KAA4B,CAAC,EAY5B,SAAS,YAAY,KAA2C,CACrE,MAAI,uBAAO,KAAM,KAAK,IAAI,EAAG,CAC3B,MAAM,MAAQ,IAAI,MAAM,uBAAwB,CAC9C,MAAO,CACL,KAAM,KAAK,IACb,CACF,CAAC,EAED,GAAI,KAAK,OAAQ,CACf,MAAM,KACR,KACK,CACH,QAAQ,MAAM,KAAK,CACrB,CACF,CAEA,KAAK,KAAK,IAAI,EAAI,IACpB,CAEA,YAAY,CAAC,KAAM,gBAAgB,CAAC,EAO7B,SAAS,cAAc,YAAqB,EAAkB,CACnE,QAAQ,KAAK,+EAA+E,EAC5F,YAAY,CAAC,KAAM,WAAW,CAAC,CACjC",
6
- "names": []
7
- }
package/dist/main.mjs DELETED
@@ -1,4 +0,0 @@
1
- /** 📦 @alwatr/dedupe v5.5.30 */
2
- __dev_mode__: console.debug("📦 @alwatr/dedupe v5.5.30");
3
- import{getGlobalThis}from"@alwatr/global-this";import{hasOwn}from"@alwatr/has-own";var globalThis_=getGlobalThis();if(typeof globalThis_.__alwatr_dedupe__==="undefined"){globalThis_.__alwatr_dedupe__="5.5.30"}else{if(globalThis_.__alwatr_dedupe__===true){globalThis_.__alwatr_dedupe__="1.0.x"}console.error(new Error("duplication_detected",{cause:{name:"@alwatr/dedupe",oldVersion:globalThis_.__alwatr_dedupe__,newVersion:"5.5.30"}}))}var list={};function deduplicate(args){if(hasOwn(list,args.name)){const error=new Error("duplication_detected",{cause:{name:args.name}});if(args.strict){throw error}else{console.error(error)}}list[args.name]=true}deduplicate({name:"@alwatr/dedupe"});function definePackage(packageName,_){console.warn("`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.");deduplicate({name:packageName})}export{deduplicate,definePackage};
4
- //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import {getGlobalThis} from '@alwatr/global-this';\nimport {hasOwn} from '@alwatr/has-own';\n\nimport type {} from '@alwatr/nano-build';\nimport type {} from '@alwatr/type-helper';\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 (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,OAAQ,kBAAoB,sBAC5B,OAAQ,WAAa,kBAKrB,IAAM,YAAc,cAAkD,EAEtE,GAAI,OAAO,YAAY,oBAAsB,YAAa,CACxD,YAAY,kBAAoB,QAClC,KACK,CACH,GAAI,YAAY,oBAAsB,KAAM,CAC1C,YAAY,kBAAoB,OAClC,CAEA,QAAQ,MACN,IAAI,MAAM,uBAAwB,CAChC,MAAO,CACL,KAAM,iBACN,WAAY,YAAY,kBACxB,WAAY,QACd,CACF,CAAC,CACH,CACF,CAEA,IAAM,KAA4B,CAAC,EAY5B,SAAS,YAAY,KAA2C,CACrE,GAAI,OAAO,KAAM,KAAK,IAAI,EAAG,CAC3B,MAAM,MAAQ,IAAI,MAAM,uBAAwB,CAC9C,MAAO,CACL,KAAM,KAAK,IACb,CACF,CAAC,EAED,GAAI,KAAK,OAAQ,CACf,MAAM,KACR,KACK,CACH,QAAQ,MAAM,KAAK,CACrB,CACF,CAEA,KAAK,KAAK,IAAI,EAAI,IACpB,CAEA,YAAY,CAAC,KAAM,gBAAgB,CAAC,EAO7B,SAAS,cAAc,YAAqB,EAAkB,CACnE,QAAQ,KAAK,+EAA+E,EAC5F,YAAY,CAAC,KAAM,WAAW,CAAC,CACjC",
6
- "names": []
7
- }