Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename innerJoin to intersectionWith #3225

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export { default as includes } from './includes.js';
export { default as indexBy } from './indexBy.js';
export { default as indexOf } from './indexOf.js';
export { default as init } from './init.js';
export { default as innerJoin } from './innerJoin.js';
export { default as intersectionWith } from './intersectionWith.js';
export { default as insert } from './insert.js';
export { default as insertAll } from './insertAll.js';
export { default as intersection } from './intersection.js';
Expand Down
2 changes: 1 addition & 1 deletion source/intersection.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import uniq from './uniq.js';
* @param {Array} list1 The first list.
* @param {Array} list2 The second list.
* @return {Array} The list of elements found in both `list1` and `list2`.
* @see R.innerJoin
* @see R.intersectionWith
* @example
*
* R.intersection([1,2,3,4], [7,6,5,4,3]); //=> [4, 3]
Expand Down
6 changes: 3 additions & 3 deletions source/innerJoin.js → source/intersectionWith.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import _filter from './internal/_filter.js';
* @see R.intersection
* @example
*
* R.innerJoin(
* R.intersectionWith(
* (record, id) => record.id === id,
* [{id: 824, name: 'Richie Furay'},
* {id: 956, name: 'Dewey Martin'},
Expand All @@ -38,7 +38,7 @@ import _filter from './internal/_filter.js';
* );
* //=> [{id: 456, name: 'Stephen Stills'}, {id: 177, name: 'Neil Young'}]
*/
var innerJoin = _curry3(function innerJoin(pred, xs, ys) {
var intersectionWith = _curry3(function intersectionWith(pred, xs, ys) {
return _filter(function(x) { return _includesWith(pred, x, ys); }, xs);
});
export default innerJoin;
export default intersectionWith;
4 changes: 2 additions & 2 deletions test/innerJoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ var eq = require('./shared/eq.js');
var a = {id: 1, name: 'a'};
var b = {id: 2, name: 'b'};
var c = {id: 3, name: 'c'};
var f = R.innerJoin(function(r, id) { return r.id === id; });
var f = R.intersectionWith(function(r, id) { return r.id === id; });


describe('innerJoin', function() {
describe('intersectionWith', function() {

it('only returns elements from the first list', function() {
eq(f([a, b, c], []), []);
Expand Down