feat: buildCondition

This commit is contained in:
cha0s 2019-04-21 21:33:01 -05:00
parent ce6d2a69ee
commit 39bd4f472a
2 changed files with 16 additions and 1 deletions

View File

@ -34,3 +34,13 @@ export function buildValue(value) {
value,
};
}
export function buildCondition(operator, operands) {
return {
type: 'condition',
operator,
operands: operands.map((operand) => {
return buildValue(operand);
}),
};
}

View File

@ -8,4 +8,9 @@ export {
fromJSON as behaviorItemFromJSON,
register as registerBehaviorItem
} from './item/registry';
export {buildInvoke, buildTraversal} from './builders';
export {
buildCondition,
buildInvoke,
buildTraversal,
buildValue,
} from './builders';