How to use the metal.isFunction 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 LiferayCloud / magnet / src / plugin / function.js View on Github external
test(module, filename, magnet) {
    return (
      !isMultiple(module) &&
      isObject(module.route) &&
      isFunction(module.default)
    );
  },
github metal / metal.js / packages / metal-soy / src / Soy.js View on Github external
buildTemplateData_(component, params) {
		const data = object.mixin({}, this.getConfig(component));
		component.getStateKeys().forEach(key => {
			let value = component[key];
			if (this.isHtmlParam_(component, key)) {
				value = soyRenderer.toIncDom(value);
			}
			data[key] = value;
		});

		for (let i = 0; i < params.length; i++) {
			if (!data[params[i]] && isFunction(component[params[i]])) {
				data[params[i]] = component[params[i]].bind(component);
			}
		}

		if (isFunction(component.prepareStateForRender)) {
			return component.prepareStateForRender(data) || data;
		} else {
			return data;
		}
	}
github LiferayCloud / magnet / src / build / client.js View on Github external
async function maybeSetupPluginsWebpack_(magnet) {
  try {
    for (const plugin of magnet.getPlugins()) {
      if (isFunction(plugin.webpackConfig)) {
        magnet.webpackConfig = await plugin.webpackConfig(
          magnet.webpackConfig,
          magnet
        );
      }
    }
  } catch (error) {
    log.error(false, error);
  }
}
github metal / metal.js / packages / metal-events / src / EventEmitter.js View on Github external
validateListener_(listener) {
		if (!isFunction(listener)) {
			throw new TypeError('Listener must be a function');
		}
	}
}
github metal / metal.js / packages / metal-soy / src / Soy.js View on Github external
const data = object.mixin({}, this.getConfig(component));
		component.getStateKeys().forEach(key => {
			let value = component[key];
			if (this.isHtmlParam_(component, key)) {
				value = soyRenderer.toIncDom(value);
			}
			data[key] = value;
		});

		for (let i = 0; i < params.length; i++) {
			if (!data[params[i]] && isFunction(component[params[i]])) {
				data[params[i]] = component[params[i]].bind(component);
			}
		}

		if (isFunction(component.prepareStateForRender)) {
			return component.prepareStateForRender(data) || data;
		} else {
			return data;
		}
	}
github metal / metal.js / packages / metal-soy / src / Soy.js View on Github external
const data = object.mixin({}, this.getConfig(component));
		component.getStateKeys().forEach(key => {
			let value = component[key];
			if (this.isHtmlParam_(component, key)) {
				value = soyRenderer_.toIncDom(value);
			}
			data[key] = value;
		});

		for (let i = 0; i < params.length; i++) {
			if (!data[params[i]] && isFunction(component[params[i]])) {
				data[params[i]] = component[params[i]].bind(component);
			}
		}

		if (isFunction(component.prepareStateForRender)) {
			return component.prepareStateForRender(data) || data;
		} else {
			return data;
		}
	}