mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix(dom) renameCurrent: try-to-promise RESTful.mv
This commit is contained in:
parent
6574d45939
commit
0b3348ee77
2 changed files with 23 additions and 10 deletions
11
common/try-to-promisify.js
Normal file
11
common/try-to-promisify.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
'use strict';
|
||||
|
||||
const {promisify} = require('es6-promisify');
|
||||
const tryToCatch = require('try-to-catch/legacy');
|
||||
|
||||
module.exports = (fn, ...args) => {
|
||||
const promise = promisify(fn);
|
||||
|
||||
return tryToCatch(promise, ...args);
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue