@visulima/package 3.0.10 → 3.1.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/CHANGELOG.md +26 -0
- package/LICENSE.md +21 -0
- package/dist/error.cjs +1 -1
- package/dist/error.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/package-json.cjs +1 -1
- package/dist/package-json.d.cts +1 -1
- package/dist/package-json.d.mts +1 -1
- package/dist/package-json.d.ts +1 -1
- package/dist/package-json.mjs +1 -1
- package/dist/packem_shared/package-json-_iimUQ2e.d.cts +1693 -0
- package/dist/packem_shared/package-json-_iimUQ2e.d.mjs +1693 -0
- package/dist/packem_shared/package-json-_iimUQ2e.d.mts +1693 -0
- package/package.json +25 -14
- package/dist/shared/package-json-CEeDTVje.d.cts +0 -786
- package/dist/shared/package-json-CEeDTVje.d.mjs +0 -786
- package/dist/shared/package-json-CEeDTVje.d.mts +0 -786
- /package/dist/{shared → packem_shared}/PackageNotFoundError-4CX3Vfcu.mjs +0 -0
- /package/dist/{shared → packem_shared}/PackageNotFoundError-CY57YCot.cjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
## @visulima/package [3.1.0](https://github.com/visulima/visulima/compare/@visulima/package@3.0.11...@visulima/package@3.1.0) (2024-09-12)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* added new getPackageJsonProperty, hasPackageJsonProperty, hasPackageJsonAnyDependency helper function for pacakge.json ([d8f5375](https://github.com/visulima/visulima/commit/d8f5375227d9f0e70cdd0ae14b0eb9b2d2e135c5))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* **health-check:** improved tests for health-check ([4d24572](https://github.com/visulima/visulima/commit/4d24572ea3a4ad026ca3965002f29871282c6747))
|
|
10
|
+
|
|
11
|
+
## @visulima/package [3.0.11](https://github.com/visulima/visulima/compare/@visulima/package@3.0.10...@visulima/package@3.0.11) (2024-09-11)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* fixed node10 support ([f5e78d9](https://github.com/visulima/visulima/commit/f5e78d9bff8fd603967666598b34f9338a8726b5))
|
|
16
|
+
|
|
17
|
+
### Miscellaneous Chores
|
|
18
|
+
|
|
19
|
+
* updated dev dependencies ([28b5ee5](https://github.com/visulima/visulima/commit/28b5ee5c805ca8868536418829cde7ba8c5bb8dd))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Dependencies
|
|
23
|
+
|
|
24
|
+
* **@visulima/fs:** upgraded to 2.1.17
|
|
25
|
+
* **@visulima/path:** upgraded to 1.0.8
|
|
26
|
+
|
|
1
27
|
## @visulima/package [3.0.10](https://github.com/visulima/visulima/compare/@visulima/package@3.0.9...@visulima/package@3.0.10) (2024-09-07)
|
|
2
28
|
|
|
3
29
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
|
@@ -21,6 +21,27 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
21
21
|
SOFTWARE.
|
|
22
22
|
|
|
23
23
|
<!-- DEPENDENCIES -->
|
|
24
|
+
|
|
25
|
+
# Licenses of bundled dependencies
|
|
26
|
+
The published @visulima/package artifact additionally contains code with the following licenses:
|
|
27
|
+
MIT
|
|
28
|
+
|
|
29
|
+
# Bundled dependencies:
|
|
30
|
+
## dot-prop
|
|
31
|
+
License: MIT
|
|
32
|
+
By: Sindre Sorhus
|
|
33
|
+
Repository: sindresorhus/dot-prop
|
|
34
|
+
|
|
35
|
+
> MIT License
|
|
36
|
+
>
|
|
37
|
+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
38
|
+
>
|
|
39
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
40
|
+
>
|
|
41
|
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
42
|
+
>
|
|
43
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
44
|
+
|
|
24
45
|
<!-- DEPENDENCIES -->
|
|
25
46
|
|
|
26
47
|
<!-- TYPE_DEPENDENCIES -->
|
package/dist/error.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./packem_shared/PackageNotFoundError-CY57YCot.cjs");exports.PackageNotFoundError=r;
|
package/dist/error.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"./
|
|
1
|
+
import{default as a}from"./packem_shared/PackageNotFoundError-4CX3Vfcu.mjs";export{a as PackageNotFoundError};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./packem_shared/PackageNotFoundError-CY57YCot.cjs"),n=require("./monorepo.cjs"),o=require("./package.cjs"),a=require("./package-json.cjs"),e=require("./package-manager.cjs");exports.PackageNotFoundError=c;exports.findMonorepoRoot=n.findMonorepoRoot;exports.findMonorepoRootSync=n.findMonorepoRootSync;exports.findPackageRoot=o.findPackageRoot;exports.findPackageRootSync=o.findPackageRootSync;exports.findPackageJson=a.findPackageJson;exports.findPackageJsonSync=a.findPackageJsonSync;exports.getPackageJsonProperty=a.getPackageJsonProperty;exports.hasPackageJsonAnyDependency=a.hasPackageJsonAnyDependency;exports.hasPackageJsonProperty=a.hasPackageJsonProperty;exports.parsePackageJson=a.parsePackageJson;exports.writePackageJson=a.writePackageJson;exports.writePackageJsonSync=a.writePackageJsonSync;exports.findLockFile=e.findLockFile;exports.findLockFileSync=e.findLockFileSync;exports.findPackageManager=e.findPackageManager;exports.findPackageManagerSync=e.findPackageManagerSync;exports.getPackageManagerVersion=e.getPackageManagerVersion;exports.identifyInitiatingPackageManager=e.identifyInitiatingPackageManager;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PackageNotFoundError } from './error.cjs';
|
|
2
2
|
export { RootMonorepo, Strategy, findMonorepoRoot, findMonorepoRootSync } from './monorepo.cjs';
|
|
3
3
|
export { findPackageRoot, findPackageRootSync } from './package.cjs';
|
|
4
|
-
export {
|
|
4
|
+
export { d as NormalizedPackageJson, N as NormalizedReadResult, P as PackageJson, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, c as hasPackageJsonAnyDependency, h as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, b as writePackageJsonSync } from './packem_shared/package-json-_iimUQ2e.cjs';
|
|
5
5
|
export { PackageManager, PackageManagerResult, findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.cjs';
|
|
6
6
|
import '@visulima/fs';
|
|
7
7
|
import 'normalize-package-data';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PackageNotFoundError } from './error.mjs';
|
|
2
2
|
export { RootMonorepo, Strategy, findMonorepoRoot, findMonorepoRootSync } from './monorepo.mjs';
|
|
3
3
|
export { findPackageRoot, findPackageRootSync } from './package.mjs';
|
|
4
|
-
export {
|
|
4
|
+
export { d as NormalizedPackageJson, N as NormalizedReadResult, P as PackageJson, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, c as hasPackageJsonAnyDependency, h as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, b as writePackageJsonSync } from './packem_shared/package-json-_iimUQ2e.mjs';
|
|
5
5
|
export { PackageManager, PackageManagerResult, findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.mjs';
|
|
6
6
|
import '@visulima/fs';
|
|
7
7
|
import 'normalize-package-data';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PackageNotFoundError } from './error.js';
|
|
2
2
|
export { RootMonorepo, Strategy, findMonorepoRoot, findMonorepoRootSync } from './monorepo.js';
|
|
3
3
|
export { findPackageRoot, findPackageRootSync } from './package.js';
|
|
4
|
-
export {
|
|
4
|
+
export { d as NormalizedPackageJson, N as NormalizedReadResult, P as PackageJson, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, c as hasPackageJsonAnyDependency, h as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, b as writePackageJsonSync } from './packem_shared/package-json-_iimUQ2e.d.mjs';
|
|
5
5
|
export { PackageManager, PackageManagerResult, findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.js';
|
|
6
6
|
import '@visulima/fs';
|
|
7
7
|
import 'normalize-package-data';
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as
|
|
1
|
+
import{default as o}from"./packem_shared/PackageNotFoundError-4CX3Vfcu.mjs";import{findMonorepoRoot as r,findMonorepoRootSync as c}from"./monorepo.mjs";import{findPackageRoot as i,findPackageRootSync as t}from"./package.mjs";import{findPackageJson as k,findPackageJsonSync as P,getPackageJsonProperty as d,hasPackageJsonAnyDependency as s,hasPackageJsonProperty as p,parsePackageJson as y,writePackageJson as J,writePackageJsonSync as M}from"./package-json.mjs";import{findLockFile as m,findLockFileSync as x,findPackageManager as R,findPackageManagerSync as l,getPackageManagerVersion as F,identifyInitiatingPackageManager as h}from"./package-manager.mjs";export{o as PackageNotFoundError,m as findLockFile,x as findLockFileSync,r as findMonorepoRoot,c as findMonorepoRootSync,k as findPackageJson,P as findPackageJsonSync,R as findPackageManager,l as findPackageManagerSync,i as findPackageRoot,t as findPackageRootSync,d as getPackageJsonProperty,F as getPackageManagerVersion,s as hasPackageJsonAnyDependency,p as hasPackageJsonProperty,h as identifyInitiatingPackageManager,y as parsePackageJson,J as writePackageJson,M as writePackageJsonSync};
|
package/dist/package-json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var S=Object.defineProperty;var o=(e,r)=>S(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("node:fs"),f=require("@visulima/fs"),y=require("@visulima/fs/error"),h=require("@visulima/fs/utils"),l=require("@visulima/path"),I=require("normalize-package-data"),b=o(e=>e&&typeof e=="object"&&"default"in e?e.default:e,"_interopDefaultCompat"),g=b(I),u=o(e=>{const r=typeof e;return e!==null&&(r==="object"||r==="function")},"isObject"),p=new Set(["__proto__","prototype","constructor"]),m=new Set("0123456789");function w(e){const r=[];let a="",n="start",t=!1;for(const s of e)switch(s){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");t&&(a+=s),n="property",t=!t;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(t){t=!1,a+=s;break}if(p.has(a))return[];r.push(a),a="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(t){t=!1,a+=s;break}if(n==="property"){if(p.has(a))return[];r.push(a),a=""}n="index";break}case"]":{if(n==="index"){r.push(Number.parseInt(a,10)),a="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!m.has(s))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),t&&(t=!1,a+="\\"),a+=s}}switch(t&&(a+="\\"),n){case"property":{if(p.has(a))return[];r.push(a);break}case"index":throw new Error("Index was not closed");case"start":{r.push("");break}}return r}o(w,"getPathSegments");function k(e,r){if(typeof r!="number"&&Array.isArray(e)){const a=Number.parseInt(r,10);return Number.isInteger(a)&&e[a]===e[r]}return!1}o(k,"isStringIndex");function d(e,r,a){if(!u(e)||typeof r!="string")return a===void 0?e:a;const n=w(r);if(n.length===0)return a;for(let t=0;t<n.length;t++){const s=n[t];if(k(e,s)?e=t===n.length-1?void 0:null:e=e[s],e==null){if(t!==n.length-1)return a;break}}return e===void 0?a:e}o(d,"getProperty");function P(e,r){if(!u(e)||typeof r!="string")return!1;const a=w(r);if(a.length===0)return!1;for(const n of a){if(!u(e)||!(n in e)||k(e,n))return!1;e=e[n]}return!0}o(P,"hasProperty");var A=Object.defineProperty,c=o((e,r)=>A(e,"name",{value:r,configurable:!0}),"s");const J=new Map,_=c(async(e,r={})=>{const a={type:"file"};e&&(a.cwd=e);const n=await f.findUp("package.json",a);if(!n)throw new y.NotFoundError("No such file or directory, for package.json found.");const t=r.cache&&typeof r.cache!="boolean"?r.cache:J;if(r.cache&&t.has(n))return t.get(n);const s=await f.readJson(n);g(s);const i={packageJson:s,path:n};return t.set(n,i),i},"findPackageJson"),v=c((e,r={})=>{const a={type:"file"};e&&(a.cwd=e);const n=f.findUpSync("package.json",a);if(!n)throw new y.NotFoundError("No such file or directory, for package.json found.");const t=r.cache&&typeof r.cache!="boolean"?r.cache:J;if(r.cache&&t.has(n))return t.get(n);const s=f.readJsonSync(n);g(s);const i={packageJson:s,path:n};return t.set(n,i),i},"findPackageJsonSync"),D=c(async(e,r={})=>{const{cwd:a,...n}=r,t=h.toPath(r.cwd??process.cwd());await f.writeJson(l.join(t,"package.json"),e,n)},"writePackageJson"),N=c((e,r={})=>{const{cwd:a,...n}=r,t=h.toPath(r.cwd??process.cwd());f.writeJsonSync(l.join(t,"package.json"),e,n)},"writePackageJsonSync"),q=c(e=>{const r=e!==null&&typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");const a=r?structuredClone(e):E.existsSync(e)?f.readJsonSync(e):h.parseJson(e);return g(a),a},"parsePackageJson"),F=c((e,r,a)=>d(e,r,a),"getPackageJsonProperty"),O=c((e,r)=>P(e,r),"hasPackageJsonProperty"),C=c((e,r,a)=>{const n=d(e,"dependencies",{}),t=d(e,"devDependencies",{}),s=d(e,"peerDependencies",{}),i={...n,...t,...a?.peerDeps===!1?{}:s};for(const x of r)if(P(i,x))return!0;return!1},"hasPackageJsonAnyDependency");exports.findPackageJson=_;exports.findPackageJsonSync=v;exports.getPackageJsonProperty=F;exports.hasPackageJsonAnyDependency=C;exports.hasPackageJsonProperty=O;exports.parsePackageJson=q;exports.writePackageJson=D;exports.writePackageJsonSync=N;
|
package/dist/package-json.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { N as NormalizedReadResult, f as findPackageJson, a as findPackageJsonSync, p as parsePackageJson, w as writePackageJson, b as writePackageJsonSync } from './
|
|
1
|
+
export { N as NormalizedReadResult, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, c as hasPackageJsonAnyDependency, h as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, b as writePackageJsonSync } from './packem_shared/package-json-_iimUQ2e.cjs';
|
|
2
2
|
import '@visulima/fs';
|
|
3
3
|
import 'normalize-package-data';
|
package/dist/package-json.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { N as NormalizedReadResult, f as findPackageJson, a as findPackageJsonSync, p as parsePackageJson, w as writePackageJson, b as writePackageJsonSync } from './
|
|
1
|
+
export { N as NormalizedReadResult, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, c as hasPackageJsonAnyDependency, h as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, b as writePackageJsonSync } from './packem_shared/package-json-_iimUQ2e.mjs';
|
|
2
2
|
import '@visulima/fs';
|
|
3
3
|
import 'normalize-package-data';
|
package/dist/package-json.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { N as NormalizedReadResult, f as findPackageJson, a as findPackageJsonSync, p as parsePackageJson, w as writePackageJson, b as writePackageJsonSync } from './
|
|
1
|
+
export { N as NormalizedReadResult, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, c as hasPackageJsonAnyDependency, h as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, b as writePackageJsonSync } from './packem_shared/package-json-_iimUQ2e.d.mjs';
|
|
2
2
|
import '@visulima/fs';
|
|
3
3
|
import 'normalize-package-data';
|
package/dist/package-json.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var m=Object.defineProperty;var c=(e,r)=>m(e,"name",{value:r,configurable:!0});import{existsSync as E}from"node:fs";import{findUp as I,readJson as S,findUpSync as b,readJsonSync as u,writeJson as A,writeJsonSync as v}from"@visulima/fs";import{NotFoundError as y}from"@visulima/fs/error";import{toPath as g,parseJson as N}from"@visulima/fs/utils";import{join as w}from"@visulima/path";import h from"normalize-package-data";const p=c(e=>{const r=typeof e;return e!==null&&(r==="object"||r==="function")},"isObject"),d=new Set(["__proto__","prototype","constructor"]),D=new Set("0123456789");function l(e){const r=[];let t="",n="start",a=!1;for(const o of e)switch(o){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");a&&(t+=o),n="property",a=!a;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(a){a=!1,t+=o;break}if(d.has(t))return[];r.push(t),t="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(a){a=!1,t+=o;break}if(n==="property"){if(d.has(t))return[];r.push(t),t=""}n="index";break}case"]":{if(n==="index"){r.push(Number.parseInt(t,10)),t="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!D.has(o))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),a&&(a=!1,t+="\\"),t+=o}}switch(a&&(t+="\\"),n){case"property":{if(d.has(t))return[];r.push(t);break}case"index":throw new Error("Index was not closed");case"start":{r.push("");break}}return r}c(l,"getPathSegments");function k(e,r){if(typeof r!="number"&&Array.isArray(e)){const t=Number.parseInt(r,10);return Number.isInteger(t)&&e[t]===e[r]}return!1}c(k,"isStringIndex");function f(e,r,t){if(!p(e)||typeof r!="string")return t===void 0?e:t;const n=l(r);if(n.length===0)return t;for(let a=0;a<n.length;a++){const o=n[a];if(k(e,o)?e=a===n.length-1?void 0:null:e=e[o],e==null){if(a!==n.length-1)return t;break}}return e===void 0?t:e}c(f,"getProperty");function x(e,r){if(!p(e)||typeof r!="string")return!1;const t=l(r);if(t.length===0)return!1;for(const n of t){if(!p(e)||!(n in e)||k(e,n))return!1;e=e[n]}return!0}c(x,"hasProperty");var _=Object.defineProperty,s=c((e,r)=>_(e,"name",{value:r,configurable:!0}),"s");const P=new Map,q=s(async(e,r={})=>{const t={type:"file"};e&&(t.cwd=e);const n=await I("package.json",t);if(!n)throw new y("No such file or directory, for package.json found.");const a=r.cache&&typeof r.cache!="boolean"?r.cache:P;if(r.cache&&a.has(n))return a.get(n);const o=await S(n);h(o);const i={packageJson:o,path:n};return a.set(n,i),i},"findPackageJson"),z=s((e,r={})=>{const t={type:"file"};e&&(t.cwd=e);const n=b("package.json",t);if(!n)throw new y("No such file or directory, for package.json found.");const a=r.cache&&typeof r.cache!="boolean"?r.cache:P;if(r.cache&&a.has(n))return a.get(n);const o=u(n);h(o);const i={packageJson:o,path:n};return a.set(n,i),i},"findPackageJsonSync"),B=s(async(e,r={})=>{const{cwd:t,...n}=r,a=g(r.cwd??process.cwd());await A(w(a,"package.json"),e,n)},"writePackageJson"),G=s((e,r={})=>{const{cwd:t,...n}=r,a=g(r.cwd??process.cwd());v(w(a,"package.json"),e,n)},"writePackageJsonSync"),H=s(e=>{const r=e!==null&&typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");const t=r?structuredClone(e):E(e)?u(e):N(e);return h(t),t},"parsePackageJson"),L=s((e,r,t)=>f(e,r,t),"getPackageJsonProperty"),Q=s((e,r)=>x(e,r),"hasPackageJsonProperty"),R=s((e,r,t)=>{const n=f(e,"dependencies",{}),a=f(e,"devDependencies",{}),o=f(e,"peerDependencies",{}),i={...n,...a,...t?.peerDeps===!1?{}:o};for(const J of r)if(x(i,J))return!0;return!1},"hasPackageJsonAnyDependency");export{q as findPackageJson,z as findPackageJsonSync,L as getPackageJsonProperty,R as hasPackageJsonAnyDependency,Q as hasPackageJsonProperty,H as parsePackageJson,B as writePackageJson,G as writePackageJsonSync};
|