cli: bit of reafactor for clarity in packageExports
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -30,7 +30,10 @@ export async function command() {
|
||||
|
||||
await Promise.all(
|
||||
packages.map(async ({ dir, packageJson }) => {
|
||||
let { exports: exp } = packageJson;
|
||||
let changed = false;
|
||||
let newPackageJson = packageJson;
|
||||
|
||||
let { exports: exp } = newPackageJson;
|
||||
if (!exp) {
|
||||
return;
|
||||
}
|
||||
@@ -38,9 +41,6 @@ export async function command() {
|
||||
throw new Error('Unexpected array in package.json exports field');
|
||||
}
|
||||
|
||||
let changed = false;
|
||||
let newPackageJson = packageJson;
|
||||
|
||||
// If exports is a string we rewrite it to an object to add package.json
|
||||
if (typeof exp === 'string') {
|
||||
changed = true;
|
||||
|
||||
Reference in New Issue
Block a user