@cicada/render
Advanced tools
Comparing version 1.1.17 to 1.1.18
@@ -60,3 +60,4 @@ 'use strict'; | ||
return { | ||
value: '' | ||
value: '', | ||
undefinedCheck: 'undefinedCheck' | ||
}; | ||
@@ -102,3 +103,4 @@ }, | ||
return { | ||
value: s.get('demo').value | ||
value: s.get('demo').value, | ||
undefinedCheck: undefined | ||
}; | ||
@@ -113,2 +115,3 @@ }] | ||
expect(stateTree.get('demo2.value')).toBe('aaa'); | ||
expect(stateTree.get('demo2.undefinedCheck')).toBe('undefinedCheck'); | ||
}); |
@@ -11,2 +11,10 @@ 'use strict'; | ||
var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); | ||
var _defineProperty3 = _interopRequireDefault(_defineProperty2); | ||
var _assign = require('babel-runtime/core-js/object/assign'); | ||
var _assign2 = _interopRequireDefault(_assign); | ||
exports.initialize = initialize; | ||
@@ -23,2 +31,8 @@ exports.check = check; | ||
function filterUndefined(obj) { | ||
return (0, _util.reduce)(obj, function (last, val, key) { | ||
return val === undefined ? last : (0, _assign2.default)(last, (0, _defineProperty3.default)({}, key, val)); | ||
}); | ||
} | ||
function initialize(utilInstances, stateTree) { | ||
@@ -48,3 +62,3 @@ var stateIdToMapFns = {}; | ||
}); | ||
return (0, _util.compose)(injectedFns)((0, _extends3.default)({}, utilInstances, { state: state, statePath: new _common.StatePath(statePath), nextState: {} })).nextState; | ||
return filterUndefined((0, _util.compose)(injectedFns)((0, _extends3.default)({}, utilInstances, { state: state, statePath: new _common.StatePath(statePath), nextState: {} })).nextState); | ||
} | ||
@@ -51,0 +65,0 @@ |
{ | ||
"name": "@cicada/render", | ||
"version": "1.1.17", | ||
"version": "1.1.18", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
400024
9710