This commit is contained in:
Tomasz Pluskiewicz
2020-03-27 13:30:17 -04:00
committed by GitHub
parent 48f8cf6bd1
commit ea2c63dc94
4 changed files with 51 additions and 0 deletions
+18
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;
+9
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']);
+23
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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }