From 30eb6072c3a8c296df3e2392807ebdfae0790422 Mon Sep 17 00:00:00 2001 From: Jay Wengrow Date: Thu, 4 Jul 2019 14:41:14 -0500 Subject: [PATCH] Changing instances of the word falsey to falsy for consistency sake, and especially as there is the array FilterFalsy function that is spelled without an e. --- snippets/compact.md | 4 ++-- snippets/findLast.md | 2 +- snippets/findLastIndex.md | 2 +- snippets/omitBy.md | 2 +- snippets/pickBy.md | 2 +- test/all.test.js | 2 +- test/compact.test.js | 2 +- test/dig.test.js | 2 +- test/omitBy.test.js | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/snippets/compact.md b/snippets/compact.md index f1a09b33e..d926a56b4 100644 --- a/snippets/compact.md +++ b/snippets/compact.md @@ -1,8 +1,8 @@ ### compact -Removes falsey values from an array. +Removes falsy values from an array. -Use `Array.prototype.filter()` to filter out falsey values (`false`, `null`, `0`, `""`, `undefined`, and `NaN`). +Use `Array.prototype.filter()` to filter out falsy values (`false`, `null`, `0`, `""`, `undefined`, and `NaN`). ```js const compact = arr => arr.filter(Boolean); diff --git a/snippets/findLast.md b/snippets/findLast.md index 35d239ee5..23ef6aba5 100644 --- a/snippets/findLast.md +++ b/snippets/findLast.md @@ -2,7 +2,7 @@ Returns the last element for which the provided function returns a truthy value. -Use `Array.prototype.filter()` to remove elements for which `fn` returns falsey values, `Array.prototype.pop()` to get the last one. +Use `Array.prototype.filter()` to remove elements for which `fn` returns falsy values, `Array.prototype.pop()` to get the last one. ```js const findLast = (arr, fn) => arr.filter(fn).pop(); diff --git a/snippets/findLastIndex.md b/snippets/findLastIndex.md index 7ce7853ca..8991febcb 100644 --- a/snippets/findLastIndex.md +++ b/snippets/findLastIndex.md @@ -3,7 +3,7 @@ Returns the index of the last element for which the provided function returns a truthy value. Use `Array.prototype.map()` to map each element to an array with its index and value. -Use `Array.prototype.filter()` to remove elements for which `fn` returns falsey values, `Array.prototype.pop()` to get the last one. +Use `Array.prototype.filter()` to remove elements for which `fn` returns falsy values, `Array.prototype.pop()` to get the last one. ```js const findLastIndex = (arr, fn) => diff --git a/snippets/omitBy.md b/snippets/omitBy.md index e147823c5..e30d7b7ad 100644 --- a/snippets/omitBy.md +++ b/snippets/omitBy.md @@ -1,6 +1,6 @@ ### omitBy -Creates an object composed of the properties the given function returns falsey for. The function is invoked with two arguments: (value, key). +Creates an object composed of the properties the given function returns falsy for. The function is invoked with two arguments: (value, key). Use `Object.keys(obj)` and `Array.prototype.filter()`to remove the keys for which `fn` returns a truthy value. Use `Array.prototype.reduce()` to convert the filtered keys back to an object with the corresponding key-value pairs. diff --git a/snippets/pickBy.md b/snippets/pickBy.md index 8636d8a04..4083c4ec9 100644 --- a/snippets/pickBy.md +++ b/snippets/pickBy.md @@ -2,7 +2,7 @@ Creates an object composed of the properties the given function returns truthy for. The function is invoked with two arguments: (value, key). -Use `Object.keys(obj)` and `Array.prototype.filter()`to remove the keys for which `fn` returns a falsey value. +Use `Object.keys(obj)` and `Array.prototype.filter()`to remove the keys for which `fn` returns a falsy value. Use `Array.prototype.reduce()` to convert the filtered keys back to an object with the corresponding key-value pairs. ```js diff --git a/test/all.test.js b/test/all.test.js index f3674a20e..1113a3a2a 100644 --- a/test/all.test.js +++ b/test/all.test.js @@ -3,7 +3,7 @@ const {all} = require('./_30s.js'); test('all is a Function', () => { expect(all).toBeInstanceOf(Function); }); -test('Returns true for arrays with no falsey values', () => { +test('Returns true for arrays with no falsy values', () => { expect(all([4, 1, 2, 3])).toBeTruthy(); }); test('Returns false for arrays with 0', () => { diff --git a/test/compact.test.js b/test/compact.test.js index 512fbb7de..34be7a97c 100644 --- a/test/compact.test.js +++ b/test/compact.test.js @@ -3,7 +3,7 @@ const {compact} = require('./_30s.js'); test('compact is a Function', () => { expect(compact).toBeInstanceOf(Function); }); -test('Removes falsey values from an array', () => { +test('Removes falsy values from an array', () => { expect(compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34, null, undefined])).toEqual([ 1, 2, diff --git a/test/dig.test.js b/test/dig.test.js index 544e37e44..201887bab 100644 --- a/test/dig.test.js +++ b/test/dig.test.js @@ -18,7 +18,7 @@ test('Dig target success', () => { expect(dig(data, 'level3')).toEqual('some data'); }); -test('Dig target with falsey value', () => { +test('Dig target with falsy value', () => { expect(dig(data, 'level3f')).toEqual(false); }); diff --git a/test/omitBy.test.js b/test/omitBy.test.js index 882db1964..6d2511891 100644 --- a/test/omitBy.test.js +++ b/test/omitBy.test.js @@ -3,6 +3,6 @@ const {omitBy} = require('./_30s.js'); test('omitBy is a Function', () => { expect(omitBy).toBeInstanceOf(Function); }); -test('Creates an object composed of the properties the given function returns falsey for', () => { +test('Creates an object composed of the properties the given function returns falsy for', () => { expect(omitBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number')).toEqual({ b: '2' }); });