Skip to content

Commit 497854b

Browse files
committed
chore@small
1 parent 3344649 commit 497854b

File tree

12 files changed

+74
-62
lines changed

12 files changed

+74
-62
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
11.0.1
2+
3+
- Add missing JS change for `R.includes` and `R.excludes` methods in `11.0.0` release.
4+
15
11.0.0
26

37
- Breaking change: `R.includes` and `R.excludes` now accept list as first argument and value to search as second argument. This makes it more useful when used with `R.filter` and `R.reject`.

README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3350,8 +3350,8 @@ excludes<T>(list: readonly T[]): (target: T) => boolean;
33503350
```javascript
33513351
import { includes } from './includes.js'
33523352

3353-
export function excludes(valueToFind) {
3354-
return iterable => !includes(valueToFind)(iterable)
3353+
export function excludes(iterable) {
3354+
return valueToFind => !includes(iterable)(valueToFind)
33553355
}
33563356
```
33573357

@@ -3367,15 +3367,15 @@ import { excludes } from './excludes.js'
33673367
test('excludes with string', () => {
33683368
const str = 'more is less'
33693369

3370-
expect(excludes('less')(str)).toBeFalsy()
3371-
expect(excludes('never')(str)).toBeTruthy()
3370+
expect(excludes(str)('less')).toBeFalsy()
3371+
expect(excludes(str)('never')).toBeTruthy()
33723372
})
33733373

33743374
test('excludes with array', () => {
33753375
const arr = [1, 2, 3]
33763376

3377-
expect(excludes(2)(arr)).toBeFalsy()
3378-
expect(excludes(4)(arr)).toBeTruthy()
3377+
expect(excludes(arr)(2)).toBeFalsy()
3378+
expect(excludes(arr)(4)).toBeTruthy()
33793379
})
33803380
```
33813381

@@ -5034,8 +5034,8 @@ includes(list: readonly string[] | string): (substringToFind: string) => boolean
50345034
import { isArray } from './_internals/isArray.js'
50355035
import { _indexOf } from './equals.js'
50365036

5037-
export function includes(valueToFind) {
5038-
return iterable => {
5037+
export function includes(iterable) {
5038+
return valueToFind => {
50395039
if (typeof iterable === 'string') {
50405040
return iterable.includes(valueToFind)
50415041
}
@@ -5063,30 +5063,30 @@ import { includes } from './includes.js'
50635063
test('with string as iterable', () => {
50645064
const str = 'foo bar'
50655065

5066-
expect(includes('bar')(str)).toBeTruthy()
5067-
expect(includes('never')(str)).toBeFalsy()
5066+
expect(includes(str)('foo')).toBeTruthy()
5067+
expect(includes(str)('never')).toBeFalsy()
50685068
})
50695069

50705070
test('with array as iterable', () => {
50715071
const arr = [1, 2, 3]
50725072

5073-
expect(includes(2)(arr)).toBeTruthy()
5074-
expect(includes(4)(arr)).toBeFalsy()
5073+
expect(includes(arr)(2)).toBeTruthy()
5074+
expect(includes(arr)(4)).toBeFalsy()
50755075
})
50765076

50775077
test('with list of objects as iterable', () => {
50785078
const arr = [{ a: 1 }, { b: 2 }, { c: 3 }]
50795079

5080-
expect(includes({ c: 3 })(arr)).toBeTruthy()
5080+
expect(includes(arr)({ c: 3 })).toBeTruthy()
50815081
})
50825082

50835083
test('with NaN', () => {
5084-
const result = includes(Number.NaN)([Number.NaN])
5084+
const result = includes([Number.NaN])(Number.NaN)
50855085
expect(result).toBeTruthy()
50865086
})
50875087

50885088
test('with wrong input that does not throw', () => {
5089-
const result = includes(1)(/foo/g)
5089+
const result = includes([1])(/foo/g)
50905090
expect(result).toBeFalsy()
50915091
})
50925092
```
@@ -13982,6 +13982,10 @@ describe('R.zipWith', () => {
1398213982

1398313983
## ❯ CHANGELOG
1398413984

13985+
11.0.1
13986+
13987+
- Add missing JS change for `R.includes` and `R.excludes` methods in `11.0.0` release.
13988+
1398513989
11.0.0
1398613990

1398713991
- Breaking change: `R.includes` and `R.excludes` now accept list as first argument and value to search as second argument. This makes it more useful when used with `R.filter` and `R.reject`.

dist/rambda.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ function equals(a) {
481481
return b => equalsFn(a, b)
482482
}
483483

484-
function includes(valueToFind) {
485-
return iterable => {
484+
function includes(iterable) {
485+
return valueToFind => {
486486
if (typeof iterable === 'string') {
487487
return iterable.includes(valueToFind)
488488
}
@@ -636,8 +636,8 @@ function evolve(rules) {
636636
return mapObject((x, prop) => type(rules[prop]) === 'Function' ? rules[prop](x): x)
637637
}
638638

639-
function excludes(valueToFind) {
640-
return iterable => !includes(valueToFind)(iterable)
639+
function excludes(iterable) {
640+
return valueToFind => !includes(iterable)(valueToFind)
641641
}
642642

643643
function find(predicate) {

dist/rambda.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ function equals(a) {
479479
return b => equalsFn(a, b)
480480
}
481481

482-
function includes(valueToFind) {
483-
return iterable => {
482+
function includes(iterable) {
483+
return valueToFind => {
484484
if (typeof iterable === 'string') {
485485
return iterable.includes(valueToFind)
486486
}
@@ -634,8 +634,8 @@ function evolve(rules) {
634634
return mapObject((x, prop) => type(rules[prop]) === 'Function' ? rules[prop](x): x)
635635
}
636636

637-
function excludes(valueToFind) {
638-
return iterable => !includes(valueToFind)(iterable)
637+
function excludes(iterable) {
638+
return valueToFind => !includes(iterable)(valueToFind)
639639
}
640640

641641
function find(predicate) {

dist/rambda.umd.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@
485485
return b => equalsFn(a, b)
486486
}
487487

488-
function includes(valueToFind) {
489-
return iterable => {
488+
function includes(iterable) {
489+
return valueToFind => {
490490
if (typeof iterable === 'string') {
491491
return iterable.includes(valueToFind)
492492
}
@@ -640,8 +640,8 @@
640640
return mapObject((x, prop) => type(rules[prop]) === 'Function' ? rules[prop](x): x)
641641
}
642642

643-
function excludes(valueToFind) {
644-
return iterable => !includes(valueToFind)(iterable)
643+
function excludes(iterable) {
644+
return valueToFind => !includes(iterable)(valueToFind)
645645
}
646646

647647
function find(predicate) {

docs/README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3350,8 +3350,8 @@ excludes<T>(list: readonly T[]): (target: T) => boolean;
33503350
```javascript
33513351
import { includes } from './includes.js'
33523352

3353-
export function excludes(valueToFind) {
3354-
return iterable => !includes(valueToFind)(iterable)
3353+
export function excludes(iterable) {
3354+
return valueToFind => !includes(iterable)(valueToFind)
33553355
}
33563356
```
33573357

@@ -3367,15 +3367,15 @@ import { excludes } from './excludes.js'
33673367
test('excludes with string', () => {
33683368
const str = 'more is less'
33693369

3370-
expect(excludes('less')(str)).toBeFalsy()
3371-
expect(excludes('never')(str)).toBeTruthy()
3370+
expect(excludes(str)('less')).toBeFalsy()
3371+
expect(excludes(str)('never')).toBeTruthy()
33723372
})
33733373

33743374
test('excludes with array', () => {
33753375
const arr = [1, 2, 3]
33763376

3377-
expect(excludes(2)(arr)).toBeFalsy()
3378-
expect(excludes(4)(arr)).toBeTruthy()
3377+
expect(excludes(arr)(2)).toBeFalsy()
3378+
expect(excludes(arr)(4)).toBeTruthy()
33793379
})
33803380
```
33813381

@@ -5034,8 +5034,8 @@ includes(list: readonly string[] | string): (substringToFind: string) => boolean
50345034
import { isArray } from './_internals/isArray.js'
50355035
import { _indexOf } from './equals.js'
50365036

5037-
export function includes(valueToFind) {
5038-
return iterable => {
5037+
export function includes(iterable) {
5038+
return valueToFind => {
50395039
if (typeof iterable === 'string') {
50405040
return iterable.includes(valueToFind)
50415041
}
@@ -5063,30 +5063,30 @@ import { includes } from './includes.js'
50635063
test('with string as iterable', () => {
50645064
const str = 'foo bar'
50655065

5066-
expect(includes('bar')(str)).toBeTruthy()
5067-
expect(includes('never')(str)).toBeFalsy()
5066+
expect(includes(str)('foo')).toBeTruthy()
5067+
expect(includes(str)('never')).toBeFalsy()
50685068
})
50695069

50705070
test('with array as iterable', () => {
50715071
const arr = [1, 2, 3]
50725072

5073-
expect(includes(2)(arr)).toBeTruthy()
5074-
expect(includes(4)(arr)).toBeFalsy()
5073+
expect(includes(arr)(2)).toBeTruthy()
5074+
expect(includes(arr)(4)).toBeFalsy()
50755075
})
50765076

50775077
test('with list of objects as iterable', () => {
50785078
const arr = [{ a: 1 }, { b: 2 }, { c: 3 }]
50795079

5080-
expect(includes({ c: 3 })(arr)).toBeTruthy()
5080+
expect(includes(arr)({ c: 3 })).toBeTruthy()
50815081
})
50825082

50835083
test('with NaN', () => {
5084-
const result = includes(Number.NaN)([Number.NaN])
5084+
const result = includes([Number.NaN])(Number.NaN)
50855085
expect(result).toBeTruthy()
50865086
})
50875087

50885088
test('with wrong input that does not throw', () => {
5089-
const result = includes(1)(/foo/g)
5089+
const result = includes([1])(/foo/g)
50905090
expect(result).toBeFalsy()
50915091
})
50925092
```
@@ -13982,6 +13982,10 @@ describe('R.zipWith', () => {
1398213982

1398313983
## ❯ CHANGELOG
1398413984

13985+
11.0.1
13986+
13987+
- Add missing JS change for `R.includes` and `R.excludes` methods in `11.0.0` release.
13988+
1398513989
11.0.0
1398613990

1398713991
- Breaking change: `R.includes` and `R.excludes` now accept list as first argument and value to search as second argument. This makes it more useful when used with `R.filter` and `R.reject`.

source/excludes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { includes } from './includes.js'
22

3-
export function excludes(valueToFind) {
4-
return iterable => !includes(valueToFind)(iterable)
3+
export function excludes(iterable) {
4+
return valueToFind => !includes(iterable)(valueToFind)
55
}

source/excludes.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { excludes } from './excludes.js'
33
test('excludes with string', () => {
44
const str = 'more is less'
55

6-
expect(excludes('less')(str)).toBeFalsy()
7-
expect(excludes('never')(str)).toBeTruthy()
6+
expect(excludes(str)('less')).toBeFalsy()
7+
expect(excludes(str)('never')).toBeTruthy()
88
})
99

1010
test('excludes with array', () => {
1111
const arr = [1, 2, 3]
1212

13-
expect(excludes(2)(arr)).toBeFalsy()
14-
expect(excludes(4)(arr)).toBeTruthy()
13+
expect(excludes(arr)(2)).toBeFalsy()
14+
expect(excludes(arr)(4)).toBeTruthy()
1515
})

source/includes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { isArray } from './_internals/isArray.js'
22
import { _indexOf } from './equals.js'
33

4-
export function includes(valueToFind) {
5-
return iterable => {
4+
export function includes(iterable) {
5+
return valueToFind => {
66
if (typeof iterable === 'string') {
77
return iterable.includes(valueToFind)
88
}

source/includes.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@ import { includes } from './includes.js'
33
test('with string as iterable', () => {
44
const str = 'foo bar'
55

6-
expect(includes('bar')(str)).toBeTruthy()
7-
expect(includes('never')(str)).toBeFalsy()
6+
expect(includes(str)('foo')).toBeTruthy()
7+
expect(includes(str)('never')).toBeFalsy()
88
})
99

1010
test('with array as iterable', () => {
1111
const arr = [1, 2, 3]
1212

13-
expect(includes(2)(arr)).toBeTruthy()
14-
expect(includes(4)(arr)).toBeFalsy()
13+
expect(includes(arr)(2)).toBeTruthy()
14+
expect(includes(arr)(4)).toBeFalsy()
1515
})
1616

1717
test('with list of objects as iterable', () => {
1818
const arr = [{ a: 1 }, { b: 2 }, { c: 3 }]
1919

20-
expect(includes({ c: 3 })(arr)).toBeTruthy()
20+
expect(includes(arr)({ c: 3 })).toBeTruthy()
2121
})
2222

2323
test('with NaN', () => {
24-
const result = includes(Number.NaN)([Number.NaN])
24+
const result = includes([Number.NaN])(Number.NaN)
2525
expect(result).toBeTruthy()
2626
})
2727

2828
test('with wrong input that does not throw', () => {
29-
const result = includes(1)(/foo/g)
29+
const result = includes([1])(/foo/g)
3030
expect(result).toBeFalsy()
31-
})
31+
})

0 commit comments

Comments
 (0)