-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Conan edited this page Apr 26, 2022
·
14 revisions
Scroll down for:
Check the sidebar for everything else.
Follow the links in the headers for example usage.
Numbers | Strings | Strings/Arrays | Arrays | Truthiness | Primitives | Negation | Combinators |
---|---|---|---|---|---|---|---|
gt(n) |
startsWith('s') |
includes(o) |
some(...) |
empty |
isArray |
not(...) |
allOf(...) |
lt(n) |
endsWith('s') |
- | every(...) |
falsy |
isDate |
- | anyOf(...) |
gte(n) |
- | - | - | defined |
isFunction |
- | firstOf(...) |
lte(n) |
- | - | - | truthy |
isNumber |
- | lastOf(...) |
inRange(x,y) |
- | - | - | - | isPojo |
- | includedIn(...) |
- | - | - | - | - | isRegExp |
- | hasOwn(...) |
- | - | - | - | - | isString |
- | - |
- | - | - | - | - | instanceOf |
- | - |
Time | Days of the week | Weeks of the month | Months | Years |
---|---|---|---|---|
isHour(0..23) |
isDay(-31..31) |
nthSun(-5..5) |
isMonth(1..12) |
isYear(n) |
isMinute(0..59) |
isDayOfWeek(0..6) |
nthMon(-5..5) |
- | isWeekNumber(1..52) |
isSecond(0..59) |
- | nthTue(-5..5) |
isJan |
isLeapYear |
- | isSun |
nthWed(-5..5) |
isFeb |
- |
isAM |
isMon |
nthThu(-5..5) |
isMar |
- |
isPM |
isTue |
nthFri(-5..5) |
isApr |
- |
isMorning |
isWed |
nthSat(-5..5) |
isMay |
- |
isAfternoon |
isThu |
- | isJun |
- |
isEvening |
isFri |
- | isJul |
- |
- | isSat |
- | isAug |
- |
isBefore(date) |
- | - | isSep |
- |
isAfter(date) |
- | - | isOct |
- |
- | - | - | isNov |
- |
inThePast(n,timeFrame) |
- | - | isDec |
- |
inTheNext(n,timeFrame) |
- | - | - | - |
inTheFuture(n,timeFrame) |
- | - | - | - |
- | - | - | - | - |
isTime |
- | - | - | - |
$ pnpm i match-iz
// ESM
import { match, when, otherwise, ...core lib } from 'match-iz'
import { isAM, isSat, ...date pattern-helpers } from 'match-iz/dates'
import { isAM, isSat, ...UTC date pattern-helpers } from 'match-iz/dates/utc'
// CJS
const { match, when, otherwise, ...core lib } = require('match-iz')
const { isAM, isSat, ...date pattern-helpers } = require('match-iz/dates')
const { isAM, isSat, ...UTC date pattern-helpers } = require('match-iz/dates/utc')
Browser/UMD:
<script src="https://unpkg.com/match-iz/dist/match-iz.browser.js"></script>
<script>
const { match, when, otherwise, ...core lib } = matchiz
const { isAM, isSat, ...date pattern-helpers } = matchiz
const { isAM, isSat, ...UTC date pattern-helpers } = matchiz.utc
</script>
match-iz
🔥 | on npm | docs home | top of page