@alwatr/dedupe 1.1.1 → 1.1.3

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,16 @@
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.3](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.2...@alwatr/dedupe@1.1.3) (2024-10-11)
7
+
8
+ **Note:** Version bump only for package @alwatr/dedupe
9
+
10
+ ## [1.1.2](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.1...@alwatr/dedupe@1.1.2) (2024-10-10)
11
+
12
+ ### Dependencies update
13
+
14
+ * bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
15
+
6
16
  ## [1.1.1](https://github.com/Alwatr/nanolib/compare/@alwatr/dedupe@1.1.0...@alwatr/dedupe@1.1.1) (2024-10-08)
7
17
 
8
18
  **Note:** Version bump only for package @alwatr/dedupe
package/README.md CHANGED
@@ -18,7 +18,7 @@ definePackage({name: __package_name__});
18
18
 
19
19
  ## Sponsors
20
20
 
21
- The following companies, organizations, and individuals support Nitrobase ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
21
+ The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
22
22
 
23
23
  [![Exir Studio](https://avatars.githubusercontent.com/u/181194967?s=200&v=4)](https://exirstudio.com)
24
24
 
package/dist/main.cjs CHANGED
@@ -1,3 +1,71 @@
1
- /* @alwatr/dedupe v1.1.1 */
2
- "use strict";var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(e,_)=>{for(var t in _)n(e,t,{get:_[t],enumerable:!0})},u=(e,_,t,i)=>{if(_&&typeof _=="object"||typeof _=="function")for(let r of l(_))!p.call(e,r)&&r!==t&&n(e,r,{get:()=>_[r],enumerable:!(i=c(_,r))||i.enumerable});return e};var m=e=>u(n({},"__esModule",{value:!0}),e);var f={};s(f,{deduplicate:()=>d,definePackage:()=>w});module.exports=m(f);var a=require("@alwatr/global-scope"),k=require("@alwatr/polyfill-has-own");typeof a.globalScope.__alwatr_dedupe__>"u"?a.globalScope.__alwatr_dedupe__="1.1.1":(a.globalScope.__alwatr_dedupe__===!0&&(a.globalScope.__alwatr_dedupe__="1.0.x"),console.error(new Error("duplication_detected",{cause:{name:"@alwatr/dedupe",oldVersion:a.globalScope.__alwatr_dedupe__,newVersion:"1.1.1"}})));var o={};function d(e){if(Object.hasOwn(o,e.name)){let _=new Error("duplication_detected",{cause:{name:e.name}});if(e.strict)throw _;console.error(_)}o[e.name]=!0}d({name:"@alwatr/dedupe"});function w(e,_){console.warn("`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead."),d({name:e})}0&&(module.exports={deduplicate,definePackage});
1
+ /* @alwatr/dedupe v1.1.3 */
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/main.ts
22
+ var main_exports = {};
23
+ __export(main_exports, {
24
+ deduplicate: () => deduplicate,
25
+ definePackage: () => definePackage
26
+ });
27
+ module.exports = __toCommonJS(main_exports);
28
+ var import_global_scope = require("@alwatr/global-scope");
29
+ var import_polyfill_has_own = require("@alwatr/polyfill-has-own");
30
+ if (typeof import_global_scope.globalScope.__alwatr_dedupe__ === "undefined") {
31
+ import_global_scope.globalScope.__alwatr_dedupe__ = "1.1.3";
32
+ } else {
33
+ if (import_global_scope.globalScope.__alwatr_dedupe__ === true) {
34
+ import_global_scope.globalScope.__alwatr_dedupe__ = "1.0.x";
35
+ }
36
+ console.error(new Error("duplication_detected", {
37
+ cause: {
38
+ name: "@alwatr/dedupe",
39
+ oldVersion: import_global_scope.globalScope.__alwatr_dedupe__,
40
+ newVersion: "1.1.3"
41
+ }
42
+ }));
43
+ }
44
+ var list = {};
45
+ function deduplicate(args) {
46
+ if (Object.hasOwn(list, args.name)) {
47
+ const error = new Error("duplication_detected", {
48
+ cause: {
49
+ name: args.name
50
+ }
51
+ });
52
+ if (args.strict) {
53
+ throw error;
54
+ } else {
55
+ console.error(error);
56
+ }
57
+ }
58
+ list[args.name] = true;
59
+ }
60
+ deduplicate({ name: "@alwatr/dedupe" });
61
+ function definePackage(packageName, _) {
62
+ console.warn("`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.");
63
+ deduplicate({ name: packageName });
64
+ }
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ deduplicate,
68
+ definePackage
69
+ });
70
+ /*! For license information please see main.cjs.LEGAL.txt */
3
71
  //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
4
  "sourcesContent": ["import {globalScope} from '@alwatr/global-scope';\nimport '@alwatr/polyfill-has-own';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __alwatr_dedupe__: string | true;\n}\n\nif (typeof globalScope.__alwatr_dedupe__ === 'undefined') {\n globalScope.__alwatr_dedupe__ = __package_version__;\n}\nelse {\n if (globalScope.__alwatr_dedupe__ === true) {\n globalScope.__alwatr_dedupe__ = '1.0.x';\n }\n\n console.error(new Error('duplication_detected', {\n cause: {\n name: __package_name__,\n oldVersion: globalScope.__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": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,kBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAA0B,gCAC1BC,EAAO,oCAOH,OAAO,cAAY,kBAAsB,IAC3C,cAAY,kBAAoB,SAG5B,cAAY,oBAAsB,KACpC,cAAY,kBAAoB,SAGlC,QAAQ,MAAM,IAAI,MAAM,uBAAwB,CAC9C,MAAO,CACL,KAAM,iBACN,WAAY,cAAY,kBACxB,WAAY,OACd,CACF,CAAC,CAAC,GAGJ,IAAMC,EAA4B,CAAC,EAY5B,SAASL,EAAYM,EAA2C,CACrE,GAAI,OAAO,OAAOD,EAAMC,EAAK,IAAI,EAAG,CAClC,IAAMC,EAAQ,IAAI,MAAM,uBAAwB,CAC9C,MAAO,CACL,KAAMD,EAAK,IACb,CACF,CAAC,EAED,GAAIA,EAAK,OACP,MAAMC,EAGN,QAAQ,MAAMA,CAAK,CAEvB,CAEAF,EAAKC,EAAK,IAAI,EAAI,EACpB,CAEAN,EAAY,CAAC,KAAM,gBAAgB,CAAC,EAO7B,SAASC,EAAcO,EAAqB,EAAiB,CAClE,QAAQ,KAAK,+EAA+E,EAC5FR,EAAY,CAAC,KAAMQ,CAAW,CAAC,CACjC",
6
- "names": ["main_exports", "__export", "deduplicate", "definePackage", "__toCommonJS", "import_global_scope", "import_polyfill_has_own", "list", "args", "error", "packageName"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA0B;AAC1B,8BAAO;AAOP,IAAI,OAAO,gCAAY,sBAAsB,aAAa;AACxD,kCAAY,oBAAoB;AAClC,OACK;AACH,MAAI,gCAAY,sBAAsB,MAAM;AAC1C,oCAAY,oBAAoB;AAAA,EAClC;AAEA,UAAQ,MAAM,IAAI,MAAM,wBAAwB;AAAA,IAC9C,OAAO;AAAA,MACL,MAAM;AAAA,MACN,YAAY,gCAAY;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;",
6
+ "names": []
7
7
  }
package/dist/main.mjs CHANGED
@@ -1,3 +1,46 @@
1
- /* @alwatr/dedupe v1.1.1 */
2
- import{globalScope as _}from"@alwatr/global-scope";import"@alwatr/polyfill-has-own";typeof _.__alwatr_dedupe__>"u"?_.__alwatr_dedupe__="1.1.1":(_.__alwatr_dedupe__===!0&&(_.__alwatr_dedupe__="1.0.x"),console.error(new Error("duplication_detected",{cause:{name:"@alwatr/dedupe",oldVersion:_.__alwatr_dedupe__,newVersion:"1.1.1"}})));var r={};function t(e){if(Object.hasOwn(r,e.name)){let a=new Error("duplication_detected",{cause:{name:e.name}});if(e.strict)throw a;console.error(a)}r[e.name]=!0}t({name:"@alwatr/dedupe"});function i(e,a){console.warn("`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead."),t({name:e})}export{t as deduplicate,i as definePackage};
1
+ /* @alwatr/dedupe v1.1.3 */
2
+
3
+ // src/main.ts
4
+ import { globalScope } from "@alwatr/global-scope";
5
+ import "@alwatr/polyfill-has-own";
6
+ if (typeof globalScope.__alwatr_dedupe__ === "undefined") {
7
+ globalScope.__alwatr_dedupe__ = "1.1.3";
8
+ } else {
9
+ if (globalScope.__alwatr_dedupe__ === true) {
10
+ globalScope.__alwatr_dedupe__ = "1.0.x";
11
+ }
12
+ console.error(new Error("duplication_detected", {
13
+ cause: {
14
+ name: "@alwatr/dedupe",
15
+ oldVersion: globalScope.__alwatr_dedupe__,
16
+ newVersion: "1.1.3"
17
+ }
18
+ }));
19
+ }
20
+ var list = {};
21
+ function deduplicate(args) {
22
+ if (Object.hasOwn(list, args.name)) {
23
+ const error = new Error("duplication_detected", {
24
+ cause: {
25
+ name: args.name
26
+ }
27
+ });
28
+ if (args.strict) {
29
+ throw error;
30
+ } else {
31
+ console.error(error);
32
+ }
33
+ }
34
+ list[args.name] = true;
35
+ }
36
+ deduplicate({ name: "@alwatr/dedupe" });
37
+ function definePackage(packageName, _) {
38
+ console.warn("`definePackage` in `@alwatr/dedupe` is deprecated. Use `deduplicate` instead.");
39
+ deduplicate({ name: packageName });
40
+ }
41
+ export {
42
+ deduplicate,
43
+ definePackage
44
+ };
45
+ /*! For license information please see main.mjs.LEGAL.txt */
3
46
  //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
4
  "sourcesContent": ["import {globalScope} from '@alwatr/global-scope';\nimport '@alwatr/polyfill-has-own';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __alwatr_dedupe__: string | true;\n}\n\nif (typeof globalScope.__alwatr_dedupe__ === 'undefined') {\n globalScope.__alwatr_dedupe__ = __package_version__;\n}\nelse {\n if (globalScope.__alwatr_dedupe__ === true) {\n globalScope.__alwatr_dedupe__ = '1.0.x';\n }\n\n console.error(new Error('duplication_detected', {\n cause: {\n name: __package_name__,\n oldVersion: globalScope.__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
- "m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AAM,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;",
6
+ "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwatr/dedupe",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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": [
@@ -67,16 +67,16 @@
67
67
  "clean": "rm -rfv dist *.tsbuildinfo"
68
68
  },
69
69
  "dependencies": {
70
- "@alwatr/global-scope": "^1.1.23",
71
- "@alwatr/package-tracer": "^1.0.1",
72
- "@alwatr/polyfill-has-own": "^1.1.1"
70
+ "@alwatr/global-scope": "^1.1.25",
71
+ "@alwatr/package-tracer": "^1.0.3",
72
+ "@alwatr/polyfill-has-own": "^1.1.3"
73
73
  },
74
74
  "devDependencies": {
75
- "@alwatr/nano-build": "^1.5.0",
75
+ "@alwatr/nano-build": "^2.0.0",
76
76
  "@alwatr/prettier-config": "^1.0.5",
77
- "@alwatr/tsconfig-base": "^1.3.0",
78
- "@alwatr/type-helper": "^2.0.0",
79
- "typescript": "^5.6.2"
77
+ "@alwatr/tsconfig-base": "^1.3.1",
78
+ "@alwatr/type-helper": "^2.0.1",
79
+ "typescript": "^5.6.3"
80
80
  },
81
- "gitHead": "41bd9f5a9ffe1f7306b24e63684b1895428f44b0"
81
+ "gitHead": "e0b3b4a47c02a395046982803b2e431c6ee3b0ab"
82
82
  }