From cd0f73e0c9b3d1fffeeeb397f42cf9ba1df1370f Mon Sep 17 00:00:00 2001 From: Phap Date: Sat, 17 Aug 2019 12:23:27 -0400 Subject: [PATCH 1/2] lint files --- .eslintrc.js | 2 +- .internal/baseClone.js | 1 + .internal/baseOrderBy.js | 1 + .internal/createAssigner.js | 28 ++++++++++++++-------------- .internal/getSymbols.js | 2 +- .internal/getSymbolsIn.js | 2 +- .internal/getTag.js | 2 +- .internal/isIterateeCall.js | 10 ++++++---- .internal/root.js | 1 + debounce.js | 2 +- findLast.js | 4 ++-- throttle.js | 2 +- 12 files changed, 31 insertions(+), 26 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 8952c5779c..3a01d2e243 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -83,7 +83,7 @@ module.exports = { 'requireReturnForObjectLiteral': false }], - 'arrow-parens': ['error', 'always'], + // 'arrow-parens': ['error', 'always'], 'arrow-spacing': ['error', { 'after': true, diff --git a/.internal/baseClone.js b/.internal/baseClone.js index d960fd16f5..c5b991fb40 100644 --- a/.internal/baseClone.js +++ b/.internal/baseClone.js @@ -19,6 +19,7 @@ import isBuffer from '../isBuffer.js' import isObject from '../isObject.js' import keys from '../keys.js' import keysIn from '../keysIn.js' +import isTypedArray from '../isTypedArray.js' /** Used to compose bitmasks for cloning. */ const CLONE_DEEP_FLAG = 1 diff --git a/.internal/baseOrderBy.js b/.internal/baseOrderBy.js index fb5970a1b0..4d78275655 100644 --- a/.internal/baseOrderBy.js +++ b/.internal/baseOrderBy.js @@ -1,6 +1,7 @@ import baseEach from './baseEach.js' import baseSortBy from './baseSortBy.js' import compareMultiple from './compareMultiple.js' +import isArrayLike from '../isArrayLike.js' /** * The base implementation of `orderBy` without param guards. diff --git a/.internal/createAssigner.js b/.internal/createAssigner.js index 9d1b70476e..875240cbb0 100644 --- a/.internal/createAssigner.js +++ b/.internal/createAssigner.js @@ -1,4 +1,4 @@ -import isIterateeCall from './isIterateeCall.js'; +import isIterateeCall from './isIterateeCall.js' /** * Creates a function like `assign`. @@ -9,28 +9,28 @@ import isIterateeCall from './isIterateeCall.js'; */ function createAssigner(assigner) { return (object, ...sources) => { - let index = -1; - let length = sources.length; - let customizer = length > 1 ? sources[length - 1] : undefined; - const guard = length > 2 ? sources[2] : undefined; + let index = -1 + let length = sources.length + let customizer = length > 1 ? sources[length - 1] : undefined + const guard = length > 2 ? sources[2] : undefined customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) - : undefined; + : undefined if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; + customizer = length < 3 ? undefined : customizer + length = 1 } - object = Object(object); + object = Object(object) while (++index < length) { - const source = sources[index]; + const source = sources[index] if (source) { - assigner(object, source, index, customizer); + assigner(object, source, index, customizer) } } - return object; - }; + return object + } } -export default createAssigner; \ No newline at end of file +export default createAssigner diff --git a/.internal/getSymbols.js b/.internal/getSymbols.js index a3f59bbf68..17c2221089 100644 --- a/.internal/getSymbols.js +++ b/.internal/getSymbols.js @@ -11,7 +11,7 @@ const nativeGetSymbols = Object.getOwnPropertySymbols * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ -function getSymbols (object) { +function getSymbols(object) { if (object == null) { return [] } diff --git a/.internal/getSymbolsIn.js b/.internal/getSymbolsIn.js index a299603fd4..697e915ced 100644 --- a/.internal/getSymbolsIn.js +++ b/.internal/getSymbolsIn.js @@ -7,7 +7,7 @@ import getSymbols from './getSymbols.js' * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ -function getSymbolsIn (object) { +function getSymbolsIn(object) { const result = [] while (object) { result.push(...getSymbols(object)) diff --git a/.internal/getTag.js b/.internal/getTag.js index 04085cb4b8..977c44b310 100644 --- a/.internal/getTag.js +++ b/.internal/getTag.js @@ -11,7 +11,7 @@ function getTag(value) { if (value == null) { return value === undefined ? '[object Undefined]' : '[object Null]' } - return toString.call(value) + return toString.call(value) } export default getTag diff --git a/.internal/isIterateeCall.js b/.internal/isIterateeCall.js index 29e6c54624..7b5ad358d3 100644 --- a/.internal/isIterateeCall.js +++ b/.internal/isIterateeCall.js @@ -1,5 +1,7 @@ import isArrayLike from '../isArrayLike.js' import isIndex from './isIndex.js' +import isObject from '../isObject.js' +import eq from '../eq.js' /** * Checks if the given arguments are from an iteratee call. @@ -14,16 +16,16 @@ import isIndex from './isIndex.js' function isIterateeCall(value, index, object) { if (!isObject(object)) { - return false; + return false } - const type = typeof index; + const type = typeof index if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { - return eq(object[index], value); + return eq(object[index], value) } - return false; + return false } export default isIterateeCall diff --git a/.internal/root.js b/.internal/root.js index c7723bb0f4..e59c049530 100644 --- a/.internal/root.js +++ b/.internal/root.js @@ -1,3 +1,4 @@ +/* global globalThis, self */ import freeGlobal from './freeGlobal.js' /** Detect free variable `globalThis` */ diff --git a/debounce.js b/debounce.js index e48e8ffaab..2a799a6136 100644 --- a/debounce.js +++ b/debounce.js @@ -101,7 +101,7 @@ function debounce(func, wait, options) { function startTimer(pendingFunc, wait) { if (useRAF) { - root.cancelAnimationFrame(timerId); + root.cancelAnimationFrame(timerId) return root.requestAnimationFrame(pendingFunc) } return setTimeout(pendingFunc, wait) diff --git a/findLast.js b/findLast.js index 4f5ba6d79c..d44d59f1c2 100644 --- a/findLast.js +++ b/findLast.js @@ -17,7 +17,7 @@ import isArrayLike from './isArrayLike.js' * findLast([1, 2, 3, 4], n => n % 2 == 1) * // => 3 */ -function findLast (collection, predicate, fromIndex) { +function findLast(collection, predicate, fromIndex) { let iteratee const iterable = Object(collection) if (!isArrayLike(collection)) { @@ -26,7 +26,7 @@ function findLast (collection, predicate, fromIndex) { predicate = key => iteratee(iterable[key], key, iterable) } const index = findLastIndex(collection, predicate, fromIndex) - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined } export default findLast diff --git a/throttle.js b/throttle.js index 287b9ce504..6fa0ba8cab 100644 --- a/throttle.js +++ b/throttle.js @@ -63,7 +63,7 @@ function throttle(func, wait, options) { return debounce(func, wait, { leading, trailing, - 'maxWait': wait, + 'maxWait': wait }) } From 47e804ddd9c33e949b5e3ac3d3583bf11afa90aa Mon Sep 17 00:00:00 2001 From: Phap Date: Sat, 17 Aug 2019 13:38:50 -0400 Subject: [PATCH 2/2] added back arrow-paren and removed duplicate --- .eslintrc.js | 2 +- .internal/baseClone.js | 1 - findLast.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 3a01d2e243..8952c5779c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -83,7 +83,7 @@ module.exports = { 'requireReturnForObjectLiteral': false }], - // 'arrow-parens': ['error', 'always'], + 'arrow-parens': ['error', 'always'], 'arrow-spacing': ['error', { 'after': true, diff --git a/.internal/baseClone.js b/.internal/baseClone.js index 50ca25c033..9caa7975e7 100644 --- a/.internal/baseClone.js +++ b/.internal/baseClone.js @@ -20,7 +20,6 @@ import isObject from '../isObject.js' import isTypedArray from '../isTypedArray.js' import keys from '../keys.js' import keysIn from '../keysIn.js' -import isTypedArray from '../isTypedArray.js' /** Used to compose bitmasks for cloning. */ const CLONE_DEEP_FLAG = 1 diff --git a/findLast.js b/findLast.js index d44d59f1c2..391b5e9c44 100644 --- a/findLast.js +++ b/findLast.js @@ -23,7 +23,7 @@ function findLast(collection, predicate, fromIndex) { if (!isArrayLike(collection)) { collection = Object.keys(collection) iteratee = predicate - predicate = key => iteratee(iterable[key], key, iterable) + predicate = (key) => iteratee(iterable[key], key, iterable) } const index = findLastIndex(collection, predicate, fromIndex) return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy