-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from subii/v1.x
V1.x
- Loading branch information
Showing
13 changed files
with
455 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- "0.10" | ||
- "4" | ||
- "6" | ||
|
||
script: | ||
- "npm run-script cover" | ||
- "npm run lint" | ||
- "npm run cover" | ||
|
||
sudo: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,28 @@ | ||
'use strict'; | ||
var Moment = require('moment'); | ||
var Chance = require('chance').Chance(); | ||
var Randexp = require('randexp').randexp; | ||
const Moment = require('moment'); | ||
const Chance = require('chance').Chance(); | ||
const Randexp = require('randexp').randexp; | ||
|
||
const date = () => Moment().format('YYYY-MM-DD'); | ||
const dataTime = () => Moment().toISOString(); | ||
const url = () => Chance.url(); | ||
const email = () => Chance.email(); | ||
const phone = () => Chance.phone(); | ||
const guid = () => Chance.guid(); | ||
const ipv4 = () => Chance.ip(); | ||
const ipv6 = () => Chance.ipv6(); | ||
const hostname = () => Randexp(/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/gm); | ||
|
||
module.exports = { | ||
date: dateMock, | ||
'date-time': dataTimeMock, | ||
uri: urlMock, | ||
url: urlMock, | ||
email: emailMock, | ||
phone: phoneMock, | ||
uuid: guidMock, | ||
guid: guidMock, | ||
ipv4: ipv4, | ||
ipv6: ipv6, | ||
hostname: hostname | ||
date, | ||
'date-time': dataTime, | ||
uri: url, | ||
url, | ||
email, | ||
phone, | ||
uuid: guid, | ||
guid, | ||
ipv4, | ||
ipv6, | ||
hostname | ||
}; | ||
|
||
function dateMock() { | ||
return Moment().format('YYYY-MM-DD'); | ||
} | ||
|
||
function dataTimeMock() { | ||
return Moment().toISOString(); | ||
} | ||
|
||
function urlMock() { | ||
return Chance.url(); | ||
} | ||
|
||
function emailMock() { | ||
return Chance.email(); | ||
} | ||
|
||
function phoneMock() { | ||
return Chance.phone(); | ||
} | ||
|
||
function guidMock() { | ||
return Chance.guid(); | ||
} | ||
|
||
function ipv4() { | ||
return Chance.ip(); | ||
} | ||
|
||
function ipv6() { | ||
return Chance.ipv6(); | ||
} | ||
|
||
function hostname() { | ||
return Randexp(/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/gm); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.