-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Conan edited this page Mar 29, 2023
·
14 revisions
import { match, when, otherwise } from 'match-iz'
Scroll down for:
Pages in this documentation:
Follow the links in the headers for example usage.
import { gt, lt, startsWith, ...etc } from 'match-iz'
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) |
- | - | - | eq(obj) |
isPojo |
- | includedIn(...) |
- | - | - | - | deepEq(obj) |
isRegExp |
- | hasOwn(...) |
- | - | - | - | - | isString |
- | isStrictly |
- | - | - | - | - | instanceOf |
- | - |
import { isHour, isDay, isTime, ...etc } from 'match-iz/dates'
import { isHour, isDay, isTime, ...etc } from 'match-iz/dates/utc'
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(ms) |
- | - | - | - |
- | - | - | - | - |
inDay/s(Date) |
- | - | - | - |
inMonth/s(Date) |
- | - | - | - |
inYear/s(Date) |
- | - | - | - |
$ pnpm i match-iz
// ESM
import { match, when, otherwise, ...core lib } from 'match-iz'
import { isAM, isPM, ...date pattern-helpers } from 'match-iz/dates'
import { isTime, ...UTC date pattern-helpers } from 'match-iz/dates/utc'
// CJS
const { match, when, otherwise, ...core lib } = require('match-iz')
const { isAM, isPM, ...date pattern-helpers } = require('match-iz/dates')
const { isTime, ...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, isPM, ...date pattern-helpers } = matchiz
const { isTime, ...UTC date pattern-helpers } = matchiz.utc
</script>
match-iz
🔥 | on npm | docs home | top of page