|
@@ -122,6 +122,17 @@ function extend (...objs) {
|
|
return Object.assign.apply(this, [{}].concat(objs))
|
|
return Object.assign.apply(this, [{}].concat(objs))
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * Runs an array of promise-returning functions in sequence.
|
|
|
|
+ */
|
|
|
|
+function runPromiseSequence (functions, ...args) {
|
|
|
|
+ let promise = Promise.resolve()
|
|
|
|
+ functions.forEach((func) => {
|
|
|
|
+ promise = promise.then(() => func(...args))
|
|
|
|
+ })
|
|
|
|
+ return promise
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Takes function or class, returns its name.
|
|
* Takes function or class, returns its name.
|
|
* Because IE doesn’t support `constructor.name`.
|
|
* Because IE doesn’t support `constructor.name`.
|
|
@@ -395,6 +406,7 @@ module.exports = {
|
|
// $,
|
|
// $,
|
|
// $$,
|
|
// $$,
|
|
extend,
|
|
extend,
|
|
|
|
+ runPromiseSequence,
|
|
supportsMediaRecorder,
|
|
supportsMediaRecorder,
|
|
isTouchDevice,
|
|
isTouchDevice,
|
|
getFileNameAndExtension,
|
|
getFileNameAndExtension,
|