🤖 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:
Yash Maheshwari
2022-07-12 10:27:46 +05:30
committed by GitHub
parent 908890a5ca
commit e72ad742bd
4 changed files with 46 additions and 0 deletions

12
types/node-json-transform/index.d.ts vendored Normal file
View 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 };

View 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" }

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",
"node-json-transform-tests.ts"
]
}

View File

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