提交 1166dc1a 编写于 作者: Z zengyawen

update docs

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 3e44d2a5
......@@ -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());
```
......@@ -86,8 +86,8 @@ callbackWrapper(original: Function): (err: Object, value: Object )=&gt;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) =&gt; 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&lt;Uint8Array&gt;
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&lt;string&gt;
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&lt;Uint8Array&gt;
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.
先完成此消息的编辑!
想要评论请 注册