@glimmer/tracking
Advanced tools
Comparing version 0.14.0-alpha.12 to 0.14.0-alpha.13
@@ -37,3 +37,3 @@ "use strict"; | ||
if (tags.size === 0) return _reference.CONSTANT_TAG; | ||
return (0, _reference.combine)([...tags]); | ||
return (0, _reference.combine)(Array.from(tags)); | ||
} | ||
@@ -375,2 +375,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3RyYWNraW5nL3NyYy90cmFja2VkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztRQTJGZ0IsTyxHQUFBLE87UUEySkEsVSxHQUFBLFU7UUFpRkEsTyxHQUFBLE87UUF1Q0Esb0IsR0FBQSxvQjtRQUlBLE0sR0FBQSxNO1FBOEJBLGMsR0FBQSxjOztBQWhaaEI7O0FBQ0E7O0FBU0E7O0FBR0E7OztBQUdBLE1BQU0sT0FBTixDQUFhO0FBQWIsRUFBQSxXQUFBLEdBQUE7QUFDVSxTQUFBLElBQUEsR0FBTyxJQUFJLEdBQUosRUFBUDtBQVlUOztBQVZDLEVBQUEsR0FBRyxDQUFDLEdBQUQsRUFBUztBQUNWLFNBQUssSUFBTCxDQUFVLEdBQVYsQ0FBYyxHQUFkO0FBQ0Q7O0FBRUQsRUFBQSxPQUFPLEdBQUE7QUFDTCxRQUFJO0FBQUUsTUFBQTtBQUFGLFFBQVcsSUFBZjtBQUVBLFFBQUksSUFBSSxDQUFDLElBQUwsS0FBYyxDQUFsQixFQUFxQixPQUFPLHVCQUFQO0FBQ3JCLFdBQU8sd0JBQVEsQ0FBQyxHQUFHLElBQUosQ0FBUixDQUFQO0FBQ0Q7O0FBWlU7O0FBMkVQLFNBQVUsT0FBVixDQUFrQixHQUFHLElBQXJCLEVBQWdDO0FBQ3BDLE1BQUksQ0FBQyxNQUFELEVBQVMsR0FBVCxFQUFjLFVBQ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IG9uIHdyaXRlcy5cbiAgaWYgKGRlc2NyaXB0b3IpIHtcbiAgICBsZXQgeyBnZXQsIHZhbHVlIH0gPSBkZXNjcmlwdG9yO1xuXG4gICAgaWYgKGRlc2NyaXB0b3IuY29uZmlndXJhYmxlIHx8ICFoYXNPd25EZXNjcmlwdG9yKSB7XG4gICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkob2JqLCBrZXksIHtcbiAgICAgICAgY29uZmlndXJhYmxlOiBkZXNjcmlwdG9yLmNvbmZpZ3VyYWJsZSxcbiAgICAgICAgZW51bWVyYWJsZTogZGVzY3JpcHRvci5lbnVtZXJhYmxlLFxuXG4gICAgICAgIGdldCgpIHtcbiAgICAgICAgICBpZiAoZ2V0KSB7XG4gICAgICAgICAgICByZXR1cm4gZ2V0LmNhbGwodGhpcyk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgc2V0KCkge1xuICAgICAgICAgIHRocm93RXJyb3IodGhpcywga2V5KTtcbiAgICAgICAgfSxcbiAgICAgIH0pO1xuICAgIH1cbiAgfSBlbHNlIHtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkob2JqLCBrZXksIHtcbiAgICAgIHNldCgpIHtcbiAgICAgICAgdGhyb3dFcnJvcih0aGlzLCBrZXkpO1xuICAgICAgfSxcbiAgICB9KTtcbiAgfVxufVxuIl0sInNvdXJjZVJvb3QiOiIifQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3RyYWNraW5nL3NyYy90cmFja2VkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztRQTJGZ0IsTyxHQUFBLE87UUEySkEsVSxHQUFBLFU7UUFpRkEsTyxHQUFBLE87UUF1Q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AgICAgICAgZ2V0KCkge1xuICAgICAgICAgIGlmIChnZXQpIHtcbiAgICAgICAgICAgIHJldHVybiBnZXQuY2FsbCh0aGlzKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBzZXQoKSB7XG4gICAgICAgICAgdGhyb3dFcnJvcih0aGlzLCBrZXkpO1xuICAgICAgICB9LFxuICAgICAgfSk7XG4gICAgfVxuICB9IGVsc2Uge1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmosIGtleSwge1xuICAgICAgc2V0KCkge1xuICAgICAgICB0aHJvd0Vycm9yKHRoaXMsIGtleSk7XG4gICAgICB9LFxuICAgIH0pO1xuICB9XG59XG4iXSwic291cmNlUm9vdCI6IiJ9 |
@@ -146,3 +146,3 @@ "use strict"; | ||
if (tags.size === 0) return _reference.CONSTANT_TAG; | ||
return (0, _reference.combine)([].concat(tags)); | ||
return (0, _reference.combine)(Array.from(tags)); | ||
}; | ||
@@ -500,2 +500,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3RyYWNraW5nL3NyYy90cmFja2VkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztRQTJGTSxPLEdBQUEsTztRQTJKQSxVLEdBQUEsVTtRQWlGQSxPLEdBQUEsTztRQXVDQSxvQixHQUFBLG9CO1FBSUEsTSxHQUFBLE07UUE4QkEsYyxHQUFBLGM7O0FBaFpOOztBQUNBOztBQVNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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4iXSwic291cmNlUm9vdCI6IiJ9 |
@@ -18,3 +18,3 @@ import { DEBUG } from '@glimmer/env'; | ||
return CONSTANT_TAG; | ||
return combine([...tags]); | ||
return combine(Array.from(tags)); | ||
} | ||
@@ -311,2 +311,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhY2tlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3RyYWNraW5nL3NyYy90cmFja2VkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDckMsT0FBTyxFQUVMLFlBQVksRUFDWixZQUFZLEVBRVosT0FBTyxFQUNQLFlBQVksRUFDWixJQUFJLEVBQ0wsTUFBTSxvQkFBb0IsQ0FBQztBQUM1QixPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUc3Qzs7R0FFRztBQUNILE1BQU0sT0FBTztJQUFiO1FBQ1UsU0FBSSxHQUFHLElBQUksR0FBRyxFQUFPLENBQUM7SUFZaEMsQ0FBQztJQVZDLEdBQUcsQ0FBQyxHQUFRO1FBQ1YsSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDckIsQ0FBQztJQUVELE9BQU87UUFDTCxJQUFJLEVBQUUsSUFBSSxFQUFFLEdBQUcsSUFBSSxDQUFDO1FBRXBCLElBQUksSUFBSSxDQUFDLElBQUksS0FBSyxDQUFDO1lBQUUsT0FBTyxZQUFZLENBQUM7UUFDekMsT0FBTyxPQUFPLENBQUMsQ0FBQyxHQUFHLElBQUksQ0FBQyxDQUFDLENBQUM7SUFDNUIsQ0FBQztDQUNGO0FBOERELE1BQU0sVUFBVSxPQUFPLENBQ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sZTogZGVzY3JpcHRvci5jb25maWd1cmFibGUsXG4gICAgICAgIGVudW1lcmFibGU6IGRlc2NyaXB0b3IuZW51bWVyYWJsZSxcblxuICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgaWYgKGdldCkge1xuICAgICAgICAgICAgcmV0dXJuIGdldC5jYWxsKHRoaXMpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIHNldCgpIHtcbiAgICAgICAgICB0aHJvd0Vycm9yKHRoaXMsIGtleSk7XG4gICAgICAgIH0sXG4gICAgICB9KTtcbiAgICB9XG4gIH0gZWxzZSB7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KG9iaiwga2V5LCB7XG4gICAgICBzZXQoKSB7XG4gICAgICAgIHRocm93RXJyb3IodGhpcywga2V5KTtcbiAgICAgIH0sXG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhY2tlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3RyYWNraW5nL3NyYy90cmFja2VkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDckMsT0FBTyxFQUVMLFlBQVksRUFDWixZQUFZLEVBRVosT0FBTyxFQUNQLFlBQVksRUFDWixJQUFJLEVBQ0wsTUFBTSxvQkFBb0IsQ0FBQztBQUM1QixPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUc3Qzs7R0FFRztBQUNILE1BQU0sT0FBTztJQUFiO1FBQ1UsU0FBSSxHQUFHLElBQUksR0FBRyxFQUFP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cmdldCk7XG4gIH1cblxuICAvLyBJZiBwb3NzaWJsZSwgZGVmaW5lIGEgcHJvcGVydHkgZGVzY3JpcHRvciB0aGF0IHBhc3NlcyB0aHJvdWdoIHRoZSBjdXJyZW50XG4gIC8vIHZhbHVlIG9uIHJlYWRzIGJ1dCB0aHJvd3MgYW4gZXhjZXB0aW9uIG9uIHdyaXRlcy5cbiAgaWYgKGRlc2NyaXB0b3IpIHtcbiAgICBsZXQgeyBnZXQsIHZhbHVlIH0gPSBkZXNjcmlwdG9yO1xuXG4gICAgaWYgKGRlc2NyaXB0b3IuY29uZmlndXJhYmxlIHx8ICFoYXNPd25EZXNjcmlwdG9yKSB7XG4gICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkob2JqLCBrZXksIHtcbiAgICAgICAgY29uZmlndXJhYmxlOiBkZXNjcmlwdG9yLmNvbmZpZ3VyYWJsZSxcbiAgICAgICAgZW51bWVyYWJsZTogZGVzY3JpcHRvci5lbnVtZXJhYmxlLFxuXG4gICAgICAgIGdldCgpIHtcbiAgICAgICAgICBpZiAoZ2V0KSB7XG4gICAgICAgICAgICByZXR1cm4gZ2V0LmNhbGwodGhpcyk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgc2V0KCkge1xuICAgICAgICAgIHRocm93RXJyb3IodGhpcywga2V5KTtcbiAgICAgICAgfSxcbiAgICAgIH0pO1xuICAgIH1cbiAgfSBlbHNlIHtcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkob2JqLCBrZXksIHtcbiAgICAgIHNldCgpIHtcbiAgICAgICAgdGhyb3dFcnJvcih0aGlzLCBrZXkpO1xuICAgICAgfSxcbiAgICB9KTtcbiAgfVxufVxuIl19 |
@@ -40,3 +40,3 @@ function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } | ||
if (tags.size === 0) return CONSTANT_TAG; | ||
return _combine([].concat(tags)); | ||
return _combine(Array.from(tags)); | ||
}; | ||
@@ -388,2 +388,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL3RyYWNraW5nL3NyYy90cmFja2VkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxTQUFTLEtBQVQsUUFBc0IsY0FBdEI7QUFDQSxTQUVFLFlBRkYsRUFHRSxZQUhGLEVBS0UsT0FBTyxJQUFQLFFBTEYsRUFNRSxZQU5GLEVBT0UsSUFQRixRQVFPLG9CQVJQO0FBU0EsU0FBUyxJQUFULEVBQWUsTUFBZixRQUE2QixlQUE3QjtBQUdBOzs7O0lBR00sTzs7O0FBQU4scUJBQUE7QUFDVSxTQUFBLElBQUEsR0FBTyxJQUFJLEdBQUosRUFBUDtBQVlUOzs7O1NBVkMsRyxHQUFBLGFBQUksR0FBSixFQUFZO0FBQ1YsU0FBSyxJQUFMLENBQVUsR0FBVixDQUFjLEdBQWQ7QUFDRCxHOztTQUVELE8sR0FBQSxtQkFBTztBQUFBLFFBQ0MsSUFERCxHQUNVLElBRFYsQ0FDQyxJQUREO0FBR0wsUUFBSSxJQUFJLENBQUMsSUFBTCxLQUFjLENBQWxCLEVBQXFCLE9BQU8sWUFBUDtBQUNyQixXQUFPLFFBQU8sV0FBSyxJQUFMLEVBQWQ7QUFDRCxHOzs7OztBQStESCxPQUFNLFNBQVUsT0FBVixHQUFnQztBQUFBLG9DQUFYLElBQVc7QUFBWCxJQUFBLElBQVc7QUFBQTs7QUFBQSxNQUMvQixNQUQrQixHQUNKLElBREk7QUFBQ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AgICB0YXJnZXQgPSBPYmplY3QuZ2V0UHJvdG90eXBlT2YodGFyZ2V0KTtcbiAgfVxuXG4gIC8vIElmIHBvc3NpYmxlLCBkZWZpbmUgYSBwcm9wZXJ0eSBkZXNjcmlwdG9yIHRoYXQgcGFzc2VzIHRocm91Z2ggdGhlIGN1cnJlbnRcbiAgLy8gdmFsdWUgb24gcmVhZHMgYnV0IHRocm93cyBhbiBleGNlcHRpb24gb24gd3JpdGVzLlxuICBpZiAoZGVzY3JpcHRvcikge1xuICAgIGxldCB7IGdldCwgdmFsdWUgfSA9IGRlc2NyaXB0b3I7XG5cbiAgICBpZiAoZGVzY3JpcHRvci5jb25maWd1cmFibGUgfHwgIWhhc093bkRlc2NyaXB0b3IpIHtcbiAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmosIGtleSwge1xuICAgICAgICBjb25maWd1cmFibGU6IGRlc2NyaXB0b3IuY29uZmlndXJhYmxlLFxuICAgICAgICBlbnVtZXJhYmxlOiBkZXNjcmlwdG9yLmVudW1lcmFibGUsXG5cbiAgICAgICAgZ2V0KCkge1xuICAgICAgICAgIGlmIChnZXQpIHtcbiAgICAgICAgICAgIHJldHVybiBnZXQuY2FsbCh0aGlzKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBzZXQoKSB7XG4gICAgICAgICAgdGhyb3dFcnJvcih0aGlzLCBrZXkpO1xuICAgICAgICB9LFxuICAgICAgfSk7XG4gICAgfVxuICB9IGVsc2Uge1xuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmosIGtleSwge1xuICAgICAgc2V0KCkge1xuICAgICAgICB0aHJvd0Vycm9yKHRoaXMsIGtleSk7XG4gICAgICB9LFxuICAgIH0pO1xuICB9XG59XG4iXSwic291cmNlUm9vdCI6IiJ9 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,ey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Y2VwdGlvbiBvbiB3cml0ZXMuXG4gIGlmIChkZXNjcmlwdG9yKSB7XG4gICAgbGV0IHsgZ2V0LCB2YWx1ZSB9ID0gZGVzY3JpcHRvcjtcblxuICAgIGlmIChkZXNjcmlwdG9yLmNvbmZpZ3VyYWJsZSB8fCAhaGFzT3duRGVzY3JpcHRvcikge1xuICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KG9iaiwga2V5LCB7XG4gICAgICAgIGNvbmZpZ3VyYWJsZTogZGVzY3JpcHRvci5jb25maWd1cmFibGUsXG4gICAgICAgIGVudW1lcmFibGU6IGRlc2NyaXB0b3IuZW51bWVyYWJsZSxcblxuICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgaWYgKGdldCkge1xuICAgICAgICAgICAgcmV0dXJuIGdldC5jYWxsKHRoaXMpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIHNldCgpIHtcbiAgICAgICAgICB0aHJvd0Vycm9yKHRoaXMsIGtleSk7XG4gICAgICAgIH0sXG4gICAgICB9KTtcbiAgICB9XG4gIH0gZWxzZSB7XG4gICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KG9iaiwga2V5LCB7XG4gICAgICBzZXQoKSB7XG4gICAgICAgIHRocm93RXJyb3IodGhpcywga2V5KTtcbiAgICAgIH0sXG4gICAgfSk7XG4gIH1cbn1cbiJdLCJzb3VyY2VSb290IjoiIn0= |
{ | ||
"name": "@glimmer/tracking", | ||
"version": "0.14.0-alpha.12", | ||
"version": "0.14.0-alpha.13", | ||
"description": "Glimmer property tracking library", | ||
@@ -25,3 +25,3 @@ "contributors": [ | ||
"devDependencies": { | ||
"@glimmer/application-test-helpers": "^0.14.0-alpha.12", | ||
"@glimmer/application-test-helpers": "^0.14.0-alpha.13", | ||
"@glimmer/compiler": "^0.41.0", | ||
@@ -28,0 +28,0 @@ "@glimmer/interfaces": "^0.41.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
180226
13
1547
1