Initial Save

This commit is contained in:
jackbeeby
2025-03-28 12:30:19 +11:00
parent e381994f19
commit d8773925e8
9910 changed files with 982718 additions and 0 deletions

13
node_modules/@josephg/resolvable/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,13 @@
Copyright 2019 Joseph Gentle
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

19
node_modules/@josephg/resolvable/README.md generated vendored Normal file
View File

@@ -0,0 +1,19 @@
# Resolvable promise wrapper
This is a tiny promise wrapper which gives you promises which have explicit `promise.resolve()` / `promise.reject()` methods.
Eg:
```javascript
const resolvable = require('resolvable')
const myPromise = resolvable()
;(async () => {
doThingA()
await myPromise
doThingB()
})()
setTimeout(() => myPromise.resolve(), 1000)
```

6
node_modules/@josephg/resolvable/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export declare type Resolvable<T> = Promise<T> & {
resolve: (t: T) => void;
reject: (e: any) => void;
};
declare const resolvablePromise: <T = void>() => Resolvable<T>;
export default resolvablePromise;

16
node_modules/@josephg/resolvable/index.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const resolvablePromise = () => {
let resolve;
let reject;
const promise = new Promise((_resolve, _reject) => {
resolve = _resolve;
reject = _reject;
});
promise.resolve = resolve;
promise.reject = reject;
return promise;
};
exports.default = resolvablePromise;
module.exports = resolvablePromise;
//# sourceMappingURL=index.js.map

1
node_modules/@josephg/resolvable/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAIA,MAAM,iBAAiB,GAAG,GAA4B,EAAE;IACtD,IAAI,OAAyB,CAAA;IAC7B,IAAI,MAA0B,CAAA;IAC9B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;QACnD,OAAO,GAAG,QAAQ,CAAA;QAClB,MAAM,GAAG,OAAO,CAAA;IAClB,CAAC,CAAkB,CAAA;IACnB,OAAO,CAAC,OAAO,GAAG,OAAQ,CAAA;IAC1B,OAAO,CAAC,MAAM,GAAG,MAAO,CAAA;IACxB,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AACD,kBAAe,iBAAiB,CAAA;AAChC,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAAA"}

17
node_modules/@josephg/resolvable/index.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
export type Resolvable<T> = Promise<T> & {
resolve: (t: T) => void,
reject: (e: any) => void,
}
const resolvablePromise = <T = void>(): Resolvable<T> => {
let resolve: (val: T) => void
let reject: (err: any) => void
const promise = new Promise<T>((_resolve, _reject) => {
resolve = _resolve
reject = _reject
}) as Resolvable<T>
promise.resolve = resolve!
promise.reject = reject!
return promise
}
export default resolvablePromise
module.exports = resolvablePromise

21
node_modules/@josephg/resolvable/package.json generated vendored Normal file
View File

@@ -0,0 +1,21 @@
{
"name": "@josephg/resolvable",
"version": "1.0.1",
"description": "Promise with .resolve() and .reject() methods",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"prepare": "npm run build",
"build": "tsc"
},
"files": [
"index.*"
],
"repository": "git@github.com:josephg/resolvable.git",
"author": "Joseph Gentle <me@josephg.com>",
"license": "ISC",
"devDependencies": {
"@types/node": "^15.0.1",
"typescript": "^4.2.4"
}
}