mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-07 10:40:13 +00:00
[package-json] fix wrong return type
I made a mistake in my original PR https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21578 The function should return a promise. - https://www.npmjs.com/package/package-json - https://github.com/sindresorhus/package-json/blob/master/index.js#L30
This commit is contained in:
2
types/package-json/index.d.ts
vendored
2
types/package-json/index.d.ts
vendored
@@ -9,6 +9,6 @@ interface PackageJsonOptions {
|
||||
allVersions?: boolean;
|
||||
}
|
||||
|
||||
declare function packageJson(name: string, options?: PackageJsonOptions): {};
|
||||
declare function packageJson(name: string, options?: PackageJsonOptions): Promise<{}>;
|
||||
|
||||
export = packageJson;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import packageJson = require('package-json');
|
||||
|
||||
const pkg = packageJson('package-json', {
|
||||
let pkg: {};
|
||||
packageJson('package-json', {
|
||||
version: '1.2.3',
|
||||
fullMetadata: true,
|
||||
allVersions: true,
|
||||
}).then(x => {
|
||||
pkg = x;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user