DefinitelyTyped/types/pnpapi/pnpapi-tests.ts
Maël Nison 1fce2f26d6 Adds types for the pnpapi module (#36447)
* Adds types for the pnpapi module

* Fixes headers

* Fixes linting

* More linting;
2019-06-26 11:04:14 -07:00

16 lines
435 B
TypeScript

import * as pnp from 'pnpapi';
const information = pnp.getPackageInformation(pnp.topLevel);
const locator = pnp.findPackageLocator('/foo');
if (locator !== null) {
pnp.getPackageInformation(locator).packageDependencies;
}
const resolution1 = pnp.resolveRequest('lodash', '/foo');
let resolution2 = pnp.resolveToUnqualified('lodash', '/foo');
if (resolution2 !== null) {
resolution2 = pnp.resolveUnqualified(resolution2);
}