@lowerdeck/programmable-promise 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ function e(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}exports.ProgrammablePromise=/*#__PURE__*/function(){function t(){var e=this;this._resolve=void 0,this._reject=void 0,this._promise=void 0,this._value=void 0,this._promise=new Promise(function(t,r){e._resolve=t,e._reject=r})}var r,i;return t.prototype.resolve=function(e){this._resolve(e),this._value=e},r=t,(i=[{key:"promise",get:function(){return this._promise}},{key:"reject",get:function(){return this._reject}},{key:"value",get:function(){return this._value}}])&&function(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r}();
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["export class ProgrammablePromise<T> {\n private _resolve!: (value: T | PromiseLike<T>) => void;\n private _reject!: (reason?: any) => void;\n private _promise: Promise<T>;\n private _value!: T;\n\n constructor() {\n this._promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n get promise() {\n return this._promise;\n }\n\n resolve(value: T | PromiseLike<T>) {\n this._resolve(value);\n this._value = value as T;\n }\n\n get reject() {\n return this._reject;\n }\n\n get value() {\n return this._value;\n }\n}\n"],"names":["ProgrammablePromise","_this","this","_resolve","_reject","_promise","_value","Promise","resolve","reject","_createClass","prototype","value","key","get"],"mappings":"wUAAgC,WAM9B,SAAAA,IAAA,IAAAC,EAAAC,KAAAA,KALQC,cAAQ,EAAAD,KACRE,aAAO,EAAAF,KACPG,cAAQ,EAAAH,KACRI,YAAM,EAGZJ,KAAKG,SAAW,IAAIE,QAAW,SAACC,EAASC,GACvCR,EAAKE,SAAWK,EAChBP,EAAKG,QAAUK,CACjB,EACF,CAAC,QASAC,OATAV,EAAAW,UAMDH,QAAA,SAAQI,GACNV,KAAKC,SAASS,GACdV,KAAKI,OAASM,CAChB,IAACZ,KAAAa,CAAAA,CAAAA,IAAAC,UAAAA,IAPD,WACE,OAAWZ,KAACG,QACd,GAAC,CAAAQ,IAAA,SAAAC,IAOD,WACE,OAAOZ,KAAKE,OACd,GAAC,CAAAS,IAAA,QAAAC,IAED,WACE,OAAOZ,KAAKI,MACd,iPAAC,CA5B6B"}
@@ -0,0 +1,12 @@
1
+ export declare class ProgrammablePromise<T> {
2
+ private _resolve;
3
+ private _reject;
4
+ private _promise;
5
+ private _value;
6
+ constructor();
7
+ get promise(): Promise<T>;
8
+ resolve(value: T | PromiseLike<T>): void;
9
+ get reject(): (reason?: any) => void;
10
+ get value(): T;
11
+ }
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAmB,CAAC,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAuC;IACvD,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,MAAM,CAAK;;IASnB,IAAI,OAAO,eAEV;IAED,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAKjC,IAAI,MAAM,cApBkB,GAAG,KAAK,IAAI,CAsBvC;IAED,IAAI,KAAK,MAER;CACF"}
@@ -0,0 +1,2 @@
1
+ function e(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}var t=/*#__PURE__*/function(){function t(){var e=this;this._resolve=void 0,this._reject=void 0,this._promise=void 0,this._value=void 0,this._promise=new Promise(function(t,r){e._resolve=t,e._reject=r})}var r,i;return t.prototype.resolve=function(e){this._resolve(e),this._value=e},r=t,(i=[{key:"promise",get:function(){return this._promise}},{key:"reject",get:function(){return this._reject}},{key:"value",get:function(){return this._value}}])&&function(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r}();export{t as ProgrammablePromise};
2
+ //# sourceMappingURL=index.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.module.js","sources":["../src/index.ts"],"sourcesContent":["export class ProgrammablePromise<T> {\n private _resolve!: (value: T | PromiseLike<T>) => void;\n private _reject!: (reason?: any) => void;\n private _promise: Promise<T>;\n private _value!: T;\n\n constructor() {\n this._promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n get promise() {\n return this._promise;\n }\n\n resolve(value: T | PromiseLike<T>) {\n this._resolve(value);\n this._value = value as T;\n }\n\n get reject() {\n return this._reject;\n }\n\n get value() {\n return this._value;\n }\n}\n"],"names":["ProgrammablePromise","_this","this","_resolve","_reject","_promise","_value","Promise","resolve","reject","_createClass","prototype","value","key","get"],"mappings":"+RAAa,IAAAA,eAAmB,WAM9B,SAAAA,IAAA,IAAAC,EAAAC,KAAAA,KALQC,cAAQ,EAAAD,KACRE,aAAO,EAAAF,KACPG,cAAQ,EAAAH,KACRI,YAAM,EAGZJ,KAAKG,SAAW,IAAIE,QAAW,SAACC,EAASC,GACvCR,EAAKE,SAAWK,EAChBP,EAAKG,QAAUK,CACjB,EACF,CAAC,QASAC,OATAV,EAAAW,UAMDH,QAAA,SAAQI,GACNV,KAAKC,SAASS,GACdV,KAAKI,OAASM,CAChB,IAACZ,KAAAa,CAAAA,CAAAA,IAAAC,UAAAA,IAPD,WACE,OAAWZ,KAACG,QACd,GAAC,CAAAQ,IAAA,SAAAC,IAOD,WACE,OAAOZ,KAAKE,OACd,GAAC,CAAAS,IAAA,QAAAC,IAED,WACE,OAAOZ,KAAKI,MACd,iPAAC,CA5B6B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).programmablePromise={})}(this,function(e){function t(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}e.ProgrammablePromise=/*#__PURE__*/function(){function e(){var e=this;this._resolve=void 0,this._reject=void 0,this._promise=void 0,this._value=void 0,this._promise=new Promise(function(t,r){e._resolve=t,e._reject=r})}var r,i;return e.prototype.resolve=function(e){this._resolve(e),this._value=e},r=e,(i=[{key:"promise",get:function(){return this._promise}},{key:"reject",get:function(){return this._reject}},{key:"value",get:function(){return this._value}}])&&function(e,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,t(o.key),o)}}(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r}()});
2
+ //# sourceMappingURL=index.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["export class ProgrammablePromise<T> {\n private _resolve!: (value: T | PromiseLike<T>) => void;\n private _reject!: (reason?: any) => void;\n private _promise: Promise<T>;\n private _value!: T;\n\n constructor() {\n this._promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n get promise() {\n return this._promise;\n }\n\n resolve(value: T | PromiseLike<T>) {\n this._resolve(value);\n this._value = value as T;\n }\n\n get reject() {\n return this._reject;\n }\n\n get value() {\n return this._value;\n }\n}\n"],"names":["ProgrammablePromise","_this","this","_resolve","_reject","_promise","_value","Promise","resolve","reject","_createClass","prototype","value","key","get"],"mappings":"+iBAAgC,WAM9B,SAAAA,IAAA,IAAAC,EAAAC,KAAAA,KALQC,cAAQ,EAAAD,KACRE,aAAO,EAAAF,KACPG,cAAQ,EAAAH,KACRI,YAAM,EAGZJ,KAAKG,SAAW,IAAIE,QAAW,SAACC,EAASC,GACvCR,EAAKE,SAAWK,EAChBP,EAAKG,QAAUK,CACjB,EACF,CAAC,QASAC,OATAV,EAAAW,UAMDH,QAAA,SAAQI,GACNV,KAAKC,SAASS,GACdV,KAAKI,OAASM,CAChB,IAACZ,KAAAa,CAAAA,CAAAA,IAAAC,UAAAA,IAPD,WACE,OAAWZ,KAACG,QACd,GAAC,CAAAQ,IAAA,SAAAC,IAOD,WACE,OAAOZ,KAAKE,OACd,GAAC,CAAAS,IAAA,QAAAC,IAED,WACE,OAAOZ,KAAKI,MACd,iPAAC,CA5B6B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowerdeck/programmable-promise",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,6 +14,12 @@
14
14
  "import": "./dist/index.module.js",
15
15
  "default": "./dist/index.module.js"
16
16
  },
17
+ "files": [
18
+ "src/**",
19
+ "dist/**",
20
+ "README.md",
21
+ "package.json"
22
+ ],
17
23
  "main": "./dist/index.cjs",
18
24
  "module": "./dist/index.module.js",
19
25
  "types": "dist/index.d.ts",
@@ -1,11 +0,0 @@
1
-
2
- $ microbundle
3
- Build "@lowerdeck/programmable-promise" to dist:
4
- 482 B: index.cjs.gz
5
- 417 B: index.cjs.br
6
- 173 B: index.module.js.gz
7
- 148 B: index.module.js.br
8
- 487 B: index.module.js.gz
9
- 418 B: index.module.js.br
10
- 555 B: index.umd.js.gz
11
- 480 B: index.umd.js.br
@@ -1,24 +0,0 @@
1
-
2
- $ vitest run --passWithNoTests
3
- [?25l
4
-  RUN  v3.2.4 /Users/tobias/code/metorial/metorial-enterprise/oss/src/packages/shared/programmable-promise
5
-
6
- [?2026h
7
-  ❯ src/index.test.ts [queued]
8
-
9
-  Test Files 0 passed (1)
10
-  Tests 0 passed (0)
11
-  Start at 10:23:27
12
-  Duration 101ms
13
- [?2026l ✓ src/index.test.ts (4 tests) 3ms
14
- ✓ ProgrammablePromise > should resolve with the provided value 1ms
15
- ✓ ProgrammablePromise > should reject with the provided reason 1ms
16
- ✓ ProgrammablePromise > should allow accessing the resolved value after resolution 0ms
17
- ✓ ProgrammablePromise > should not have a value before resolution 0ms
18
-
19
-  Test Files  1 passed (1)
20
-  Tests  4 passed (4)
21
-  Start at  10:23:27
22
-  Duration  217ms (transform 29ms, setup 0ms, collect 28ms, tests 3ms, environment 0ms, prepare 41ms)
23
-
24
- [?25h
package/CHANGELOG.md DELETED
@@ -1,13 +0,0 @@
1
- # @lowerdeck/programmable-promise
2
-
3
- ## 1.0.2
4
-
5
- ### Patch Changes
6
-
7
- - rebuild
8
-
9
- ## 1.0.1
10
-
11
- ### Patch Changes
12
-
13
- - Fix exports
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "@lowerdeck/tsconfig/base.json",
4
- "exclude": [
5
- "dist"
6
- ],
7
- "include": [
8
- "src"
9
- ],
10
- "compilerOptions": {
11
- "outDir": "dist"
12
- }
13
- }