Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
rules: [
{
// Support for js, jsx, ts and tsx files.
test: /\.(j|t)sx?$/,
use: {
loader: "babel-loader",
options: {
// Don't use the babelrc file of the root.
babelrc: false,
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
// A unique hash using @babel/core's version, the babel-loader's version,
// and the contents of babel.
cacheIdentifier: hash({
babelCoreVersion: babelCore.version,
babelLoaderVersion: babelLoader.version,
babel: babel
}),
// Instead, use the babel options directly from our babel object.
...babel[target]
}
}
},
{
test: /\.(png|jpe?g|gif|svg)$/,
use: [
{
loader: "file-loader",
options: {
name: (file: string): string => {
get hashCode() {
return hashIt(this);
}
get hashCode() {
return hashIt(this, true);
}
const getSameCrioIfUnchanged = (crio, potentialCrio) => {
const hashCode = hashIt(potentialCrio);
if (crio[CRIO_HASH_CODE] === hashCode) {
return crio;
}
return new crio.constructor(potentialCrio, hashCode);
};
constructor(object, hashCode = hashIt(object)) {
if (isCrio(object)) {
return object;
}
let length = 0;
forEach(object, (value, key) => {
this[key] = getCrioedValue(value);
length++;
});
OBJECT.defineProperties(this, {
length: {
enumerable: false,
value: length
get: function get() {
return hashIt(this);
}
}], [{
get hashCode() {
return hashIt(this, true);
}
static hashFromObject (obj) {
return hash(obj)
}
const lodash = require('lodash').memoize;
const ramda = require('ramda').memoize;
const memoizee = require('memoizee');
const fastMemoize = require('fast-memoize');
const addyOsmani = require('./addy-osmani');
const memoizerific = require('memoizerific');
const lruMemoize = require('lru-memoize').default;
const moize = require('moize').default;
const microMemoize = require('micro-memoize');
const iMemoized = require('iMemoized');
const nanomemoize = require('../src/nano-memoize.js');
const deepEquals = require('lodash').isEqual;
const fastDeepEqual = require('fast-equals').deepEqual;
const hashItEquals = require('hash-it').isEqual;
const showResults = (benchmarkResults) => {
const table = new Table({
head: ['Name', 'Ops / sec', 'Relative margin of error', 'Sample size']
});
benchmarkResults.forEach((result) => {
const name = result.target.name;
const opsPerSecond = result.target.hz.toLocaleString('en-US', {
maximumFractionDigits: 0
});
const relativeMarginOferror = `± ${result.target.stats.rme.toFixed(2)}%`;
const sampleSize = result.target.stats.sample.length;
table.push([name, opsPerSecond, relativeMarginOferror, sampleSize]);
});