perfomance fixes, eslint fixes (#4482)

This commit is contained in:
Anatoliy Kurochkin
2019-09-26 10:58:44 +03:00
committed by John-David Dalton
parent 29eb5713f5
commit 898b378f06
73 changed files with 89 additions and 89 deletions

View File

@@ -42,7 +42,7 @@ describe(basename, function() {
var attempt = function() {
var actual = _VERSION;
if ((new Date - start) < limit && typeof actual != 'string') {
if ((new Date - start) < limit && typeof actual !== 'string') {
setTimeout(attempt, 16);
return;
}

View File

@@ -195,7 +195,7 @@ describe('bind', function() {
it('should not error when calling bound class constructors with the `new` operator', function() {
var createCtor = lodashStable.attempt(Function, '"use strict";return class A{}');
if (typeof createCtor == 'function') {
if (typeof createCtor === 'function') {
var bound = bind(createCtor()),
count = 8,
expected = lodashStable.times(count, stubTrue);

View File

@@ -25,11 +25,11 @@ describe('isFunction', function() {
});
it('should return `true` for async functions', function() {
assert.strictEqual(isFunction(asyncFunc), typeof asyncFunc == 'function');
assert.strictEqual(isFunction(asyncFunc), typeof asyncFunc === 'function');
});
it('should return `true` for generator functions', function() {
assert.strictEqual(isFunction(genFunc), typeof genFunc == 'function');
assert.strictEqual(isFunction(genFunc), typeof genFunc === 'function');
});
it('should return `true` for the `Proxy` constructor', function() {

View File

@@ -12,7 +12,7 @@ describe('isNumber', function() {
it('should return `false` for non-numbers', function() {
var expected = lodashStable.map(falsey, function(value) {
return typeof value == 'number';
return typeof value === 'number';
});
var actual = lodashStable.map(falsey, function(value, index) {

View File

@@ -139,7 +139,7 @@ describe('keys methods', function() {
it('`_.' + methodName + '` should coerce primitives to objects (test in IE 9)', function() {
var expected = lodashStable.map(primitives, function(value) {
return typeof value == 'string' ? ['0'] : [];
return typeof value === 'string' ? ['0'] : [];
});
var actual = lodashStable.map(primitives, func);

View File

@@ -24,7 +24,7 @@ var funcTag = '[object Function]',
objectTag = '[object Object]';
/** Used as a reference to the global object. */
var root = (typeof global == 'object' && global) || this;
var root = (typeof global === 'object' && global) || this;
/** Used to store lodash to test for bad extensions/shims. */
var lodashBizarro = root.lodashBizarro;
@@ -246,7 +246,7 @@ var isModularize = ui.isModularize;
var isNpm = isModularize && /\bnpm\b/.test([ui.buildPath, ui.urlParams.build]);
/** Detect if running in PhantomJS. */
var isPhantom = phantom || (typeof callPhantom == 'function');
var isPhantom = phantom || (typeof callPhantom === 'function');
/** Detect if lodash is in strict mode. */
var isStrict = ui.isStrict;
@@ -459,7 +459,7 @@ function toArgs(array) {
// Add bizarro values.
(function() {
return; // fixme
if (document || (typeof require != 'function')) {
if (document || (typeof require !== 'function')) {
return;
}
var nativeString = fnToString.call(toString),