Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
angus-c committed Oct 31, 2021
1 parent 345a5c6 commit 813fe63
Show file tree
Hide file tree
Showing 82 changed files with 105 additions and 104 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"es6": true
},
"parserOptions": {
"ecmaVersion": 2017
"ecmaVersion": 2017,
"sourceType": "module"
},
"rules": {
"block-scoped-var": 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/array-cartesian-product/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ function cartesianProduct(arr) {
return product;
}

export { arrayCartesianProduct as default };
export {arrayCartesianProduct as default};
2 changes: 1 addition & 1 deletion packages/array-compact/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ function compact(arr) {
return result;
}

export { arrayCompact as default };
export {arrayCompact as default};
2 changes: 1 addition & 1 deletion packages/array-flatten/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ function flatten(arr, depth) {
return flattenHelper(arr, typeof depth === 'number' ? depth : Infinity);
}

export { arrayFlatten as default };
export {arrayFlatten as default};
2 changes: 1 addition & 1 deletion packages/array-group-by/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ function groupBy(arr, cb) {
return result;
}

export { arrayGroupBy as default };
export {arrayGroupBy as default};
2 changes: 1 addition & 1 deletion packages/array-index/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ function index(arr, key) {
return result;
}

export { arrayIndex as default };
export {arrayIndex as default};
2 changes: 1 addition & 1 deletion packages/array-insert/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ function insert(arr1, arr2, index) {
return front.concat(arr2, back);
}

export { arrayInsert as default };
export {arrayInsert as default};
2 changes: 1 addition & 1 deletion packages/array-intersect/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ function intersect(arr1, arr2) {
return result;
}

export { arrayIntersect as default };
export {arrayIntersect as default};
2 changes: 1 addition & 1 deletion packages/array-last/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ function last(arr) {
return arr[arr.length - 1];
}

export { arrayLast as default };
export {arrayLast as default};
2 changes: 1 addition & 1 deletion packages/array-mean/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ function mean(arr) {
return sum / len;
}

export { arrayMean as default };
export {arrayMean as default};
2 changes: 1 addition & 1 deletion packages/array-median/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ function median(arr) {
: (sorted[lowerMiddleRank] + sorted[lowerMiddleRank - 1]) / 2;
}

export { arrayMedian as default };
export {arrayMedian as default};
2 changes: 1 addition & 1 deletion packages/array-mode/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ function mode(arr) {
: result[0];
}

export { arrayMode as default };
export {arrayMode as default};
2 changes: 1 addition & 1 deletion packages/array-partition/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ function partition(arr, fn) {
return [first, second];
}

export { arrayPartition as default };
export {arrayPartition as default};
2 changes: 1 addition & 1 deletion packages/array-percentile/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ function percentile(arr, percentileValue) {
}
}

export { arrayPercentile as default };
export {arrayPercentile as default};
4 changes: 2 additions & 2 deletions packages/array-percentile/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = percentile;

var numericError = 'all values passed to percentile must be numeric'
var numericError = 'all values passed to percentile must be numeric';

// Percentile (Exlusive) from the nist spec
function percentile(arr, percentage) {
Expand All @@ -15,7 +15,7 @@ function percentile(arr, percentage) {
}
//sort doesnt call if length is one. need to check explicitly.
if (arr.length === 1 && !Number.isFinite(arr[0])) {
throw new Error(numericError)
throw new Error(numericError);
}
var sorted = arr.sort(function(a, b) {
if (!Number.isFinite(a)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/array-permutations/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ function permutations(arr) {
return output;
}

export { arrayPermutations as default };
export {arrayPermutations as default};
2 changes: 1 addition & 1 deletion packages/array-random/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ function random(arr) {
return arr[Math.floor(Math.random() * arr.length)];
}

export { arrayRandom as default };
export {arrayRandom as default};
2 changes: 1 addition & 1 deletion packages/array-range/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ function range(start, stop, step) {
return toReturn;
}

export { arrayRange as default };
export {arrayRange as default};
2 changes: 1 addition & 1 deletion packages/array-remove/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ function remove(arr1, arr2) {
return result;
}

export { arrayRemove as default };
export {arrayRemove as default};
2 changes: 1 addition & 1 deletion packages/array-shuffle/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ function shuffle(arr, options) {
return result;
}

export { arrayShuffle as default };
export {arrayShuffle as default};
2 changes: 1 addition & 1 deletion packages/array-skewness/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ function skewness(arr) {
return (3 * (mean - median)) / standardDeviation;
}

export { arraySkewness as default };
export {arraySkewness as default};
2 changes: 1 addition & 1 deletion packages/array-sort-by/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ function sortBy(arr, iteratee) {
return copied.sort(handleSort(iteratee));
}

export { arraySortBy as default };
export {arraySortBy as default};
2 changes: 1 addition & 1 deletion packages/array-split-at/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ function splitAt(arr, n) {
return [arr.slice(0, n), arr.slice(n)];
}

export { arraySplitAt as default };
export {arraySplitAt as default};
2 changes: 1 addition & 1 deletion packages/array-split/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ function split(arr, n) {
return groups;
}

export { arraySplit as default };
export {arraySplit as default};
2 changes: 1 addition & 1 deletion packages/array-standard-deviation/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ function stdev(arr) {
return Math.sqrt(acc / (len - 1));
}

export { arrayStdev as default };
export {arrayStdev as default};
2 changes: 1 addition & 1 deletion packages/array-tail/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ function tail(arr) {
return arr.slice(1);
}

export { arrayTail as default };
export {arrayTail as default};
2 changes: 1 addition & 1 deletion packages/array-union/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ function union(arr1, arr2) {
return result;
}

export { arrayUnion as default };
export {arrayUnion as default};
2 changes: 1 addition & 1 deletion packages/array-unique/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ function stringUnique(arr) {
return Object.keys(lookup);
}

export { arrayUnique as default };
export {arrayUnique as default};
2 changes: 1 addition & 1 deletion packages/array-variance/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ function variance(arr) {
return acc / (len - 1);
}

export { arrayVariance as default };
export {arrayVariance as default};
2 changes: 1 addition & 1 deletion packages/array-zip/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ function zip() {
return result;
}

export { arrayZip as default };
export {arrayZip as default};
2 changes: 1 addition & 1 deletion packages/collection-clone/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ function getRegExpFlags(regExp) {
}
}

export { collectionClone as default };
export {collectionClone as default};
2 changes: 1 addition & 1 deletion packages/collection-compare/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ function compareObjects(value1, value2) {
return true;
}

export { collectionCompare as default };
export {collectionCompare as default};
24 changes: 12 additions & 12 deletions packages/collection-diff-apply/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
obj4; // {a: 5, b: {d: 4}}
*/

var REMOVE = "remove";
var REPLACE = "replace";
var ADD = "add";
var REMOVE = 'remove';
var REPLACE = 'replace';
var ADD = 'add';

function diffApply(obj, diff, pathConverter) {
if (!obj || typeof obj != "object") {
throw new Error("base object must be an object or an array");
if (!obj || typeof obj != 'object') {
throw new Error('base object must be an object or an array');
}

if (!Array.isArray(diff)) {
throw new Error("diff must be an array");
throw new Error('diff must be an array');
}

var diffLength = diff.length;
Expand All @@ -61,12 +61,12 @@ function diffApply(obj, diff, pathConverter) {
if (pathConverter) {
thisPath = pathConverter(thisPath);
if (!Array.isArray(thisPath)) {
throw new Error("pathConverter must return an array");
throw new Error('pathConverter must return an array');
}
} else {
if (!Array.isArray(thisPath)) {
throw new Error(
"diff path must be an array, consider supplying a path converter"
'diff path must be an array, consider supplying a path converter'
);
}
}
Expand All @@ -85,8 +85,8 @@ function diffApply(obj, diff, pathConverter) {
if (thisOp === REMOVE || thisOp === REPLACE) {
if (!subObject.hasOwnProperty(lastProp)) {
throw new Error(
["expected to find property", thisDiff.path, "in object", obj].join(
" "
['expected to find property', thisDiff.path, 'in object', obj].join(
' '
)
);
}
Expand All @@ -104,7 +104,7 @@ function diffApply(obj, diff, pathConverter) {
}

function jsonPatchPathConverter(stringPath) {
return stringPath.split("/").slice(1);
return stringPath.split('/').slice(1);
}

export { diffApply, jsonPatchPathConverter };
export {diffApply, jsonPatchPathConverter};
18 changes: 9 additions & 9 deletions packages/collection-diff/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
*/

function diff(obj1, obj2, pathConverter) {
if (!obj1 || typeof obj1 != "object" || !obj2 || typeof obj2 != "object") {
throw new Error("both arguments must be objects or arrays");
if (!obj1 || typeof obj1 != 'object' || !obj2 || typeof obj2 != 'object') {
throw new Error('both arguments must be objects or arrays');
}

pathConverter ||
(pathConverter = function (arr) {
(pathConverter = function(arr) {
return arr;
});

Expand All @@ -86,7 +86,7 @@ function diff(obj1, obj2, pathConverter) {
if (!(key in obj2)) {
path = basePath.concat(key);
diffs.remove.push({
op: "remove",
op: 'remove',
path: pathConverter(path),
});
}
Expand All @@ -100,7 +100,7 @@ function diff(obj1, obj2, pathConverter) {
path = basePath.concat(key);
var obj2Value = obj2[key];
diffs.add.push({
op: "add",
op: 'add',
path: pathConverter(path),
value: obj2Value,
});
Expand All @@ -126,21 +126,21 @@ function diff(obj1, obj2, pathConverter) {

return diffs.remove.reverse().concat(diffs.replace).concat(diffs.add);
}
return getDiff(obj1, obj2, [], { remove: [], replace: [], add: [] });
return getDiff(obj1, obj2, [], {remove: [], replace: [], add: []});
}

function pushReplace(path, basePath, key, diffs, pathConverter, obj2) {
path = basePath.concat(key);
diffs.replace.push({
op: "replace",
op: 'replace',
path: pathConverter(path),
value: obj2[key],
});
return path;
}

function jsonPatchPathConverter(arrayPath) {
return [""].concat(arrayPath).join("/");
return [''].concat(arrayPath).join('/');
}

export { diff, jsonPatchPathConverter };
export {diff, jsonPatchPathConverter};
2 changes: 1 addition & 1 deletion packages/collection-flush/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ function flush(collection) {
return undefined;
}

export { collectionFlush as default };
export {collectionFlush as default};
2 changes: 1 addition & 1 deletion packages/collection-pluck/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ function pluck(collection, propertyName) {
return result;
}

export { collectionPluck as default };
export {collectionPluck as default};
2 changes: 1 addition & 1 deletion packages/function-compose/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ function compose(fn1, fn2 /*, fn3, etc */) {
};
}

export { functionCompose as default };
export {functionCompose as default};
2 changes: 1 addition & 1 deletion packages/function-curry/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ function curry(fn, arity) {
};
}

export { functionCurry as default };
export {functionCurry as default};
2 changes: 1 addition & 1 deletion packages/function-debounce/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ function debounce(fn, wait, callFirst) {
return debounceWrapper;
}

export { functionDebounce as default };
export {functionDebounce as default};
2 changes: 1 addition & 1 deletion packages/function-demethodize/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ function demethodize(fn) {
};
}

export { functionDemethodize as default };
export {functionDemethodize as default};
2 changes: 1 addition & 1 deletion packages/function-flip/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ function flip(fn) {
};
}

export { functionFlip as default };
export {functionFlip as default};
2 changes: 1 addition & 1 deletion packages/function-memoize-last/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ function memoizeLast(fn, isEqual) {
};
}

export { functionMemoizeLast as default };
export {functionMemoizeLast as default};
2 changes: 1 addition & 1 deletion packages/function-memoize/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ function memoize(callback, resolver) {
return memoized;
}

export { functionMemoize as default };
export {functionMemoize as default};
2 changes: 1 addition & 1 deletion packages/function-once/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ function once(fn) {
};
}

export { functionOnce as default };
export {functionOnce as default};
2 changes: 1 addition & 1 deletion packages/function-partial/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ function partial(fn /*, arg1, arg2 etc */) {
};
}

export { functionPartial as default };
export {functionPartial as default};
2 changes: 1 addition & 1 deletion packages/function-throttle/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ function throttle(fn, interval, options) {
return throttleWrapper;
}

export { functionThrottle as default };
export {functionThrottle as default};
Loading

0 comments on commit 813fe63

Please sign in to comment.