mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
feat(globalyzer): new type definition (#43827)
- type definition - tests https://github.com/terkelg/globalyzer#api Thanks!
This commit is contained in:
parent
621363e730
commit
8d4dd52d26
@@ -0,0 +1,7 @@
|
||||
import globalyzer = require('globalyzer');
|
||||
|
||||
globalyzer('foo/bar/.git/'); // $ExpectType { base: string; glob: string; isGlob: boolean; }
|
||||
// => { base: 'foo/bar/.git/', glob: '', isGlob: false }
|
||||
|
||||
globalyzer('foo/bar/**/baz'); // $ExpectType { base: string; glob: string; isGlob: boolean; }
|
||||
// => { base: 'foo/bar', glob: '**/baz', isGlob: true }
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for globalyzer 0.1
|
||||
// Project: https://github.com/terkelg/globalyzer#readme
|
||||
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Detect and extract the static part of a glob string.
|
||||
* Utility to detect if a string contains a glob and then split it in a glob and none-glob part.
|
||||
* @param pattern - Glob string to analyze
|
||||
*/
|
||||
declare function globalyzer(
|
||||
glob: string,
|
||||
options?: {
|
||||
/**
|
||||
* Use strict parsing (be strict about what's a glob and what's not)
|
||||
* @default false
|
||||
*/
|
||||
strict?: boolean;
|
||||
},
|
||||
): {
|
||||
base: string;
|
||||
glob: string;
|
||||
isGlob: boolean;
|
||||
};
|
||||
|
||||
export = globalyzer;
|
||||
@@ -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",
|
||||
"globalyzer-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user