Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/vreg/node_modules/core-js/internals/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/vreg/node_modules/core-js/internals/array-unique-by.js
'use strict';
var toLength = require('../internals/to-length');
var toObject = require('../internals/to-object');
var getBuiltIn = require('../internals/get-built-in');
var arraySpeciesCreate = require('../internals/array-species-create');

var push = [].push;

// `Array.prototype.uniqueBy` method
// https://github.com/tc39/proposal-array-unique
module.exports = function uniqueBy(resolver) {
  var that = toObject(this);
  var length = toLength(that.length);
  var result = arraySpeciesCreate(that, 0);
  var Map = getBuiltIn('Map');
  var map = new Map();
  var resolverFunction, index, item, key;
  if (typeof resolver == 'function') resolverFunction = resolver;
  else if (resolver == null) resolverFunction = function (value) {
    return value;
  };
  else throw new TypeError('Incorrect resolver!');
  for (index = 0; index < length; index++) {
    item = that[index];
    key = resolverFunction(item);
    if (!map.has(key)) map.set(key, item);
  }
  map.forEach(function (value) {
    push.call(result, value);
  });
  return result;
};

Spamworldpro Mini