Skip to content

Commit

Permalink
docs: Updates README.md
Browse files Browse the repository at this point in the history
Adds description for common regex functions - isCreditCard(), isDayOfMonth() and isDayOfWeekString()
  • Loading branch information
Focus authored and Focus committed Jun 19, 2018
1 parent dad1e8a commit fb60def
Show file tree
Hide file tree
Showing 2 changed files with 3,939 additions and 3,882 deletions.
59 changes: 58 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ A simple and convenient library of functions that leverage regular expressions w
* [Installation](#installation)
* [Usage](#usage)
* [API](#api)
* [`.isCreditCard()`](#)
* [`.isDayOfMonth()`](#)
* [`.isDayOfWeekString()`](#)
* [`.isDecimal()`](#)
* [`.isEmail()`](#)
* [`.isHexValue()`](#)
* [`.isHTMLTag()`](#)
Expand All @@ -37,16 +39,18 @@ A simple and convenient library of functions that leverage regular expressions w
* [`.isMonthOfYear()`](#)
* [`.isMonthOfYearString()`](#)
* [`.isNegativeInteger()`](#)
* [`.isNgeativeNumber()`](#)
* [`.isNegativeNumber()`](#)
* [`.isNumber()`](#)
* [`.isPassword()`](#)
* [`.isPositiveInteger()`](#)
* [`.isPositiveNumber()`](#)
* [`.isSSN()`](#)
* [`.isStandardZipCode()`](#)
* [`.isUpperCase()`](#)
* [`.isUrl()`](#)
* [`.isUsername()`](#)
* [`.isUSPhoneNumber()`](#)
* [`.isUSState()`](#)
* [`.isVowel()`](#)
* [`.isYear()`](#)

Expand Down Expand Up @@ -88,6 +92,59 @@ console.log( isVowel('b') ) // false
console.log( isNegativeNumber(-50.67) ) // true
```

## API

### `.isCreditCard(data[string|number])`

Returns `true` if data is a valid credit card number, otherwise returns `false`

```js
import { isCreditCard } from 'nsp-regexer';

isCreditCard('345768475867474')
// true

isCreditCard(5465838563658274)
// true

isCreditCard('?')
// false
```

### `.isDayOfMonth(data[string|number])`

Returns `true` if it is a day of the month (1-31), otherwise returns `false`

```js
import { isDayOfMonth } from 'nsp-regexer';

isDayOfMonth('28')
// true

isDayOfMonth(12)
// true

isDayOfMonth(55)
// false
```

### `.isDayOfWeekString(data[string])`

Returns `true` if it is a day of the month (1-31), otherwise returns `false`

```js
import { isDayOfWeekString } from 'nsp-regexer';

isDayOfWeekString('monday')
// true

isDayOfWeekString('FRIDAY')
// true

isDayOfWeekString('doomsday')
// false
```

## Credits

Source code makes use of several open source packages, a few keys ones include...
Expand Down
Loading

0 comments on commit fb60def

Please sign in to comment.