Comparing version 2.0.2 to 3.0.0
@@ -0,1 +1,20 @@ | ||
# [3.0.0](https://github.com/rafamel/promist/compare/v2.0.2...v3.0.0) (2020-04-13) | ||
### Bug Fixes | ||
* **utils:** declares control w/ more permissive types for Generator ([3703e94](https://github.com/rafamel/promist/commit/3703e94e0d5548dd1cc66fedefa3def02902ad3c)) | ||
### chore | ||
* updates setup and dependencies ([a0454b4](https://github.com/rafamel/promist/commit/a0454b404e273713207e4317d2eada94f44ee27d)) | ||
### BREAKING CHANGES | ||
* Requires node +12 | ||
## [2.0.2](https://github.com/rafamel/promist/compare/v2.0.1...v2.0.2) (2020-02-13) | ||
@@ -2,0 +21,0 @@ |
@@ -6,26 +6,17 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | ||
export default function control(test, generator) { | ||
return ( | ||
/*#__PURE__*/ | ||
function () { | ||
var _ref = _asyncToGenerator(function* () { | ||
var iterator = generator(...arguments); | ||
var value; | ||
var done; | ||
var testRes; | ||
return /*#__PURE__*/_asyncToGenerator(function* () { | ||
var iterator = generator(...arguments); | ||
var value; | ||
var done; | ||
var testRes; | ||
while (!done && (testRes = yield test()) && !(testRes instanceof Error)) { | ||
var next = iterator.next((yield value)); | ||
value = next.value; | ||
done = next.done; | ||
} | ||
while (!done && (testRes = yield test()) && !(testRes instanceof Error)) { | ||
var next = iterator.next((yield value)); | ||
value = next.value; | ||
done = next.done; | ||
} | ||
if (testRes instanceof Error) throw testRes; | ||
return testRes ? value : new Promise(() => undefined); | ||
}); | ||
return function () { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}() | ||
); | ||
if (testRes instanceof Error) throw testRes; | ||
return testRes ? value : new Promise(() => undefined); | ||
}); | ||
} |
@@ -415,26 +415,17 @@ /** | ||
function control(test, generator) { | ||
return ( | ||
/*#__PURE__*/ | ||
function () { | ||
var _ref = _asyncToGenerator(function* () { | ||
var iterator = generator(...arguments); | ||
var value; | ||
var done; | ||
var testRes; | ||
return /*#__PURE__*/_asyncToGenerator(function* () { | ||
var iterator = generator(...arguments); | ||
var value; | ||
var done; | ||
var testRes; | ||
while (!done && (testRes = yield test()) && !(testRes instanceof Error)) { | ||
var next = iterator.next((yield value)); | ||
value = next.value; | ||
done = next.done; | ||
} | ||
while (!done && (testRes = yield test()) && !(testRes instanceof Error)) { | ||
var next = iterator.next((yield value)); | ||
value = next.value; | ||
done = next.done; | ||
} | ||
if (testRes instanceof Error) throw testRes; | ||
return testRes ? value : new Promise(() => undefined); | ||
}); | ||
return function () { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}() | ||
); | ||
if (testRes instanceof Error) throw testRes; | ||
return testRes ? value : new Promise(() => undefined); | ||
}); | ||
} | ||
@@ -441,0 +432,0 @@ |
@@ -1,1 +0,1 @@ | ||
export default function control<T, A extends any[]>(test: () => Promise<boolean | Error> | boolean | Error, generator: (...args: A) => Generator<Promise<T> | T, Promise<T> | T, T>): (...args: A) => Promise<T>; | ||
export default function control<T, A extends any[]>(test: () => Promise<boolean | Error> | boolean | Error, generator: (...args: A) => Generator<any, Promise<T> | T, any>): (...args: A) => Promise<T>; |
@@ -25,2 +25,2 @@ "use strict"; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy91dGlscy9jb250cm9sLnRzIl0sIm5hbWVzIjpbImNvbnRyb2wiLCJ0ZXN0IiwiZ2VuZXJhdG9yIiwiYXJncyIsIml0ZXJhdG9yIiwidmFsdWUiLCJkb25lIiwidGVzdFJlcyIsIkVycm9yIiwibmV4dCIsIlByb21pc2UiLCJ1bmRlZmluZWQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBZSxTQUFTQSxPQUFULENBQ2JDLElBRGEsRUFFYkMsU0FGYSxFQUdlO0FBQzVCLFNBQU8sT0F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6IGFueSA9IGl0ZXJhdG9yLm5leHQoYXdhaXQgdmFsdWUpO1xuICAgICAgdmFsdWUgPSBuZXh0LnZhbHVlO1xuICAgICAgZG9uZSA9IG5leHQuZG9uZTtcbiAgICB9XG5cbiAgICBpZiAodGVzdFJlcyBpbnN0YW5jZW9mIEVycm9yKSB0aHJvdyB0ZXN0UmVzO1xuICAgIHJldHVybiB0ZXN0UmVzID8gdmFsdWUgOiBuZXcgUHJvbWlzZSgoKSA9PiB1bmRlZmluZWQpO1xuICB9O1xufVxuIl19 |
{ | ||
"name": "promist", | ||
"description": "A dependable promises and async utility belt", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"license": "MIT", | ||
@@ -40,17 +40,17 @@ "files": [ | ||
"@pika/pack": "^0.4.0", | ||
"@pika/plugin-build-web": "^0.8.1", | ||
"@pika/plugin-standard-pkg": "^0.8.1", | ||
"@riseup/library": "^0.4.0", | ||
"@riseup/tooling": "^0.4.0", | ||
"@types/jest": "^25.1.2", | ||
"@pika/plugin-build-web": "^0.9.2", | ||
"@pika/plugin-standard-pkg": "^0.9.2", | ||
"@riseup/library": "^0.5.0", | ||
"@riseup/tooling": "^0.5.0", | ||
"@types/jest": "^25.2.1", | ||
"@zerollup/ts-transform-paths": "^1.7.11", | ||
"coveralls": "^3.0.9", | ||
"husky": "^4.2.3", | ||
"husky": "^4.2.5", | ||
"kpo": "^0.11.1", | ||
"onchange": "^6.0.0", | ||
"rxjs": "^6.5.4", | ||
"rxjs": "^6.5.5", | ||
"typescript": "^3.7.5" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=12" | ||
}, | ||
@@ -57,0 +57,0 @@ "esnext": "dist-src/index.js", |
@@ -1,2 +0,2 @@ | ||
# Promist | ||
# promist | ||
@@ -3,0 +3,0 @@ [![Version](https://img.shields.io/npm/v/promist.svg)](https://www.npmjs.com/package/promist) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158022
1678