4.0.9 • Published 2 years ago

cubbyhole v4.0.9

Weekly downloads
122
License
MIT
Repository
github
Last release
2 years ago

Actions Status codecov License: MIT

Asynchronous cubbyholes used to wait for a future value by name.

WhatWhere
Discussionhttps://github.com/bigeasy/cubbyhole/issues/1
Documentationhttps://bigeasy.github.io/cubbyhole
Sourcehttps://github.com/bigeasy/cubbyhole
Issueshttps://github.com/bigeasy/cubbyhole/issues
CIhttps://travis-ci.org/bigeasy/cubbyhole
Coverage:https://codecov.io/gh/bigeasy/cubbyhole
License:MIT

Departure installs from NPM.

npm install cubbyhole

Overview

Extant is an implementation of SQL's COALESCE that I've used for some time to deal with the fact that JavaScript truthiness will treat '' and 0 as true so the || operator can't always be used to create given or default one-liner.

const { compare, raise, equal } = require('cubbyhole')

We use the name "extant" on NPM because we want the first extant argument.

Living README.md

This README.md is also a unit test using the Proof unit test framework. We'll use the Proof okay function to assert out statements in the readme. A Proof unit test generally looks like this.

require('proof')(4, async okay => {
    okay('always okay')
    okay(true, 'okay if true')
    okay(1, 1, 'okay if equal')
    okay({ value: 1 }, { value: 1 }, 'okay if deep strict equal')
})

You can run this unit test yourself to see the output from the various code sections of the readme.

git clone git@github.com:bigeasy/cubbyhole.git
cd cubbyhole
npm install --no-package-lock --no-save
node test/readme.t.js

Usage

The 'extant' module exports a single coalesce function.

const { compare, raise, equal } = require('depature')

Note that Extant is SQL's COALESCE. It returns the first non-null-like value, that is the first value that is not == null, which would be null or undefined. If there is no such argument it returns null.

okay('test')
4.0.9

2 years ago

4.0.8

3 years ago

4.0.7

3 years ago

4.0.5

3 years ago

4.0.6

3 years ago

4.0.4

3 years ago

4.0.3

3 years ago

4.0.1

3 years ago

4.0.2

3 years ago

4.0.0

4 years ago

3.0.0-alpha.3

5 years ago

3.0.0-alpha.2

5 years ago

3.0.0-alpha.1

5 years ago

3.0.0-alpha.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago