提交 4151f0d4 编写于 作者: 雪洛's avatar 雪洛

fix: 修复createBLEConnection没有被promise化的Bug #1543

上级 c1b832fd
......@@ -12,14 +12,18 @@ const SYNC_API_RE =
const CONTEXT_API_RE = /^create|Manager$/
// Context例外情况
const CONTEXT_API_RE_EXC = ['createBLEConnection']
const TASK_APIS = ['request', 'downloadFile', 'uploadFile', 'connectSocket']
// 同步例外情况
const ASYNC_API = ['createBLEConnection']
const CALLBACK_API_RE = /^on|^off/
export function isContextApi (name) {
return CONTEXT_API_RE.test(name)
return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1
}
export function isSyncApi (name) {
return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1
......@@ -79,4 +83,4 @@ export function promisify (name, api) {
}), ...params)
})))
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册