feat(replace): clone properties when morphing to new element

Closes #647
This commit is contained in:
Ricardo Matias 2017-01-11 15:22:32 +01:00 committed by Nico Rehwaldt
parent dc78c86551
commit af9a36b9b6
1 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,18 @@ var forEach = require('lodash/collection/forEach'),
contains = require('lodash/collection/contains');
function isAllowedIn(extProp, type) {
var allowedIn = extProp.meta.allowedIn;
// '*' is a wildcard, which means any element is allowed to use this property
if (allowedIn.length === 1 && allowedIn[0] === '*') {
return true;
}
return allowedIn.indexOf(type) !== -1;
}
function isAllowedIn(extProp, type) {
var allowedIn = extProp.meta.allowedIn;