Skip to content

Commit

Permalink
fix(iri): Allows IRNs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryasmi committed Jan 18, 2018
1 parent 4478dc3 commit 16c66a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/regexValues/iri.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { checkRegex, Rule } from 'rulr';
import { createTypeWarning } from '../warnings/TypeWarning';

const regex = /^\w+:\/\//i;
const regex = /^\w+:/i;
const warningConstructor = createTypeWarning('Internationalized Resource Identifier (IRI)');

export default checkRegex(regex, warningConstructor) as Rule;
4 changes: 4 additions & 0 deletions src/tests/regexValues/iri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ export default (test: Test) => {
// Tests from the conformance suite.
itsInvalid('ab=c://should.fail.com', 'not an IRI', test);
itsInvalid('not.a.valid.iri.com/verb', 'not an IRI', test);

// LL-472
itsValid('urn:071b8229-c909-5d6f-b250-8cbb6f36fda7:Test:Test_0', test);
itsValid('urn:uuid:a4942cbb-aabf-526f-8f69-379f265416b5', test);
};

0 comments on commit 16c66a0

Please sign in to comment.