mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 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:
parent
0ea9a3ec80
commit
51ff4a7f33
13
types/jsonminify/index.d.ts
vendored
13
types/jsonminify/index.d.ts
vendored
@ -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;
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
import jsonminify = require("jsonminify");
|
||||
|
||||
const minified: string = jsonminify('{ "foo": "bar" }');
|
||||
4
types/jsonminify/test/jsonminify-tests.cjs.ts
Normal file
4
types/jsonminify/test/jsonminify-tests.cjs.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import jsonminify = require('jsonminify');
|
||||
|
||||
jsonminify('{ "foo": "bar" }'); // $ExpectType string
|
||||
JSON.minify('{ "foo": "bar" }'); // $ExpectType string
|
||||
1
types/jsonminify/test/jsonminify-tests.global.ts
Normal file
1
types/jsonminify/test/jsonminify-tests.global.ts
Normal file
@ -0,0 +1 @@
|
||||
JSON.minify('{ "foo": "bar" }'); // $ExpectType string
|
||||
@ -18,6 +18,8 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jsonminify-tests.ts"
|
||||
"test/jsonminify-tests.cjs.ts",
|
||||
"test/jsonminify-tests.global.ts"
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user