mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat: Add types for group-array (#41819)
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
parent
013ce96de7
commit
06b82c4e40
12
types/group-array/group-array-tests.ts
Normal file
12
types/group-array/group-array-tests.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import groupArray = require("group-array");
|
||||
|
||||
const input = [
|
||||
{ tag: 'one', content: 'A' },
|
||||
{ tag: 'one', content: 'B' },
|
||||
{ tag: 'two', content: 'C' },
|
||||
{ tag: 'two', content: 'D' },
|
||||
{ tag: 'three', content: 'E' },
|
||||
{ tag: 'three', content: 'F' }
|
||||
];
|
||||
|
||||
groupArray(input, 'tag'); // $ExpectType object
|
||||
9
types/group-array/index.d.ts
vendored
Normal file
9
types/group-array/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Type definitions for group-array 1.0
|
||||
// Project: https://github.com/doowb/group-array
|
||||
// Definitions by: Richie Bendall <https://github.com/Richienb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function groupArray(arr: object[], ...props: string[]): object;
|
||||
declare function groupArray(arr: object[]): object[];
|
||||
|
||||
export = groupArray;
|
||||
23
types/group-array/tsconfig.json
Normal file
23
types/group-array/tsconfig.json
Normal 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",
|
||||
"group-array-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/group-array/tslint.json
Normal file
1
types/group-array/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user