@polymer/iron-meta
Advanced tools
Comparing version 3.0.0-pre.4 to 3.0.0-pre.6
{ | ||
"name": "iron-meta", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "web-components", |
import '../polymer/polymer.js'; | ||
import { Polymer as Polymer$0 } from '../polymer/lib/legacy/polymer-fn.js'; | ||
@@ -12,3 +11,5 @@ /** | ||
*/ | ||
function IronMeta(options) { | ||
Polymer.IronMeta = function(options) { | ||
Polymer.IronMeta[' '](options); | ||
this.type = (options && options.type) || 'default'; | ||
@@ -19,7 +20,13 @@ this.key = options && options.key; | ||
} | ||
} | ||
}; | ||
IronMeta.types = {}; | ||
// This function is used to convince Closure not to remove constructor calls | ||
// for instances that are not held anywhere. For example, when | ||
// `new Polymer.IronMeta({...})` is used only for the side effect of adding | ||
// a value. | ||
Polymer.IronMeta[' '] = function(){}; | ||
IronMeta.prototype = { | ||
Polymer.IronMeta.types = {}; | ||
Polymer.IronMeta.prototype = { | ||
get value() { | ||
@@ -30,3 +37,3 @@ var type = this.type; | ||
if (type && key) { | ||
return IronMeta.types[type] && IronMeta.types[type][key]; | ||
return Polymer.IronMeta.types[type] && Polymer.IronMeta.types[type][key]; | ||
} | ||
@@ -40,3 +47,3 @@ }, | ||
if (type && key) { | ||
type = IronMeta.types[type] = IronMeta.types[type] || {}; | ||
type = Polymer.IronMeta.types[type] = Polymer.IronMeta.types[type] || {}; | ||
if (value == null) { | ||
@@ -54,3 +61,3 @@ delete type[key]; | ||
if (type) { | ||
const items = IronMeta.types[this.type]; | ||
var items = Polymer.IronMeta.types[this.type]; | ||
if (!items) { | ||
@@ -72,8 +79,6 @@ return []; | ||
export { IronMeta }; | ||
var metaDatas = Polymer.IronMeta.types; | ||
var metaDatas = IronMeta.types; | ||
Polymer({ | ||
Polymer$0({ | ||
is: 'iron-meta', | ||
@@ -129,3 +134,3 @@ | ||
__computeMeta: function(type, key, value) { | ||
var meta = new IronMeta({ | ||
var meta = new Polymer.IronMeta({ | ||
type: type, | ||
@@ -162,3 +167,3 @@ key: key | ||
byKey: function(key) { | ||
return new IronMeta({ | ||
return new Polymer.IronMeta({ | ||
type: this.type, | ||
@@ -165,0 +170,0 @@ key: key |
{ | ||
"name": "@polymer/iron-meta", | ||
"flat": true, | ||
"version": "3.0.0-pre.4", | ||
"version": "3.0.0-pre.6", | ||
"description": "Useful for sharing information across a DOM tree", | ||
@@ -20,8 +20,8 @@ "contributors": [ | ||
"dependencies": { | ||
"@polymer/polymer": "^3.0.0-pre.4" | ||
"@polymer/polymer": "^3.0.0-pre.6" | ||
}, | ||
"devDependencies": { | ||
"@polymer/paper-styles": "^3.0.0-pre.4", | ||
"@polymer/test-fixture": "^3.0.0-pre.4", | ||
"wct-browser-legacy": "0.0.1-pre.10", | ||
"@polymer/paper-styles": "^3.0.0-pre.6", | ||
"@polymer/test-fixture": "^3.0.0-pre.6", | ||
"wct-browser-legacy": "0.0.1-pre.11", | ||
"@webcomponents/webcomponentsjs": "^1.0.0" | ||
@@ -28,0 +28,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
24375
185