🤖 Merge PR #65898 Add typings for chai-match-pattern by @daedal-knickerbockers

* Add typings for lodash-match-pattern

* Add typings for chai-match-pattern

---------

Co-authored-by: Daniel Kneip <daniel.kneip@pagnos.com>
This commit is contained in:
Daniel Kneip
2023-06-28 22:33:28 +02:00
committed by GitHub
parent 4740ffd8bf
commit 4e99c4c87d
4 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import * as chaiMatchPattern from 'chai-match-pattern';
chai.use(chaiMatchPattern);
const _ = chaiMatchPattern.getLodashModule();
_.isDateString('foo');
chai.expect({ foo: 'bar' }).to.matchPattern({ foo: 'bar' });

23
types/chai-match-pattern/index.d.ts vendored Normal file
View File

@@ -0,0 +1,23 @@
// Type definitions for chai-match-pattern 1.3
// Project: https://github.com/mjhm/chai-match-pattern#readme
// Definitions by: Daniel Kneip <https://github.com/daedal-knickerbockers>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="chai" />
import * as matchPattern from 'lodash-match-pattern';
declare global {
namespace Chai {
interface Assertion {
matchPattern(pattern: string | object): Assertion;
}
}
}
declare const chaiMatchPattern: Chai.ChaiPlugin & {
getLodashModule: typeof matchPattern.getLodashModule;
use(lodashModule: typeof matchPattern): void;
};
export = chaiMatchPattern;

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",
"chai-match-pattern-tests.ts"
]
}

View File

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