🤖 Merge PR #46991 feat(jsonminify): expand module definition by @peterblazejewicz

- augment `JSON.minify` method
- amend tests for CMJ/globla scripts
- mantainer added

https://github.com/fkei/JSON.minify/blob/master/minify.json.js#L83-L92

Thanks!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz) 2020-08-24 21:48:18 +02:00 committed by GitHub
parent 0ea9a3ec80
commit 51ff4a7f33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 4 deletions

View File

@ -1,8 +1,21 @@
// Type definitions for jsonminify 0.4.1
// Project: https://github.com/fkei/JSON.minify
// Definitions by: Dan Homola <https://github.com/no23reason>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare global {
interface JSON {
/**
* minifies blocks of JSON-like content into valid JSON by removing all whitespace and comments.
*/
minify(json: string): string;
}
}
/**
* minifies blocks of JSON-like content into valid JSON by removing all whitespace and comments.
*/
declare function minify(json: string): string;
export = minify;

View File

@ -1,3 +0,0 @@
import jsonminify = require("jsonminify");
const minified: string = jsonminify('{ "foo": "bar" }');

View File

@ -0,0 +1,4 @@
import jsonminify = require('jsonminify');
jsonminify('{ "foo": "bar" }'); // $ExpectType string
JSON.minify('{ "foo": "bar" }'); // $ExpectType string

View File

@ -0,0 +1 @@
JSON.minify('{ "foo": "bar" }'); // $ExpectType string

View File

@ -18,6 +18,8 @@
},
"files": [
"index.d.ts",
"jsonminify-tests.ts"
"test/jsonminify-tests.cjs.ts",
"test/jsonminify-tests.global.ts"
]
}