mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
15 lines
399 B
TypeScript
15 lines
399 B
TypeScript
import * as loadJsonFile from 'load-json-file';
|
|
|
|
function assert(actual: string, expected: string): void {
|
|
if (actual !== expected) {
|
|
throw new Error(`${JSON.stringify(actual)} !== ${JSON.stringify(expected)}`);
|
|
}
|
|
}
|
|
|
|
loadJsonFile('../package.json').then(pkg => {
|
|
assert(pkg.name, 'definitely-typed');
|
|
});
|
|
|
|
const pkg = loadJsonFile.sync('../package.json');
|
|
assert(pkg.name, 'definitely-typed');
|