How to use es - 10 common examples

To help you get started, we’ve selected a few es 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 polimediaupv / paella / plugins / es.upv.paella.videoData / index.js View on Github external
checkEnabled(onSuccess) {
            // Check if enabled
            let plugin = paella.player.config.plugins.list["es.upv.paella.videoDataPlugin"];
            let exclude = (plugin && plugin.excludeLocations) || [];
            let excludeParent = (plugin && plugin.excludeParentLocations) || [];
            let excluded = exclude.some((url) => {
                let re = RegExp(url,"i");
                return re.test(location.href);
            });

            if (window!=window.parent) {
                excluded = excluded || excludeParent.some((url) => {
                    let re = RegExp(url,"i");
                    try {
                        return re.test(parent.location.href);
                    }
                    catch(e) {
                        // Cross domain error
                        return false;
github brozeph / reindeer / src / mapper.js View on Github external
function initialize (self, callback) {
	let
		client,
		cloneConfig = validators.clone(self._options);

	// due to behavior of `es` module, _type must not be specified to determine
	// if _index exists or not
	cloneConfig._type = undefined;
	client = elasticsearch(cloneConfig);

	return client.indices.exists((err, info) => {
		if (err) {
			return callback(err);
		}

		let data = {};

		// detect when index does not exist
		if (!info.exists) {
			// create the _type with supplied mapping while creating the _index
			data.mappings = {};
			data.mappings[self._options._type] =
				prepareMappingForElasticsearch(self._mapping);

			return client.indices.createIndex(data, (err) => {
github brozeph / reindeer / src / mapper.js View on Github external
constructor (options, mapping) {
		super();

		if (!options._index || typeof options._index !== 'string') {
			throw new Error('_index must be provided');
		}

		if (!options._type || typeof options._type !== 'string') {
			throw new Error('_type must be provided');
		}

		// initialize Mapper properties
		this._client = elasticsearch(options);
		this._dynamic = {};
		this._fields = {};
		this._fieldValidators = {};
		this._idPath = null;
		this._isInitialized = false;
		this._options = options;
		this._mapping = mapping;
		this._required = {};

		// analyze the input
		return analyze(this);
	}
github zloirock / core-js / packages / core-js-compat / src / data.js View on Github external
node: '10.0',
  },
  'web.url.to-json': {
    chrome: '71',
    firefox: '57',
    node: '10.0',
  },
  'web.url-search-params': {
    chrome: '67',
    firefox: '57',
    node: '10.0',
  },
};

// TODO: Remove from `core-js@4`
data['esnext.global-this'] = data['es.global-this'];
data['esnext.promise.all-settled'] = data['es.promise.all-settled'];
data['esnext.string.match-all'] = data['es.string.match-all'];

module.exports = data;
github zloirock / core-js / packages / core-js-compat / src / data.js View on Github external
},
  'web.url.to-json': {
    chrome: '71',
    firefox: '57',
    node: '10.0',
  },
  'web.url-search-params': {
    chrome: '67',
    firefox: '57',
    node: '10.0',
  },
};

// TODO: Remove from `core-js@4`
data['esnext.global-this'] = data['es.global-this'];
data['esnext.promise.all-settled'] = data['es.promise.all-settled'];
data['esnext.string.match-all'] = data['es.string.match-all'];

module.exports = data;
github zloirock / core-js / packages / core-js-compat / src / data.js View on Github external
'web.url.to-json': {
    chrome: '71',
    firefox: '57',
    node: '10.0',
  },
  'web.url-search-params': {
    chrome: '67',
    firefox: '57',
    node: '10.0',
  },
};

// TODO: Remove from `core-js@4`
data['esnext.global-this'] = data['es.global-this'];
data['esnext.promise.all-settled'] = data['es.promise.all-settled'];
data['esnext.string.match-all'] = data['es.string.match-all'];

module.exports = data;
github digitalascetic / iron-router-i18n / test / router.js View on Github external
layoutTemplate: 'es_layout'
                    }
                }
            }

        });

    test.isFalse(_.isUndefined(router.routes['en.about']), 'Route name "en.about" was not found.');
    test.equal(router.routes['en.about'].options.layoutTemplate, 'base_layout', 'Base layout of route "about" is not "base_layout".');

    test.isFalse(_.isUndefined(router.routes['it.chi-siamo']), 'Route "chi-siamo" does not exists.');
    test.equal(router.routes['it.chi-siamo'].options.layoutTemplate, 'base_layout', 'Base layout of route "chi-siamo" is not inherited as "base_layout".');
    test.equal(router.routes['it.chi-siamo'].options.template, 'about_it_template', 'Template for route "chi-siamo" is not overridden "about_it_template"');

    test.isFalse(_.isUndefined(router.routes['es.quienes-somos']), 'Route "quienes-somos" does not exists.');
    test.equal(router.routes['es.quienes-somos'].options.layoutTemplate, 'es_layout', 'Base layout of route "quienes-somos" is not overridden as "es_layout".');

});
github digitalascetic / iron-router-i18n / test / router.js View on Github external
path: '/quienes-somos',
                        layoutTemplate: 'es_layout'
                    }
                }
            }

        });

    test.isFalse(_.isUndefined(router.routes['en.about']), 'Route name "en.about" was not found.');
    test.equal(router.routes['en.about'].options.layoutTemplate, 'base_layout', 'Base layout of route "about" is not "base_layout".');

    test.isFalse(_.isUndefined(router.routes['it.chi-siamo']), 'Route "chi-siamo" does not exists.');
    test.equal(router.routes['it.chi-siamo'].options.layoutTemplate, 'base_layout', 'Base layout of route "chi-siamo" is not inherited as "base_layout".');
    test.equal(router.routes['it.chi-siamo'].options.template, 'about_it_template', 'Template for route "chi-siamo" is not overridden "about_it_template"');

    test.isFalse(_.isUndefined(router.routes['es.quienes-somos']), 'Route "quienes-somos" does not exists.');
    test.equal(router.routes['es.quienes-somos'].options.layoutTemplate, 'es_layout', 'Base layout of route "quienes-somos" is not overridden as "es_layout".');

});
github dominictarr / peers / __index.js View on Github external
return net.createServer(function (con) {
     onConnect(
        es.connect(
          es.stringify()
        , con
        , es.split()
        , es.parse()
      )
    )
  }).listen(port, host, ready)
}
github dominictarr / peers / __index.js View on Github external
Peer.prototype.connect = function (address) { 

  return es.connect(es.stringify(), net.connect(address), es.split(), es.parse())
}