mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
added types for camelcase-keys-deep (#35458)
* added types for camelcase-keys-deep * Refactored test file and removed namespace declaration from index.d.ts
This commit is contained in:
parent
36e47f5333
commit
0efa64a8ba
15
types/camelcase-keys-deep/camelcase-keys-deep-tests.ts
Normal file
15
types/camelcase-keys-deep/camelcase-keys-deep-tests.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import camelcaseKeysDeep = require('camelcase-keys-deep');
|
||||
|
||||
interface Point {
|
||||
point_x: number;
|
||||
point_y: number;
|
||||
}
|
||||
|
||||
const foo: Point = {
|
||||
point_x: 1,
|
||||
point_y: 2,
|
||||
};
|
||||
|
||||
camelcaseKeysDeep(foo) as Point; // => {pointX: 1, pointY: 2}
|
||||
|
||||
camelcaseKeysDeep({ unicorn_rainbow: { foo_bar: 1 } }); // => unicornRainbow: {fooBar: 1}
|
||||
9
types/camelcase-keys-deep/index.d.ts
vendored
Normal file
9
types/camelcase-keys-deep/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Type definitions for camelcase-keys-deep 0.1
|
||||
// Project: https://github.com/rxaviers/camelcase-keys-deep
|
||||
// Definitions by: Søren Englund <https://github.com/englund0110>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
declare function camelcaseKeysDeep(obj: object): {};
|
||||
|
||||
export = camelcaseKeysDeep;
|
||||
23
types/camelcase-keys-deep/tsconfig.json
Normal file
23
types/camelcase-keys-deep/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"camelcase-keys-deep-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/camelcase-keys-deep/tslint.json
Normal file
1
types/camelcase-keys-deep/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user