Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
1166dc1a
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1166dc1a
编写于
2月 15, 2022
作者:
Z
zengyawen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
zengyawen
<
zengyawen1@huawei.com
>
上级
3e44d2a5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
13 deletion
+12
-13
en/application-dev/reference/apis/js-apis-util.md
en/application-dev/reference/apis/js-apis-util.md
+6
-7
zh-cn/application-dev/reference/apis/js-apis-util.md
zh-cn/application-dev/reference/apis/js-apis-util.md
+6
-6
未找到文件。
en/application-dev/reference/apis/js-apis-util.md
浏览文件 @
1166dc1a
...
...
@@ -193,8 +193,8 @@ Calls back an asynchronous function. In the callback, the first parameter indica
}
var cb = util.callbackWrapper(promiseFn);
cb((err, ret) => {
expect(err).strictEqual('value'
);
expect(ret).strictEqual(undefined
);
console.log(err
);
console.log(ret
);
})
```
...
...
@@ -259,7 +259,7 @@ Processes an asynchronous function and returns a promise version.
}
let newPromiseObj = util.promiseWrapper(aysnFun)("Hello", 'World');
newPromiseObj.then(res => {
expect(res).strictEqual('HelloWorld'
);
console.log(res
);
})
```
...
...
@@ -3054,7 +3054,7 @@ Encodes the input content asynchronously.
var rarray = new Uint8Array([99,122,69,122]);
await that.encode(array).then(val=>{
for (var i = 0; i < rarray.length; i++) {
expect(val[i]).assertEqual(rarray
[i])
console.log(val
[i])
}
})
done();
...
...
@@ -3115,7 +3115,7 @@ Encodes the input content asynchronously into a string.
var that = new util.Base64();
var array = new Uint8Array([115,49,51]);
await that.encodeToString(array).then(val=>{
expect(val).assertEqual('czEz'
)
console.log(val
)
})
done();
```
...
...
@@ -3177,7 +3177,7 @@ Decodes the input content asynchronously.
var rarray = new Uint8Array([115,49,51]);
await that.decode(array).then(val=>{
for (var i = 0; i < rarray.length; i++) {
expect(val[i]).assertEqual(rarray
[i])
console.log(val
[i])
}
})
done();
...
...
@@ -5174,4 +5174,3 @@ Checks whether the input value is of the **WeakSet** type.
var result = that.isWeakSet(new WeakSet());
```
zh-cn/application-dev/reference/apis/js-apis-util.md
浏览文件 @
1166dc1a
...
...
@@ -86,8 +86,8 @@ callbackWrapper(original: Function): (err: Object, value: Object )=>void
}
var
cb
=
util
.
callbackWrapper
(
promiseFn
);
cb
((
err
,
ret
)
=>
{
expect
(
err
)
.
strictEqual
(
'value'
);
expect
(
ret
)
.
strictEqual
(
undefined
);
console
.
log
(
err
);
console
.
log
(
ret
);
})
```
...
...
@@ -119,7 +119,7 @@ promiseWrapper(original: (err: Object, value: Object) => void): Object
}
let newPromiseObj = util.promiseWrapper(aysnFun)("Hello", 'World');
newPromiseObj.then(res => {
expect(res).strictEqual('HelloWorld'
);
console.log(res
);
})
```
...
...
@@ -1426,7 +1426,7 @@ encode(src:Uint8Array):Promise<Uint8Array>
var rarray = new Uint8Array([99,122,69,122]);
that.encode(array).then(val=>{
for (var i = 0; i < rarray.length; i++) {
expect(val[i]).assertEqual(rarray
[i])
console.log(val
[i])
}
})
```
...
...
@@ -1453,7 +1453,7 @@ encodeToString(src:Uint8Array):Promise<string>
var that = new util.Base64();
var array = new Uint8Array([115,49,51]);
that.encodeToString(array).then(val=>{
expect(val).assertEqual('czEz'
)
console.log(val
)
})
```
...
...
@@ -1481,7 +1481,7 @@ decode(src:Uint8Array | string):Promise<Uint8Array>
var rarray = new Uint8Array([115,49,51]);
that.decode(array).then(val=>{
for (var i = 0; i < rarray.length; i++) {
expect(val[i]).assertEqual(rarray
[i])
console.log(val
[i])
}
})
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录