You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

18 lines
452 B

'use strict';
/*!
* ignore
*/
module.exports = function cleanModifiedSubpaths(doc, path) {
var _modifiedPaths = Object.keys(doc.$__.activePaths.states.modify);
var _numModifiedPaths = _modifiedPaths.length;
var deleted = 0;
for (var j = 0; j < _numModifiedPaths; ++j) {
if (_modifiedPaths[j].indexOf(path + '.') === 0) {
delete doc.$__.activePaths.states.modify[_modifiedPaths[j]];
++deleted;
}
}
return deleted;
};