Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

Commit

Permalink
Fixed styling
Browse files Browse the repository at this point in the history
  • Loading branch information
onel0p3z committed Oct 20, 2016
1 parent 89d6871 commit 515d1a0
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 21 deletions.
9 changes: 3 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/**
* Dependencies
*/
const path = require('path');
'use strict';

/**
* Validators
Expand Down Expand Up @@ -29,6 +26,6 @@ const Validator = {
number: value => {
return number(value);
}
}
};

module.exports = Validator
module.exports = Validator;
6 changes: 4 additions & 2 deletions lib/validators/email.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = value => {
return /^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/.test(value)
}
return /^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/.test(value);
};
6 changes: 4 additions & 2 deletions lib/validators/number.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = value => {
return /^\d+$/.test(value);
}
return /^\d+$/.test(value);
};
6 changes: 4 additions & 2 deletions lib/validators/password.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = value => {
return /^((?=\S*?[a-zA-Z])(?=\S*?[0-9]).{5,})\S$/.test(value)
}
return /^((?=\S*?[a-zA-Z])(?=\S*?[0-9]).{5,})\S$/.test(value);
};
6 changes: 4 additions & 2 deletions lib/validators/phone.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = value => {
return /^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/.test(value);
}
return /^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/.test(value);
};
6 changes: 4 additions & 2 deletions lib/validators/socialSecurity.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = value => {
return /^\d+$/.test(value);
}
return /^\d+$/.test(value);
};
4 changes: 3 additions & 1 deletion test/email.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use strict';

const expect = require('chai').expect;
const email = require('../lib/index.js').email;

describe('Email', () => {

it('should return true', () => {
expect(email('[email protected]')).to.be.true
expect(email('[email protected]')).to.be.true;
});
it('should return false', () => {
expect(email('yu-gi-oh')).to.be.false;
Expand Down
4 changes: 3 additions & 1 deletion test/number.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use strict';

const expect = require('chai').expect;
const number = require('../lib/index.js').number;

describe('Number', () => {

it('should return true', () => {
expect(number(123456)).to.be.true
expect(number(123456)).to.be.true;
});
it('should return false', () => {
expect(number('asd')).to.be.false;
Expand Down
4 changes: 3 additions & 1 deletion test/password.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use strict';

const expect = require('chai').expect;
const password = require('../lib/index.js').password;

describe('Password', () => {

it('should return true', () => {
expect(password('Aasda1')).to.be.true
expect(password('Aasda1')).to.be.true;
});
it('should return false', () => {
expect(password('asd')).to.be.false;
Expand Down
4 changes: 3 additions & 1 deletion test/phone.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use strict';

const expect = require('chai').expect;
const phone = require('../lib/index.js').phone;

describe('Phone', () => {

it('should return true', () => {
expect(phone('305-305-3056')).to.be.true
expect(phone('305-305-3056')).to.be.true;
});
it('should return false', () => {
expect(phone('yu-gi-oh')).to.be.false;
Expand Down
4 changes: 3 additions & 1 deletion test/socialSecurity.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use strict';

const expect = require('chai').expect;
const socialSecurity = require('../lib/index.js').socialSecurity;

describe('SocialSecurity', () => {

it('should return true', () => {
expect(socialSecurity('1234567891')).to.be.true
expect(socialSecurity('1234567891')).to.be.true;
});
it('should return false', () => {
expect(socialSecurity('yu-gi-oh')).to.be.false;
Expand Down

0 comments on commit 515d1a0

Please sign in to comment.