extra-generator
Advanced tools
Comparing version 0.2.20 to 0.2.21
@@ -13,17 +13,19 @@ "use strict"; | ||
exports.handleYieldedValuesAsync = void 0; | ||
const return_style_1 = require("return-style"); | ||
function handleYieldedValuesAsync(generator, fn) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
let { value, done } = yield generator.next(); | ||
let i = 0; | ||
while (!done) { | ||
let { value, done } = yield generator.next(); | ||
let i = 0; | ||
while (!done) { | ||
const result = yield (0, return_style_1.toResultAsync)(() => fn(value, i++)); | ||
if (result.isOk()) { | ||
; | ||
({ value, done } = yield generator.next(yield fn(value, i++))); | ||
({ value, done } = yield generator.next(result.unwrap())); | ||
} | ||
return value; | ||
else { | ||
; | ||
({ value, done } = yield generator.throw(result.unwrapErr())); | ||
} | ||
} | ||
catch (e) { | ||
generator.throw(e); | ||
throw e; | ||
} | ||
return value; | ||
}); | ||
@@ -30,0 +32,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.handleYieldedValues = void 0; | ||
const return_style_1 = require("return-style"); | ||
function handleYieldedValues(generator, fn) { | ||
try { | ||
let { value, done } = generator.next(); | ||
let i = 0; | ||
while (!done) { | ||
let { value, done } = generator.next(); | ||
let i = 0; | ||
while (!done) { | ||
const result = (0, return_style_1.toResult)(() => fn(value, i++)); | ||
if (result.isOk()) { | ||
; | ||
({ value, done } = generator.next(fn(value, i++))); | ||
({ value, done } = generator.next(result.unwrap())); | ||
} | ||
return value; | ||
else { | ||
; | ||
({ value, done } = generator.throw(result.unwrapErr())); | ||
} | ||
} | ||
catch (e) { | ||
generator.throw(e); | ||
throw e; | ||
} | ||
return value; | ||
} | ||
exports.handleYieldedValues = handleYieldedValues; | ||
//# sourceMappingURL=handle-yielded-values.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.handleYieldedValuesAsync = void 0; | ||
const return_style_1 = require("return-style"); | ||
async function handleYieldedValuesAsync(generator, fn) { | ||
try { | ||
let { value, done } = await generator.next(); | ||
let i = 0; | ||
while (!done) { | ||
let { value, done } = await generator.next(); | ||
let i = 0; | ||
while (!done) { | ||
const result = await (0, return_style_1.toResultAsync)(() => fn(value, i++)); | ||
if (result.isOk()) { | ||
; | ||
({ value, done } = await generator.next(await fn(value, i++))); | ||
({ value, done } = await generator.next(result.unwrap())); | ||
} | ||
return value; | ||
else { | ||
; | ||
({ value, done } = await generator.throw(result.unwrapErr())); | ||
} | ||
} | ||
catch (e) { | ||
generator.throw(e); | ||
throw e; | ||
} | ||
return value; | ||
} | ||
exports.handleYieldedValuesAsync = handleYieldedValuesAsync; | ||
//# sourceMappingURL=handle-yielded-values-async.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.handleYieldedValues = void 0; | ||
const return_style_1 = require("return-style"); | ||
function handleYieldedValues(generator, fn) { | ||
try { | ||
let { value, done } = generator.next(); | ||
let i = 0; | ||
while (!done) { | ||
let { value, done } = generator.next(); | ||
let i = 0; | ||
while (!done) { | ||
const result = (0, return_style_1.toResult)(() => fn(value, i++)); | ||
if (result.isOk()) { | ||
; | ||
({ value, done } = generator.next(fn(value, i++))); | ||
({ value, done } = generator.next(result.unwrap())); | ||
} | ||
return value; | ||
else { | ||
; | ||
({ value, done } = generator.throw(result.unwrapErr())); | ||
} | ||
} | ||
catch (e) { | ||
generator.throw(e); | ||
throw e; | ||
} | ||
return value; | ||
} | ||
exports.handleYieldedValues = handleYieldedValues; | ||
//# sourceMappingURL=handle-yielded-values.js.map |
{ | ||
"name": "extra-generator", | ||
"version": "0.2.20", | ||
"version": "0.2.21", | ||
"description": "", | ||
@@ -58,3 +58,2 @@ "keywords": [ | ||
"npm-run-all": "^4.1.5", | ||
"return-style": "^1.0.0", | ||
"rimraf": "^3.0.2", | ||
@@ -68,4 +67,5 @@ "standard-version": "^9.5.0", | ||
"dependencies": { | ||
"@blackglory/prelude": "^0.1.8" | ||
"@blackglory/prelude": "^0.1.8", | ||
"return-style": "^1.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
57812
19
852
2
+ Addedreturn-style@^1.0.0
- Removedextra-generator@0.2.23(transitive)