Skip to content

Commit

Permalink
Release 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui Marinho committed Apr 14, 2016
1 parent 8667234 commit 8ef0abd
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [v2.3.0](https://github.com/seegno/validator.js-asserts/tree/v2.3.0) (2016-04-14)
[Full Changelog](https://github.com/seegno/validator.js-asserts/compare/v2.2.0...v2.3.0)

**Implemented enhancements:**

- Add Taxpayer Identification Number assert [\#66](https://github.com/seegno/validator.js-asserts/pull/66) ([nunofgs](https://github.com/nunofgs))

## [v2.2.0](https://github.com/seegno/validator.js-asserts/tree/v2.2.0) (2016-04-10)
[Full Changelog](https://github.com/seegno/validator.js-asserts/compare/v2.1.0...v2.2.0)

Expand Down
49 changes: 49 additions & 0 deletions dist/asserts/taxpayer-identification-number-assert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict';

/**
* Module dependencies.
*/

Object.defineProperty(exports, "__esModule", {
value: true
});

exports.default = function () {
/**
* Optional peer dependency.
*/

const tin = require('tin-validator');

/**
* Class name.
*/

this.__class__ = 'TaxpayerIdentificationNumber';

/**
* Validation algorithm.
*/

this.validate = function (value) {
if (typeof value !== 'string') {
throw new _validator.Violation(this, value, { value: _validator.Validator.errorCode.must_be_a_string });
}

if (!tin.isValid(value)) {
throw new _validator.Violation(this, value);
}

return true;
};

return this;
};

var _validator = require('validator.js');

module.exports = exports['default'];

/**
* Export `TaxpayerIdentificationNumberAssert`.
*/
13 changes: 9 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ var _ukModulusCheckingAssert = require('./asserts/uk-modulus-checking-assert.js'

var _ukModulusCheckingAssert2 = _interopRequireDefault(_ukModulusCheckingAssert);

var _taxpayerIdentificationNumberAssert = require('./asserts/taxpayer-identification-number-assert.js');

var _taxpayerIdentificationNumberAssert2 = _interopRequireDefault(_taxpayerIdentificationNumberAssert);

var _uriAssert = require('./asserts/uri-assert.js');

var _uriAssert2 = _interopRequireDefault(_uriAssert);
Expand All @@ -126,10 +130,6 @@ var _uuidAssert2 = _interopRequireDefault(_uuidAssert);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
* Module dependencies.
*/

/**
* Module dependencies.
*/
Expand Down Expand Up @@ -161,9 +161,14 @@ exports.default = {
Phone: _phoneAssert2.default,
PlainObject: _plainObjectAssert2.default,
UkModulusChecking: _ukModulusCheckingAssert2.default,
TaxpayerIdentificationNumber: _taxpayerIdentificationNumberAssert2.default,
Uri: _uriAssert2.default,
UsSubdivision: _usSubdivisionAssert2.default,
UsZipCode: _usZipCodeAssert2.default,
Uuid: _uuidAssert2.default
};
/**
* Module dependencies.
*/

module.exports = exports['default'];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "validator.js-asserts",
"version": "2.2.0",
"version": "2.3.0",
"description": "A set of extra asserts for validator.js.",
"license": "MIT",
"contributors": [
Expand Down

0 comments on commit 8ef0abd

Please sign in to comment.