From e1580370274a39061bb5ced6279d849fe97cc4d1 Mon Sep 17 00:00:00 2001 From: shikai-123 Date: Mon, 25 Jul 2022 18:39:48 +0800 Subject: [PATCH] Modify interface name issues:https://gitee.com/openharmony/js_util_module/issues/I5ISPI Signed-off-by: shikai-123 --- en/application-dev/reference/apis/js-apis-util.md | 8 ++++---- zh-cn/application-dev/reference/apis/js-apis-util.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-util.md b/en/application-dev/reference/apis/js-apis-util.md index abf2b4a31a..e0fcbc5689 100755 --- a/en/application-dev/reference/apis/js-apis-util.md +++ b/en/application-dev/reference/apis/js-apis-util.md @@ -105,7 +105,7 @@ Calls back an asynchronous function. In the callback, the first parameter indica promiseWrapper(original: (err: Object, value: Object) => void): Object > **Introduce**
-> Starting from API version 9, it is recommended to use [util.promisewrapper9 +] (\utilpromisewrapper9) instead. +> Deprecated starting from API version 9, it is recommended to use [util.promisify9 +] (\utilpromisify9) instead. Processes an asynchronous function and returns a promise version. @@ -132,9 +132,9 @@ Processes an asynchronous function and returns a promise version. }) ``` -## util.promiseWrapper9+ +## util.promisify9+ -promiseWrapper(original: (err: Object, value: Object) => void): Function +promisify(original: (err: Object, value: Object) => void): Function Processes an asynchronous function and returns a promise function. @@ -159,7 +159,7 @@ Processes an asynchronous function and returns a promise function. return str1 } } - let newPromiseObj = util.promiseWrapper(aysnFun); + let newPromiseObj = util.promisify(aysnFun); newPromiseObj({ err: "type error" }, {value:'HelloWorld'}).then(res => { console.log(res); }) diff --git a/zh-cn/application-dev/reference/apis/js-apis-util.md b/zh-cn/application-dev/reference/apis/js-apis-util.md index fd4425ef45..742e63da12 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-util.md +++ b/zh-cn/application-dev/reference/apis/js-apis-util.md @@ -104,7 +104,7 @@ callbackWrapper(original: Function): (err: Object, value: Object )=>void promiseWrapper(original: (err: Object, value: Object) => void): Object > **说明:**
-> 从API Version 9开始废弃,建议使用[util.promiseWrapper9+](#utilpromisewrapper9)替代。 +> 从API Version 9开始废弃,建议使用[util.promisify9+](#utilpromisify9)替代。 对异步函数处理并返回一个promise的版本。 @@ -131,9 +131,9 @@ promiseWrapper(original: (err: Object, value: Object) => void): Object }) ``` -## util.promiseWrapper9+ +## util.promisify9+ -promiseWrapper(original: (err: Object, value: Object) => void): Function +promisify(original: (err: Object, value: Object) => void): Function 对异步函数处理并返回一个promise的函数。 @@ -158,7 +158,7 @@ promiseWrapper(original: (err: Object, value: Object) => void): Function return str1 } } - let newPromiseObj = util.promiseWrapper(aysnFun); + let newPromiseObj = util.promisify(aysnFun); newPromiseObj({ err: "type error" }, {value:'HelloWorld'}).then(res => { console.log(res); }) -- GitLab