mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
20 lines
530 B
TypeScript
20 lines
530 B
TypeScript
"use strict";
|
|
|
|
import finder = require("find-package-json");
|
|
|
|
const f = finder();
|
|
const fDirname = finder(__dirname);
|
|
const fModule: finder.FinderIterator = finder(module);
|
|
|
|
const findResult = f.next();
|
|
|
|
if (findResult.done) {
|
|
const res: finder.Done = findResult;
|
|
const value: undefined = findResult.value;
|
|
const filename: undefined = findResult.filename;
|
|
} else {
|
|
const res: finder.FoundPackage = findResult;
|
|
const value: finder.Package = findResult.value;
|
|
const filename: string = findResult.filename;
|
|
}
|