diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2763aa..6625684 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,3 +29,5 @@ jobs: - uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/lib/relation/equals.ts b/lib/relation/equals.ts index b7528a8..eb54c56 100644 --- a/lib/relation/equals.ts +++ b/lib/relation/equals.ts @@ -20,11 +20,11 @@ const _uniqContentEquals = (iterA: Iterator, iterB: Iterator, }; const __equals = (a: unknown, b: unknown, stackA: unknown[], stackB: unknown[]): boolean => { + if (a === null || b === null) return a === b; if (identical(a, b)) return true; const typeA = Object.prototype.toString.call(a).slice(8, -1); const typeB = Object.prototype.toString.call(b).slice(8, -1); if (typeA !== typeB) return false; - if (a === null || b === null) return false; switch (typeA) { case 'Boolean': case 'Number': case 'String': case 'Date': diff --git a/package.json b/package.json index f617ada..1b184c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fpure", - "version": "0.2.1", + "version": "0.2.2", "description": "Pure, curried, functional programming utilities for TypeScript.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/spec/relation.test.cjs b/spec/relation.test.cjs index b29b4f6..85c3fde 100644 --- a/spec/relation.test.cjs +++ b/spec/relation.test.cjs @@ -57,6 +57,10 @@ describe('equals', () => { assert.equal(equals(1, 1), true); assert.equal(equals(1, '1'), false); assert.equal(equals(NaN, NaN), true); + assert.equal(equals(true, false), false); + assert.equal(equals(false, true), false); + assert.equal(equals(null, null), true); + assert.equal(equals(null, undefined), false); }); it('compares arrays deeply', () => {