Skip to content

Commit

Permalink
Merge pull request #28 from paceaux/27-comparison-functions-should-us…
Browse files Browse the repository at this point in the history
…e-new-features-from-set

27 comparison functions should use new features from set
  • Loading branch information
paceaux authored Sep 26, 2024
2 parents c390567 + 213fa9e commit 161211e
Show file tree
Hide file tree
Showing 8 changed files with 4,614 additions and 3,405 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@babel/preset-env",
{
"targets" : {
"node" : "14",
"node" : "20",
"browsers" : [
"> 1%",
"last 2 node versions",
Expand All @@ -15,7 +15,7 @@
"corejs" : 3
}
],
'@babel/preset-typescript'
"@babel/preset-typescript"
],
"sourceType": "module",
"sourceMap": true
Expand Down
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Note: This doesn't use sentence punctuation as a boundary. Should it?
`Map<string, number>`

#### `getIntersection(iterable1, iterable2)`
returns an array of items that occur in both iterables
Returns an array of items that occur in both iterables

**Parameters**
| name | type | Description |
Expand All @@ -216,7 +216,7 @@ Returns an array that is the union of two iterables
A union of the items that occur in both iterables.

#### `getDisjunctiveUnion(iterable1, iterable2)`
returns an array of arrays of the unique items in either iterable
Returns an array of arrays of the unique items in either iterable. Also known as the symmetric difference

**Parameters**
| name | type | Description |
Expand All @@ -228,8 +228,21 @@ returns an array of arrays of the unique items in either iterable
`Array<Array<any>`
An array of arrays of the unique items. The first item is the first parameter, 2nd item second param

#### `getDifference`
Returns an array of items that are unique only to the first parameter.

**Parameters**
| name | type | Description |
| --- |--- | --- |
| iterable1 | `Map|Array` | |
| iterable2 | `Map|Array` | |

**Returns**
`Array<Array<any>`
An array of items unique only to the first parameter

#### `getComparison(iterable1, iterable2)`
returns a map containing various comparisons between two iterables
Returns a map containing various comparisons between two iterables

**Parameters**
| name | type | Description |
Expand All @@ -239,7 +252,7 @@ returns a map containing various comparisons between two iterables

**Returns**
`Map<string, <array>>`
A map containing various comparisons between two iterables. Those comparisons will be some kind of array (See intersection or disjunctiveUnion)
A map containing various comparisons between two iterables. Those comparisons will be arrays of intersection, disjunctiveUnion, difference, and union.

#### `getWordPlacementForNGram(ngram, wordsArray)`
determines the placement of a single ngram in an array of words
Expand Down
10 changes: 0 additions & 10 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
testMatch: [
'(/test/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
'**/?(*.)+(spec|test).[tj]s?(x)',
],
transform: {
'^.+\\.[t|j]sx?$': 'babel-jest',
},
preset: 'ts-jest',
testEnvironment: 'node',
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
};
Loading

0 comments on commit 161211e

Please sign in to comment.