Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/ui / dist / forms / input / deps.js
Size: Mime:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

const exotic_1 = require("exotic");

const config_1 = require("./config");

const fixture_1 = require("./fixture");

exports.fromPropsToInputChain = props => {
  const isSatisfiedByProps = chain => {
    const isSatisfied = chain.isSatisfiedByProps(props);
    console.log('isSatisfiedByProps: ', chain.name, isSatisfied);
    return isSatisfied;
  };

  const InputChainDecorator = config_1.inputChains.find(isSatisfiedByProps);

  if (InputChainDecorator !== undefined) {
    const instance = new InputChainDecorator();
    return instance;
  }

  if (process.env.NODE_ENV !== 'production') {
    console.warn('[InputChain] fromPropsToInputChain COULD NOT FIND CHAIN');
    console.dir(props);
    throw new Error('could not find [InputChain]');
  }
};

exports.isVisible = isHidden => exotic_1.isUndefined(isHidden) || exotic_1.isSafe(isHidden) && !isHidden; // @todo @fixme @exotic dunno why
// if (hasOwnProp(types, key) === true) {


exports.hasType = key => Object.prototype.hasOwnProperty.call(fixture_1.types, key);
/**
 * @todo - this is used so we can depreciate the weird effects
 *         of making everything observable without defining it strictly
 */


exports.unknown = (key, value) => {
  // unknown
  const msg = 'unknown data ' + JSON.stringify({
    [key]: value
  }); // @todo - but not on server
  // const unknown = new Error(msg)
  // console.error(unknown)
  // console.warn(msg)
};

exports.shouldRemap = key => {
  return key === 'identifier';
}; //# sourceMappingURL=deps.js.map