How to use the metal.core.isString function in metal

To help you get started, we’ve selected a few metal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github metal / metal.js / src / SoyRenderer.js View on Github external
var attrs = object.map(component.getAttrs(names), function(key, value) {
			if (component.getAttrConfig(key).isHtml && core.isString(value)) {
				return SoyRenderer.sanitizeHtml(value);
			} else {
				return value;
			}
		});
		return object.mixin(data, attrs);
github LiferayCloud / marble / packages / marble-reading-progress / src / ReadingProgress.js View on Github external
setterItemsFn_(items) {
    for (let i = 0; i < items.length; i++) {
      if (core.isString(items[i])) {
        items[i] = {
          href: items[i],
        };
      }
      this.generateItemMissingData_(items[i]);
    }
    return items;
  }
github metal / metal.js / src / surfaces / SurfaceRenderer.js View on Github external
findElementInContent_(id, content) {
		content = core.isString(content) ? dom.buildFragment(content) : content;
		var firstChild = content.childNodes[0];
		if (firstChild && firstChild.id === id) {
			return firstChild;
		}
	}
github deprecate / metal-router / src / Router.js View on Github external
resolveComponentConstructor() {
		var componentConstructor = this.component;
		if (core.isString(componentConstructor)) {
			componentConstructor = ComponentRegistry.getConstructor(componentConstructor);
		}
		return componentConstructor;
	}
github metal / metal.js / src / ComponentCollector.js View on Github external
createComponent(componentNameOrCtor, opt_data) {
		var component = ComponentCollector.components[(opt_data || {}).id];
		if (!component) {
			var ConstructorFn = componentNameOrCtor;
			if (core.isString(ConstructorFn)) {
				ConstructorFn = ComponentRegistry.getConstructor(componentNameOrCtor);
			}
			component = new ConstructorFn(opt_data);
		}
		return component;
	}
github metal / metal.js / src / Attribute.js View on Github external
callFunction_(fn, args) {
		if (core.isString(fn)) {
			return this[fn].apply(this, args);
		} else if (core.isFunction(fn)) {
			return fn.apply(this, args);
		}
	}