wsServer.on('request', (request) => { debug('received request') const connection = request.accept(null, request.origin) connection.on('message', (message) => { if (message.type === 'utf8') { debug(message) } }) connection.on('close', (e) => { debug('closed', e) connections = _.without(connections, connection) }) connections.push(connection) })
/** * Creates a new diff instance * * @param {Array} oTables Old schemata/table definitions. * The data is generated by reading `specs` property of the last migration table. * @param {Array} nTables New schemata/tables definitions. * The data is generated by reading all models in `models` directory. */ constructor(oTables, nTables) { this.oTables = oTables; this.nTables = nTables; this._oIds = _.map(oTables, '_fid'); this._nIds = _.map(nTables, '_fid'); this._newIds = _.without(this._nIds, ...this._oIds); this._droppedTables = []; this._createdTables = []; this._logs = []; this.up = []; this.dn = []; this._make(); }
handler(argv, util, fields) { const log = util.log; if (fields.length === 0 && !this.all ) { return this.help(); } const dana = util.getDanaIns(false); const dtNames = Object.keys(dana.datatypes); if ( this.all ) { return log.info(dtNames.join('\n')); } const unknownTypes = _.without(fields, ...dtNames); if (unknownTypes.length) { log.warn('Unsupported type(s): ' + util.log.listify(unknownTypes), true); } const types = _.pick(dana.datatypes, fields); const ret = Object.keys(types).reduce((ret, el) => { const cDefaults = inspect({ defaults: types[el].defaults }, { colors: true }).replace(/[{}]/g, ' '); ret.push(`${chalk.bold(el)}:\n${cDefaults}`); return ret; }, []); console.log( chalk.blue(ret.join('\n')) ); }
let invalids = _.without(defaultValues, ...attributes.options); if ( invalids.length ) { return errors.SET_ERROR;
assert.equal(coll.some({a: 1}), true); assert.equal(coll.reject({a: 0}).length, 4); assert.deepEqual(coll.reject({a: 4}), _.without(coll.models, model)); assert.equal(coll.every({a: 0}), false); assert.equal(coll.every({b: 1}), true); assert.deepEqual(coll.partition({a: 0})[1], coll.models); assert.deepEqual(coll.partition({a: 4})[0], [model]); assert.deepEqual(coll.partition({a: 4})[1], _.without(coll.models, model)); assert.deepEqual(coll.map({a: 2}), [false, true, false, false]); assert.deepEqual(coll.map('a'), [1, 2, 3, 4]);
const unknownProps = _.without(rDtProps, ...bDatatype.validProps); if ( unknownProps.length ) { messages[colName] = errors.UNKNOWN_DATATYPE_PROP;
React.createClass({ var newMessages = _.without(this.state.messages, message); this.setState({ messages: newMessages
sp.matched = (_.without(event.val, sp.val).length === 0) === sp.should; } else if (sp.val === '*'){ //if the spec should match any value sp.matched = sp.should;
_.without(_.keys(jobDefinition), 'progress', 'error') .forEach(function (attribute) {
return (this.discardEmpty) ? _.without(results, '', ' ') : results; } else { return s.match(this._pattern);
React.createClass({ var newMessages = _.without(this.state.messages, message); this.setState({ messages: newMessages