This commit is contained in:
Tomasz Pluskiewicz 2020-03-27 18:30:17 +01:00 committed by GitHub
parent 48f8cf6bd1
commit ea2c63dc94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 0 deletions

18
types/matchdep/index.d.ts vendored Normal file
View File

@ -0,0 +1,18 @@
// Type definitions for matchdep 2.0
// Project: https://github.com/tkellen/js-matchdep
// Definitions by: tpluscode <https://github.com/tpluscode>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace matchdep {
type FilterConfig = string | object;
type FilterFunction = (pattern: string | string[], config?: FilterConfig) => string[];
}
declare const matchdep: {
readonly filter: matchdep.FilterFunction
readonly filterDev: matchdep.FilterFunction
readonly filterPeer: matchdep.FilterFunction
readonly filterAll: matchdep.FilterFunction
};
export = matchdep;

View File

@ -0,0 +1,9 @@
import matchdep = require('matchdep');
const packageJson = {};
const singlePattern = matchdep.filter('mini*');
const devDependencies = matchdep.filterDev('grunt-contrib-*', './package.json');
const peerDependencies = matchdep.filterPeer('foo-{bar,baz}', './some-other.json');
const all = matchdep.filterAll('*', packageJson);
const arrayPaterns = matchdep.filterAll(['*', '!grunt']);

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"matchdep-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }