demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/lodash-4.17.20/unionBy.js

Path
demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/lodash-4.17.20/unionBy.js
Status
scanned
Type
file
Name
unionBy.js
Extension
.js
Programming language
JavaScript
Mime type
text/plain
File type
ASCII text
Tag

      
    
Rootfs path

      
    
Size
1320 (1.3 KB)
MD5
2e3a6410a1ddd3bc3da15d35a33727e8
SHA1
0d110e48caa5b130f45e00bb7d65dcebe66e275c
SHA256
3f179990db852233f2cdd65a4aad975c99e3a8838bb75d94934d3c734aaec953
SHA512

      
    
SHA1_git
6ae8ccd6ef8e3411f52be5f1bdddafcce5a46e5f
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
unionBy.js | 1.3 KB |

var baseFlatten = require('./_baseFlatten'), baseIteratee = require('./_baseIteratee'), baseRest = require('./_baseRest'), baseUniq = require('./_baseUniq'), isArrayLikeObject = require('./isArrayLikeObject'), last = require('./last'); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which uniqueness is computed. Result values are chosen from the first * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * _.unionBy([2.1], [1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2)); }); module.exports = unionBy;
Package URL License Primary language
pkg:npm/acme-demo-app@1.0.0 JavaScript
pkg:npm/lodash@4.17.20 mit JavaScript