augmentative-iterable
Advanced tools
Comparing version 1.5.6 to 1.5.7
## 1.5.6 | ||
## 1.5.7 | ||
* ae1cdb1 fix: optimizing resolveState | ||
## v1.5.6 | ||
* eacd06d 1.5.6 | ||
* cf9ffa3 fix: more micro optmizations | ||
@@ -4,0 +7,0 @@ ## v1.5.5 |
'use strict'; | ||
const { | ||
processActionResult, | ||
getAugmentIterable, | ||
@@ -19,18 +18,17 @@ getSkippedAugmentIterable, | ||
function stepResolveState( | ||
context, | ||
chain, | ||
wrapper, | ||
actionResult, | ||
augmentList, | ||
) { | ||
if (context.next !== augmentList.next) { | ||
processActionResult( | ||
chain, | ||
context, | ||
); | ||
if (wrapper.next !== augmentList.next) { | ||
const { type } = wrapper; | ||
if (type === YIELD) wrapper.result = actionResult; | ||
else if (!actionResult) wrapper.state = type; | ||
} | ||
if (context.state === YIELD && context.next) { | ||
const item = context.next; | ||
context.type = item.type; | ||
chain = item.action ? item.action(context.result) : context.result; | ||
if (wrapper.state === YIELD && wrapper.next) { | ||
const item = wrapper.next; | ||
wrapper.type = item.type; | ||
actionResult = item.action ? item.action(wrapper.result) : wrapper.result; | ||
} | ||
return chain; | ||
return actionResult; | ||
} | ||
@@ -37,0 +35,0 @@ |
'use strict'; | ||
const { | ||
processActionResult, | ||
getAugmentIterable, | ||
@@ -21,6 +20,6 @@ end, | ||
const actionResult = ai.action ? ai.action(wrapper.result) : wrapper.result; | ||
wrapper.type = ai.type; | ||
processActionResult(actionResult, wrapper); | ||
if (wrapper.state !== YIELD) { | ||
wrapper.currentAi = ai; | ||
const type = ai.type; | ||
if (type === YIELD) wrapper.result = actionResult; | ||
else if (!actionResult) { | ||
wrapper.state = type; | ||
return wrapper; | ||
@@ -27,0 +26,0 @@ } |
'use strict'; | ||
const { | ||
STOP, | ||
IGNORE, | ||
} = require('./augments-types'); | ||
@@ -20,18 +16,2 @@ const offsetSymbol = Symbol('offset'); | ||
function processActionResult( | ||
actionResult, | ||
wrapper, | ||
) { | ||
switch (wrapper.type) { | ||
case IGNORE: | ||
if (!actionResult) wrapper.state = IGNORE; | ||
break; | ||
case STOP: | ||
if (!actionResult) wrapper.state = STOP; | ||
break; | ||
default: | ||
wrapper.result = actionResult; | ||
} | ||
} | ||
function itClone(it) { | ||
@@ -108,3 +88,2 @@ let iteratorType; | ||
module.exports = { | ||
processActionResult, | ||
getAugmentIterable, | ||
@@ -111,0 +90,0 @@ getSkippedAugmentIterable, |
{ | ||
"name": "augmentative-iterable", | ||
"description": "This project is just a template for creation of new projects", | ||
"version": "1.5.6", | ||
"version": "1.5.7", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "author": { |
38163
807