How to use the values function from underscore
Find comprehensive JavaScript underscore.values code examples handpicked from public code repositorys.
GitHub: ShooterAndy/Dicecord
761 762 763 764 765 766 767 768 769 770
return } if (thisThrow.formulaParts.length && _.contains( _.values(FORMULA_PART_TYPES.operands), thisThrow.formulaParts[thisThrow.formulaParts.length - 1].type ) ) { // If the previous part is not an operator, this being an operand doesn't make a whole
2
5
1
+ 7 other calls in file
GitHub: Cloud-V/Backend
872 873 874 875 876 877 878 879 880 881
} } const absFolderPath = path.join(fullPath, folderPath); return (fullPaths[folder._id] = absFolderPath); }); const pathsArray = _.values(fullPaths); const pathsArrayPromises = _.map( pathsArray, (folderPath) => () => new Promise(async (resolve, reject) => {
0
2
0
+ 3 other calls in file
GitHub: Cloud-V/Backend
568 569 570 571 572 573 574 575 576 577
Utils.nonCloneable ); newEntry = _.extend(newEntry, _.pick(entry, entryValidPaths)); newEntry = _.defaults(newEntry, entryDefaults); newEntry.handler = _.values(EntryType).includes(entry.handler) ? entry.handler : EntryType.UnkownEntry; if (isRoot) { const entryExtensions = {
0
2
0
2208 2209 2210 2211 2212 2213 2214 2215 2216 2217
// Safely create a real, live array from anything iterable. _.toArray = function(obj) { if (!obj) return []; if (_.isArray(obj)) return slice.call(obj); if (obj.length === +obj.length) return _.map(obj, _.identity); return _.values(obj); }; // Return the number of elements in an object. _.size = function(obj) {
0
2
0
+ 6 other calls in file
GitHub: wotcity/automationjs
196 197 198 199 200 201 202 203 204 205
'contains', 'invoke', 'toArray', 'first', 'initial', 'rest', 'last', 'without', 'isEmpty', 'pluck']; _.each(methods, function(method) { Container.prototype[method] = function() { var elements = _.values(this._elements); var args = [elements].concat(_.toArray(arguments)); return _[method].apply(_, args); }; });
0
3
2
76 77 78 79 80 81 82 83 84 85
options.templateOptions = _.extend({}, DEFAULT_TEMPLATE_OPTIONS, options.templateOptions) // Generates codepoints starting from `options.startCodepoint`, // skipping codepoints explicitly specified in `options.codepoints` var currentCodepoint = options.startCodepoint var codepointsValues = _.values(options.codepoints) function getNextCodepoint() { while (_.contains(codepointsValues, currentCodepoint)) { currentCodepoint++ }
0
1
1
GitHub: ArVinD-005/RepoA
743 744 745 746 747 748 749 750 751 752
_.toArray = function(iterable) { if (!iterable) return []; if (iterable.toArray) return iterable.toArray(); if (_.isArray(iterable)) return slice.call(iterable); if (_.isArguments(iterable)) return slice.call(iterable); return _.values(iterable); }; // Return the number of elements in an object. _.size = function(obj) {
0
0
1
+ 6 other calls in file
underscore.keys is the most popular function in underscore (11266 examples)