Skip to content

allreq/allreq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

allreq

Declarative conditional template literal string type.

NPM Version NPM Downloads License [changelog]


npm install allreq
yarn add allreq

Examples

import { allreq } from 'allreq';

let v = allreq`this could be undefined.
               if ${undefined} is undefined.`;

v === undefined; // true

This is how to make a new allreq.

import { newAllReq } from 'allreq';

const allreq = newAllReq(
  (anyArg: number) => anyArg <= 5,
  (invalidArg) => `${invalidArg} is <= 5`
);

let v = allreq`${0}, ${1}, ${2}, ${999} these are all <= 5`;

v === '999 is <= 5'; // true

License

MIT

About

Declarative conditional template literal string type

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors