Fixing Issues in Public Base Library (codecheck)

Signed-off-by: @lixingyang-li <lixingyang13@huawei.com>
https://gitee.com/openharmony/interface_sdk-js/issues/IB5ET9
This commit is contained in:
@lixingyang-li 2024-11-19 15:20:38 +08:00
parent b73b2b8f85
commit d01fde3f97

View File

@ -39,7 +39,7 @@ declare namespace json {
* @atomicservice
* @since 12
*/
type Transformer = (this: Object, key: string, value: Object) => Object | undefined | null
type Transformer = (this: Object, key: string, value: Object) => Object | undefined | null;
/**
* Converts a JavaScript Object Notation (JSON) string into an Object or null.
@ -48,7 +48,9 @@ declare namespace json {
* @param { Transformer } [reviver] - A function that transforms the results.
* @param {ParseOptions} options - The config of parse.
* @returns { Object | null } Return an Object, array, string, number, boolean, or null value corresponding to JSON text.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types; 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
@ -60,16 +62,20 @@ declare namespace json {
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
*
* @param { Object } value - A JavaScript value, usually an Object or array.
* @param { (number | string)[] | null } [replacer] - An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringify.
* @param { (number | string)[] | null } [replacer] - An array of strings and numbers that acts as an approved list
* for selecting the object properties that will be stringify.
* @param { string | number } [space] - Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
* @returns { string } Return a JSON text.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
function stringify(value: Object, replacer?: (number | string)[] | null, space?: string | number): string
function stringify(value: Object, replacer?: (number | string)[] | null, space?: string | number): string;
/**
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
@ -78,7 +84,10 @@ declare namespace json {
* @param { Transformer } [replacer] - A function that transforms the results.
* @param { string | number } [space] - Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
* @returns { string } Return a JSON text.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice