Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Nov 19, 2020
1 parent 31a0c70 commit 36eb0d9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-scalars",
"version": "1.4.1",
"version": "1.5.0",
"description": "A collection of scalar types not included in base GraphQL.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -51,7 +51,7 @@
"bob-the-bundler": "1.1.0",
"eslint": "7.13.0",
"eslint-config-prettier": "6.15.0",
"eslint-config-standard": "14.1.1",
"eslint-config-standard": "16.0.2",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/RegularExpression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class RegularExpression extends GraphQLScalarType {
regex: RegExp,
options: RegularExpressionOptions = {},
) {
const REGEX = /*#__PURE__*/ new RegExp(regex);
const REGEX = /*#__PURE__*/ regex;
const errorMessage: RegularExpressionErrorMessageFn = options.errorMessage
? options.errorMessage
: (r, v) => `Value does not match the regular expression ${r}: ${v}`;
Expand Down
2 changes: 1 addition & 1 deletion src/scalars/ObjectID.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Kind, GraphQLError, GraphQLScalarType, ValueNode } from 'graphql';

const MONGODB_OBJECTID_REGEX = /*#__PURE__*/ new RegExp(/^[A-Fa-f0-9]{24}$/);
const MONGODB_OBJECTID_REGEX = /*#__PURE__*/ /^[A-Fa-f0-9]{24}$/;

export const GraphQLObjectID = /*#__PURE__*/ new GraphQLScalarType({
name: 'ObjectID',
Expand Down
34 changes: 17 additions & 17 deletions src/scalars/PostalCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ import { Kind, GraphQLError, GraphQLScalarType } from 'graphql';

// prettier-ignore
const POSTAL_CODE_REGEXES = [
/* US */ /*#__PURE__*/new RegExp(/^\d{5}([-]?\d{4})?$/),
/* UK */ /*#__PURE__*/new RegExp(/^(GIR|[A-Z]\d[A-Z\d]??|[A-Z]{2}\d[A-Z\d]??)[ ]??(\d[A-Z]{2})$/),
/* DE */ /*#__PURE__*/new RegExp(/\b((?:0[1-46-9]\d{3})|(?:[1-357-9]\d{4})|(?:[4][0-24-9]\d{3})|(?:[6][013-9]\d{3}))\b/),
/* CA */ /*#__PURE__*/new RegExp(/^([ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]) {0,1}(\d[ABCEGHJKLMNPRSTVWXYZ]\d)$/),
/* FR */ /*#__PURE__*/new RegExp(/^(F-)?((2[A|B])|[0-9]{2})[0-9]{3}$/),
/* IT */ /*#__PURE__*/new RegExp(/^(V-|I-)?[0-9]{5}$/),
/* AU */ /*#__PURE__*/new RegExp(/^(0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-8][0-9]{2})|(290[0-9])|(291[0-4])|(7[0-4][0-9]{2})|(7[8-9][0-9]{2})$/),
/* NL */ /*#__PURE__*/new RegExp(/^[1-9][0-9]{3}\s?([a-zA-Z]{2})?$/),
/* ES */ /*#__PURE__*/new RegExp(/^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$/),
/* DK */ /*#__PURE__*/new RegExp(/^([D|d][K|k]( |-))?[1-9]{1}[0-9]{3}$/),
/* SE */ /*#__PURE__*/new RegExp(/^(s-|S-){0,1}[0-9]{3}\s?[0-9]{2}$/),
/* BE */ /*#__PURE__*/new RegExp(/^[1-9]{1}[0-9]{3}$/),
/* IN */ /*#__PURE__*/new RegExp(/^\d{6}$/),
/* AT */ /*#__PURE__*/new RegExp(/^\d{4}$/),
/* PT */ /*#__PURE__*/new RegExp(/^\d{4}([\-]\d{3})?$/),
/* CH */ /*#__PURE__*/new RegExp(/^\d{4}$/),
/* LU */ /*#__PURE__*/new RegExp(/^\d{4}$/),
/* US */ /*#__PURE__*//^\d{5}([-]?\d{4})?$/,
/* UK */ /*#__PURE__*//^(GIR|[A-Z]\d[A-Z\d]??|[A-Z]{2}\d[A-Z\d]??)[ ]??(\d[A-Z]{2})$/,
/* DE */ /*#__PURE__*//\b((?:0[1-46-9]\d{3})|(?:[1-357-9]\d{4})|(?:[4][0-24-9]\d{3})|(?:[6][013-9]\d{3}))\b/,
/* CA */ /*#__PURE__*//^([ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]) {0,1}(\d[ABCEGHJKLMNPRSTVWXYZ]\d)$/,
/* FR */ /*#__PURE__*//^(F-)?((2[A|B])|[0-9]{2})[0-9]{3}$/,
/* IT */ /*#__PURE__*//^(V-|I-)?[0-9]{5}$/,
/* AU */ /*#__PURE__*//^(0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-8][0-9]{2})|(290[0-9])|(291[0-4])|(7[0-4][0-9]{2})|(7[8-9][0-9]{2})$/,
/* NL */ /*#__PURE__*//^[1-9][0-9]{3}\s?([a-zA-Z]{2})?$/,
/* ES */ /*#__PURE__*//^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$/,
/* DK */ /*#__PURE__*//^([D|d][K|k]( |-))?[1-9]{1}[0-9]{3}$/,
/* SE */ /*#__PURE__*//^(s-|S-){0,1}[0-9]{3}\s?[0-9]{2}$/,
/* BE */ /*#__PURE__*//^[1-9]{1}[0-9]{3}$/,
/* IN */ /*#__PURE__*//^\d{6}$/,
/* AT */ /*#__PURE__*//^\d{4}$/,
/* PT */ /*#__PURE__*//^\d{4}([\-]\d{3})?$/,
/* CH */ /*#__PURE__*//^\d{4}$/,
/* LU */ /*#__PURE__*//^\d{4}$/,
];

function _testPostalCode(postalCode: string) {
Expand Down

0 comments on commit 36eb0d9

Please sign in to comment.