mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #61178 feat(node-json-transform): Implemented types for node-json-transform by @ymaheshwari1
* Implemented: types for node-json-transform * Improved: the tests file to convert indentation to spaces * Improved: indentation
This commit is contained in:
12
types/node-json-transform/index.d.ts
vendored
Normal file
12
types/node-json-transform/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for node-json-transform 1.x
|
||||
// Project: https://github.com/bozzltron/node-json-transform
|
||||
// Definitions by: Yash Maheshwari <https://github.com/ymaheshwari1>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function DataTransform(data: any, map: any): any;
|
||||
|
||||
declare function transform(data: any, map: any, context?: any): any;
|
||||
|
||||
declare function transformAsync(data: any, map: any, context?: any): any;
|
||||
|
||||
export { DataTransform, transform, transformAsync };
|
||||
10
types/node-json-transform/node-json-transform-tests.ts
Normal file
10
types/node-json-transform/node-json-transform-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { transform } from "node-json-transform";
|
||||
|
||||
// Using transform method to convert the given json to expected json
|
||||
transform({
|
||||
text: "hello"
|
||||
}, {
|
||||
item: {
|
||||
message: "text"
|
||||
}
|
||||
}); // Result: { message: "hello" }
|
||||
23
types/node-json-transform/tsconfig.json
Normal file
23
types/node-json-transform/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",
|
||||
"node-json-transform-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/node-json-transform/tslint.json
Normal file
1
types/node-json-transform/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "@definitelytyped/dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user