UNPKG

ucsc-xena-datapages

Version:
33 lines (26 loc) 1.02 kB
/*globals define: false */ 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; define(['underscore', 'ehmutable'], function (_, immutable) { // Concat array with following arguments /* Like _.find, but return the result of the predicate */ function findValue(obj, predicate, context) { var result; _.any(obj, function (value, index, list) { result = predicate.call(context, value, index, list); return result; }); return result; } _.mixin(_extends({ findValue: findValue, flatmap: _.compose(_.partial(_.flatten, _, 1), _.map), merge: function merge() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _.extend.apply(null, [{}].concat(args)); } }, immutable)); return _; });