forked from olcxjas-softworks/LarpixClient
fix gitignore again
This commit is contained in:
parent
ce5a1e330b
commit
5da5c2afe2
3329 changed files with 364540 additions and 3 deletions
35
electron/node_modules/@capacitor/cli/dist/util/promise.js
generated
vendored
Normal file
35
electron/node_modules/@capacitor/cli/dist/util/promise.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.lazy = exports.LazyPromise = exports.allSerial = void 0;
|
||||
function allSerial(funcs) {
|
||||
return funcs.reduce((promise, func) => promise.then((result) => func().then((x) => result.concat(x))), Promise.resolve([]));
|
||||
}
|
||||
exports.allSerial = allSerial;
|
||||
class LazyPromise extends Promise {
|
||||
constructor(executor) {
|
||||
super(() => {
|
||||
/* ignore */
|
||||
});
|
||||
this._executor = executor;
|
||||
}
|
||||
then(onfulfilled, onrejected) {
|
||||
this._promise = this._promise || new Promise(this._executor);
|
||||
return this._promise.then(onfulfilled, onrejected);
|
||||
}
|
||||
catch(onrejected) {
|
||||
this._promise = this._promise || new Promise(this._executor);
|
||||
return this._promise.catch(onrejected);
|
||||
}
|
||||
}
|
||||
exports.LazyPromise = LazyPromise;
|
||||
function lazy(fn) {
|
||||
return new LazyPromise(async (resolve, reject) => {
|
||||
try {
|
||||
resolve(await fn());
|
||||
}
|
||||
catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.lazy = lazy;
|
||||
Loading…
Add table
Add a link
Reference in a new issue