Skip to content

Commit

Permalink
wire to the portal
Browse files Browse the repository at this point in the history
  • Loading branch information
brekk committed Jan 23, 2024
1 parent 431c5be commit 0af6f5b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/cabal/autotests/cabal.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This test automatically generated by doctor-general.
// Sourced from 'cabal.js', edits to this file may be erased.
import {
hasOrAdd
} from '../cabal'

test('hasOrAdd', () => {
const s = new Set()
const key = Math.floor(Math.random() * 1e3)
s.add(key)
const hooked = hasOrAdd(s)
expect(hooked(key)).toBeTruthy()
expect(hooked('nice')).toBeFalsy()
})
13 changes: 13 additions & 0 deletions packages/cabal/cabal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import { curry } from 'ramda'

/**
* @name hasOrAdd
* @exported
* @example
* ```js test=true
* const s = new Set()
* const key = Math.floor(Math.random() * 1e3)
* s.add(key)
* const hooked = hasOrAdd(s)
* expect(hooked(key)).toBeTruthy()
* expect(hooked('nice')).toBeFalsy()
* ```
*/
export const hasOrAdd = curry(function _hasOrAdd(set, x) {
const had = set.has(x)
if (!had) {
Expand Down
1 change: 1 addition & 0 deletions packages/cabal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"devDependencies": {
"@testing-library/jest-dom": "6.1.5",
"doctor-general-cli": "portal:../../tools/doctor-general-cli",
"dotenv-cli": "7.3.0",
"eslint-config-monoculture": "workspace:shared/eslint-config-monoculture",
"jest": "29.7.0",
Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5276,6 +5276,7 @@ __metadata:
resolution: "cabal@workspace:packages/cabal"
dependencies:
"@testing-library/jest-dom": "npm:6.1.5"
doctor-general-cli: "portal:../../tools/doctor-general-cli"
dotenv-cli: "npm:7.3.0"
envtrace: "npm:0.0.2"
eslint-config-monoculture: "workspace:shared/eslint-config-monoculture"
Expand Down Expand Up @@ -7320,6 +7321,21 @@ __metadata:
languageName: unknown
linkType: soft

"doctor-general-cli@portal:../../tools/doctor-general-cli::locator=cabal%40workspace%3Apackages%2Fcabal":
version: 0.0.0-use.local
resolution: "doctor-general-cli@portal:../../tools/doctor-general-cli::locator=cabal%40workspace%3Apackages%2Fcabal"
dependencies:
climate: "workspace:packages/climate"
doctor-general: "workspace:packages/doctor-general"
inherent: "workspace:packages/inherent"
kiddo: "workspace:packages/kiddo"
ramda: "npm:0.29.1"
bin:
doctor-general: ./dist/doctor-general.cjs
drgen: ./dist/doctor-general.cjs
languageName: node
linkType: soft

"doctor-general-cli@portal:../../tools/doctor-general-cli::locator=inherent%40workspace%3Apackages%2Finherent":
version: 0.0.0-use.local
resolution: "doctor-general-cli@portal:../../tools/doctor-general-cli::locator=inherent%40workspace%3Apackages%2Finherent"
Expand Down

0 comments on commit 0af6f5b

Please sign in to comment.