Skip to content

Commit

Permalink
Export isPostalCodeLocales from package index
Browse files Browse the repository at this point in the history
  • Loading branch information
stevula committed May 10, 2018
1 parent 843fd1e commit 71646f3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ var validator = {
isISSN: _isISSN2.default,
isMobilePhone: _isMobilePhone2.default,
isPostalCode: _isPostalCode2.default,
isPostalCodeLocales: _isPostalCode.locales,
isCurrency: _isCurrency2.default,
isISO8601: _isISO2.default,
isRFC3339: _isRFC2.default,
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import isDataURI from './lib/isDataURI';
import isMimeType from './lib/isMimeType';

import isLatLong from './lib/isLatLong';
import isPostalCode from './lib/isPostalCode';
import isPostalCode, { locales as isPostalCodeLocales } from './lib/isPostalCode';

import ltrim from './lib/ltrim';
import rtrim from './lib/rtrim';
Expand Down Expand Up @@ -144,6 +144,7 @@ const validator = {
isISSN,
isMobilePhone,
isPostalCode,
isPostalCodeLocales,
isCurrency,
isISO8601,
isRFC3339,
Expand Down
1 change: 1 addition & 0 deletions test/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ describe('Exports', function () {

it('should export isPostalCode\'s supported locales', function () {
assert.ok(isPostalCodeLocales instanceof Array);
assert.ok(validator.isPostalCodeLocales instanceof Array);
});
});
3 changes: 2 additions & 1 deletion validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ var patterns = {
ZM: fiveDigit
};


var locales = Object.keys(patterns);

var isPostalCode = function (str, locale) {
assertString(str);
Expand Down Expand Up @@ -1605,6 +1605,7 @@ var validator = {
isISSN: isISSN,
isMobilePhone: isMobilePhone,
isPostalCode: isPostalCode,
isPostalCodeLocales: locales,
isCurrency: isCurrency,
isISO8601: isISO8601,
isRFC3339: isRFC3339,
Expand Down
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.

0 comments on commit 71646f3

Please sign in to comment.