install-module-linked-compat 0.2.1 → 0.2.2

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/cjs/index.js CHANGED
@@ -102,6 +102,8 @@ function clear(options) {
102
102
  (0, _installmodulelinked.clear)(_object_spread({}, _compatts.default, options));
103
103
  }
104
104
  function install(specifier, dest, options, callback) {
105
+ callback = typeof options === 'function' ? options : callback;
106
+ options = typeof options === 'function' ? {} : options || {};
105
107
  (0, _installmodulelinked.install)(specifier, dest, _object_spread({}, _compatts.default, options), callback);
106
108
  }
107
109
  /* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked-compat/src/index.ts"],"sourcesContent":["import type { CleanOptions, InstallCallback, InstallOptions } from 'install-module-linked';\nimport installModuleCore, { clear as clearCore, install as installCore, parseInstallString, sync as syncCore } from 'install-module-linked';\nimport overlay from './compat.ts';\n\nexport type * from 'install-module-linked';\n\n// Identical API to install-module-linked; the overlay supplies the shims the\n// running node lacks (empty on Node >= 18), and user options always win.\n\nexport default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<string> {\n const userOptions = typeof options === 'function' ? {} : options || {};\n const userCallback = typeof options === 'function' ? options : callback;\n const merged = { ...overlay, ...userOptions };\n if (typeof userCallback === 'function') return installModuleCore(installString, nodeModulesPath, merged, userCallback);\n return installModuleCore(installString, nodeModulesPath, merged);\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n return syncCore(installString, nodeModulesPath, { ...overlay, ...options });\n}\n\nexport function clear(options?: CleanOptions): void {\n clearCore({ ...overlay, ...options });\n}\n\nexport function install(specifier: string, dest: string, options: InstallOptions, callback: InstallCallback): void {\n installCore(specifier, dest, { ...overlay, ...options }, callback);\n}\n\nexport { parseInstallString };\n"],"names":["clear","installModule","install","parseInstallString","sync","installString","nodeModulesPath","options","callback","userOptions","userCallback","merged","overlay","installModuleCore","syncCore","clearCore","specifier","dest","installCore"],"mappings":";;;;;;;;;;;QAwBgBA;eAAAA;;QAZhB;eAAwBC;;QAgBRC;eAAAA;;QAIPC;eAAAA,uCAAkB;;QAZXC;eAAAA;;;2EAnBoG;+DAChG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUL,SAASH,cAAcI,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,IAAMC,cAAc,OAAOF,YAAY,aAAa,CAAC,IAAIA,WAAW,CAAC;IACrE,IAAMG,eAAe,OAAOH,YAAY,aAAaA,UAAUC;IAC/D,IAAMG,SAAS,mBAAKC,iBAAO,EAAKH;IAChC,IAAI,OAAOC,iBAAiB,YAAY,OAAOG,IAAAA,4BAAiB,EAACR,eAAeC,iBAAiBK,QAAQD;IACzG,OAAOG,IAAAA,4BAAiB,EAACR,eAAeC,iBAAiBK;AAC3D;AAEO,SAASP,KAAKC,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3F,OAAOO,IAAAA,yBAAQ,EAACT,eAAeC,iBAAiB,mBAAKM,iBAAO,EAAKL;AACnE;AAEO,SAASP,MAAMO,OAAsB;IAC1CQ,IAAAA,0BAAS,EAAC,mBAAKH,iBAAO,EAAKL;AAC7B;AAEO,SAASL,QAAQc,SAAiB,EAAEC,IAAY,EAAEV,OAAuB,EAAEC,QAAyB;IACzGU,IAAAA,4BAAW,EAACF,WAAWC,MAAM,mBAAKL,iBAAO,EAAKL,UAAWC;AAC3D"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked-compat/src/index.ts"],"sourcesContent":["import type { CleanOptions, InstallCallback, InstallOptions } from 'install-module-linked';\nimport installModuleCore, { clear as clearCore, install as installCore, parseInstallString, sync as syncCore } from 'install-module-linked';\nimport overlay from './compat.ts';\n\nexport type * from 'install-module-linked';\n\n// Identical API to install-module-linked; the overlay supplies the shims the\n// running node lacks (empty on Node >= 18), and user options always win.\n\nexport default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<string> {\n const userOptions = typeof options === 'function' ? {} : options || {};\n const userCallback = typeof options === 'function' ? options : callback;\n const merged = { ...overlay, ...userOptions };\n if (typeof userCallback === 'function') return installModuleCore(installString, nodeModulesPath, merged, userCallback);\n return installModuleCore(installString, nodeModulesPath, merged);\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n return syncCore(installString, nodeModulesPath, { ...overlay, ...options });\n}\n\nexport function clear(options?: CleanOptions): void {\n clearCore({ ...overlay, ...options });\n}\n\nexport function install(specifier: string, dest: string, options: InstallOptions, callback: InstallCallback): void;\nexport function install(specifier: string, dest: string, options?: InstallOptions, callback?: InstallCallback): void {\n callback = typeof options === 'function' ? options : (callback as InstallCallback);\n options = typeof options === 'function' ? {} : ((options || {}) as InstallOptions);\n\n installCore(specifier, dest, { ...overlay, ...options }, callback);\n}\n\nexport { parseInstallString };\n"],"names":["clear","installModule","install","parseInstallString","sync","installString","nodeModulesPath","options","callback","userOptions","userCallback","merged","overlay","installModuleCore","syncCore","clearCore","specifier","dest","installCore"],"mappings":";;;;;;;;;;;QAwBgBA;eAAAA;;QAZhB;eAAwBC;;QAiBRC;eAAAA;;QAOPC;eAAAA,uCAAkB;;QAhBXC;eAAAA;;;2EAnBoG;+DAChG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUL,SAASH,cAAcI,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,IAAMC,cAAc,OAAOF,YAAY,aAAa,CAAC,IAAIA,WAAW,CAAC;IACrE,IAAMG,eAAe,OAAOH,YAAY,aAAaA,UAAUC;IAC/D,IAAMG,SAAS,mBAAKC,iBAAO,EAAKH;IAChC,IAAI,OAAOC,iBAAiB,YAAY,OAAOG,IAAAA,4BAAiB,EAACR,eAAeC,iBAAiBK,QAAQD;IACzG,OAAOG,IAAAA,4BAAiB,EAACR,eAAeC,iBAAiBK;AAC3D;AAEO,SAASP,KAAKC,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3F,OAAOO,IAAAA,yBAAQ,EAACT,eAAeC,iBAAiB,mBAAKM,iBAAO,EAAKL;AACnE;AAEO,SAASP,MAAMO,OAAsB;IAC1CQ,IAAAA,0BAAS,EAAC,mBAAKH,iBAAO,EAAKL;AAC7B;AAGO,SAASL,QAAQc,SAAiB,EAAEC,IAAY,EAAEV,OAAwB,EAAEC,QAA0B;IAC3GA,WAAW,OAAOD,YAAY,aAAaA,UAAWC;IACtDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;IAE7DW,IAAAA,4BAAW,EAACF,WAAWC,MAAM,mBAAKL,iBAAO,EAAKL,UAAWC;AAC3D"}
package/dist/esm/index.js CHANGED
@@ -23,6 +23,8 @@ export function clear(options) {
23
23
  });
24
24
  }
25
25
  export function install(specifier, dest, options, callback) {
26
+ callback = typeof options === 'function' ? options : callback;
27
+ options = typeof options === 'function' ? {} : options || {};
26
28
  installCore(specifier, dest, {
27
29
  ...overlay,
28
30
  ...options
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked-compat/src/index.ts"],"sourcesContent":["import type { CleanOptions, InstallCallback, InstallOptions } from 'install-module-linked';\nimport installModuleCore, { clear as clearCore, install as installCore, parseInstallString, sync as syncCore } from 'install-module-linked';\nimport overlay from './compat.ts';\n\nexport type * from 'install-module-linked';\n\n// Identical API to install-module-linked; the overlay supplies the shims the\n// running node lacks (empty on Node >= 18), and user options always win.\n\nexport default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<string> {\n const userOptions = typeof options === 'function' ? {} : options || {};\n const userCallback = typeof options === 'function' ? options : callback;\n const merged = { ...overlay, ...userOptions };\n if (typeof userCallback === 'function') return installModuleCore(installString, nodeModulesPath, merged, userCallback);\n return installModuleCore(installString, nodeModulesPath, merged);\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n return syncCore(installString, nodeModulesPath, { ...overlay, ...options });\n}\n\nexport function clear(options?: CleanOptions): void {\n clearCore({ ...overlay, ...options });\n}\n\nexport function install(specifier: string, dest: string, options: InstallOptions, callback: InstallCallback): void {\n installCore(specifier, dest, { ...overlay, ...options }, callback);\n}\n\nexport { parseInstallString };\n"],"names":["installModuleCore","clear","clearCore","install","installCore","parseInstallString","sync","syncCore","overlay","installModule","installString","nodeModulesPath","options","callback","userOptions","userCallback","merged","specifier","dest"],"mappings":"AACA,OAAOA,qBAAqBC,SAASC,SAAS,EAAEC,WAAWC,WAAW,EAAEC,kBAAkB,EAAEC,QAAQC,QAAQ,QAAQ,wBAAwB;AAC5I,OAAOC,aAAa,cAAc;AAUlC,eAAe,SAASC,cAAcC,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,MAAMC,cAAc,OAAOF,YAAY,aAAa,CAAC,IAAIA,WAAW,CAAC;IACrE,MAAMG,eAAe,OAAOH,YAAY,aAAaA,UAAUC;IAC/D,MAAMG,SAAS;QAAE,GAAGR,OAAO;QAAE,GAAGM,WAAW;IAAC;IAC5C,IAAI,OAAOC,iBAAiB,YAAY,OAAOf,kBAAkBU,eAAeC,iBAAiBK,QAAQD;IACzG,OAAOf,kBAAkBU,eAAeC,iBAAiBK;AAC3D;AAEA,OAAO,SAASV,KAAKI,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3F,OAAOL,SAASG,eAAeC,iBAAiB;QAAE,GAAGH,OAAO;QAAE,GAAGI,OAAO;IAAC;AAC3E;AAEA,OAAO,SAASX,MAAMW,OAAsB;IAC1CV,UAAU;QAAE,GAAGM,OAAO;QAAE,GAAGI,OAAO;IAAC;AACrC;AAEA,OAAO,SAAST,QAAQc,SAAiB,EAAEC,IAAY,EAAEN,OAAuB,EAAEC,QAAyB;IACzGT,YAAYa,WAAWC,MAAM;QAAE,GAAGV,OAAO;QAAE,GAAGI,OAAO;IAAC,GAAGC;AAC3D;AAEA,SAASR,kBAAkB,GAAG"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked-compat/src/index.ts"],"sourcesContent":["import type { CleanOptions, InstallCallback, InstallOptions } from 'install-module-linked';\nimport installModuleCore, { clear as clearCore, install as installCore, parseInstallString, sync as syncCore } from 'install-module-linked';\nimport overlay from './compat.ts';\n\nexport type * from 'install-module-linked';\n\n// Identical API to install-module-linked; the overlay supplies the shims the\n// running node lacks (empty on Node >= 18), and user options always win.\n\nexport default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<string> {\n const userOptions = typeof options === 'function' ? {} : options || {};\n const userCallback = typeof options === 'function' ? options : callback;\n const merged = { ...overlay, ...userOptions };\n if (typeof userCallback === 'function') return installModuleCore(installString, nodeModulesPath, merged, userCallback);\n return installModuleCore(installString, nodeModulesPath, merged);\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n return syncCore(installString, nodeModulesPath, { ...overlay, ...options });\n}\n\nexport function clear(options?: CleanOptions): void {\n clearCore({ ...overlay, ...options });\n}\n\nexport function install(specifier: string, dest: string, options: InstallOptions, callback: InstallCallback): void;\nexport function install(specifier: string, dest: string, options?: InstallOptions, callback?: InstallCallback): void {\n callback = typeof options === 'function' ? options : (callback as InstallCallback);\n options = typeof options === 'function' ? {} : ((options || {}) as InstallOptions);\n\n installCore(specifier, dest, { ...overlay, ...options }, callback);\n}\n\nexport { parseInstallString };\n"],"names":["installModuleCore","clear","clearCore","install","installCore","parseInstallString","sync","syncCore","overlay","installModule","installString","nodeModulesPath","options","callback","userOptions","userCallback","merged","specifier","dest"],"mappings":"AACA,OAAOA,qBAAqBC,SAASC,SAAS,EAAEC,WAAWC,WAAW,EAAEC,kBAAkB,EAAEC,QAAQC,QAAQ,QAAQ,wBAAwB;AAC5I,OAAOC,aAAa,cAAc;AAUlC,eAAe,SAASC,cAAcC,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,MAAMC,cAAc,OAAOF,YAAY,aAAa,CAAC,IAAIA,WAAW,CAAC;IACrE,MAAMG,eAAe,OAAOH,YAAY,aAAaA,UAAUC;IAC/D,MAAMG,SAAS;QAAE,GAAGR,OAAO;QAAE,GAAGM,WAAW;IAAC;IAC5C,IAAI,OAAOC,iBAAiB,YAAY,OAAOf,kBAAkBU,eAAeC,iBAAiBK,QAAQD;IACzG,OAAOf,kBAAkBU,eAAeC,iBAAiBK;AAC3D;AAEA,OAAO,SAASV,KAAKI,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3F,OAAOL,SAASG,eAAeC,iBAAiB;QAAE,GAAGH,OAAO;QAAE,GAAGI,OAAO;IAAC;AAC3E;AAEA,OAAO,SAASX,MAAMW,OAAsB;IAC1CV,UAAU;QAAE,GAAGM,OAAO;QAAE,GAAGI,OAAO;IAAC;AACrC;AAGA,OAAO,SAAST,QAAQc,SAAiB,EAAEC,IAAY,EAAEN,OAAwB,EAAEC,QAA0B;IAC3GA,WAAW,OAAOD,YAAY,aAAaA,UAAWC;IACtDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;IAE7DR,YAAYa,WAAWC,MAAM;QAAE,GAAGV,OAAO;QAAE,GAAGI,OAAO;IAAC,GAAGC;AAC3D;AAEA,SAASR,kBAAkB,GAAG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "install-module-linked-compat",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Installs and symlinks a module into node_modules",
5
5
  "keywords": [
6
6
  "npm",
@@ -57,7 +57,7 @@
57
57
  "get-file-compat": "^2.0.0",
58
58
  "getopts-compat": "^2.2.5",
59
59
  "homedir-polyfill": "^1.0.3",
60
- "install-module-linked": "^2.0.2",
60
+ "install-module-linked": "^2.0.4",
61
61
  "mkdirp-classic": "^0.5.2",
62
62
  "node-version-call-local": "^1.0.0"
63
63
  },