mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 11:51:10 +08:00
16 lines
444 B
TypeScript
16 lines
444 B
TypeScript
/// <reference path="load-json-file.d.ts" />
|
|
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');
|