Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 24, 2019
1 parent 8a3fcef commit a45019a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ declare namespace readPkg {
@default true
*/
normalize?: boolean;
readonly normalize?: boolean;

/**
Current working directory.
@default process.cwd()
*/
cwd?: string;
readonly cwd?: string;
}

interface NormalizeOptions extends Options {
normalize: true;
readonly normalize: true;
}

type NormalizedPackageJson = PackageJson & normalize.Package;
Expand Down
4 changes: 2 additions & 2 deletions index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ expectType<Promise<readPkg.PackageJson>>(readPkg({normalize: false}));
expectError<Promise<readPkg.NormalizedPackageJson>>(
readPkg({normalize: false})
);
expectType<Promise<readPkg.PackageJson>>(readPkg({cwd: './'}));
expectType<Promise<readPkg.PackageJson>>(readPkg({cwd: '.'}));

expectType<readPkg.NormalizedPackageJson>(readPkg.sync());
expectType<readPkg.NormalizedPackageJson>(readPkg.sync({normalize: true}));
expectType<readPkg.PackageJson>(readPkg.sync({normalize: false}));
expectError<readPkg.NormalizedPackageJson>(readPkg.sync({normalize: false}));
expectType<readPkg.PackageJson>(readPkg.sync({cwd: './'}));
expectType<readPkg.PackageJson>(readPkg.sync({cwd: '.'}));
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"fs",
"graceful",
"load",
"pkg",
"package",
"normalize"
],
Expand Down

0 comments on commit a45019a

Please sign in to comment.