Skip to content

Commit 1fcfb04

Browse files
committed
add explicit .ts extensions to imports
typescript should not enforce this hopefully microsoft/TypeScript#27481 will get addressed
1 parent 4408b70 commit 1fcfb04

12 files changed

+42
-21
lines changed

src/ast-helpers.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55

66
import {
77
Ast,
8-
} from "./parser-combinators";
8+
// @ts-ignore
9+
} from "./parser-combinators.ts";
910

1011
import {
1112
escapeStringForRegex,
12-
} from "./helpers";
13+
// @ts-ignore
14+
} from "./helpers.ts";
1315

1416
/**
1517
* converts an array of AST nodes `nodes` representing a parsed url-pattern into

src/parser.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import {
1313
newRegexParser,
1414
newStringParser,
1515
Parser,
16-
} from "./parser-combinators";
16+
// @ts-ignore
17+
} from "./parser-combinators.ts";
1718

1819
import {
1920
IOptions,
20-
} from "./options";
21+
// @ts-ignore
22+
} from "./options.ts";
2123

2224
export function newEscapedCharParser(options: IOptions): Parser<Ast<any>> {
2325
return newPickNthParser(1, newStringParser(options.escapeChar), newRegexParser(/^./));

src/url-pattern.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
import {
22
indexOfDuplicateElement,
33
regexGroupCount,
4-
} from "./helpers";
4+
// @ts-ignore
5+
} from "./helpers.ts";
56

67
import {
78
Ast,
8-
} from "./parser-combinators";
9+
// @ts-ignore
10+
} from "./parser-combinators.ts";
911

1012
import {
1113
defaultOptions,
1214
IUserInputOptions,
13-
} from "./options";
15+
// @ts-ignore
16+
} from "./options.ts";
1417

1518
import {
1619
newUrlPatternParser,
17-
} from "./parser";
20+
// @ts-ignore
21+
} from "./parser.ts";
1822

1923
import {
2024
astRootToRegexString,
2125
astToNames,
2226
stringify,
23-
} from "./ast-helpers";
27+
// @ts-ignore
28+
} from "./ast-helpers.ts";
2429

2530
export default class UrlPattern {
2631
public readonly isRegex: boolean;

test/ast-helpers.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ import * as tape from "tape";
33

44
import {
55
newUrlPatternParser,
6-
} from "../src/parser";
6+
// @ts-ignore
7+
} from "../src/parser.ts";
78

89
import {
910
astRootToRegexString,
1011
astToNames,
11-
} from "../src/ast-helpers";
12+
// @ts-ignore
13+
} from "../src/ast-helpers.ts";
1214

1315
import {
1416
defaultOptions,
15-
} from "../src/options";
17+
// @ts-ignore
18+
} from "../src/options.ts";
1619

1720
const parse: any = newUrlPatternParser(defaultOptions);
1821

test/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* tslint:disable:no-unused-expression */
22
import * as tape from "tape";
33

4-
import UrlPattern from "../src/url-pattern";
4+
// @ts-ignore
5+
import UrlPattern from "../src/url-pattern.ts";
56

67
const UntypedUrlPattern: any = UrlPattern;
78

test/helpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
escapeStringForRegex,
55
indexOfDuplicateElement,
66
regexGroupCount,
7-
} from "../src/helpers";
7+
// @ts-ignore
8+
} from "../src/helpers.ts";
89

910
tape("escapeStringForRegex", (t: tape.Test) => {
1011
const expected = "\\[\\-\\/\\\\\\^\\$\\*\\+\\?\\.\\(\\)\\|\\[\\]\\{\\}\\]";

test/match-fixtures.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// tslint:disable:max-line-length
44
import * as tape from "tape";
55

6-
import UrlPattern from "../src/url-pattern";
6+
// @ts-ignore
7+
import UrlPattern from "../src/url-pattern.ts";
78

89
tape("match", (t: tape.Test) => {
910
let pattern = new UrlPattern("/foo");

test/misc.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as tape from "tape";
22

3-
import UrlPattern from "../src/url-pattern";
3+
// @ts-ignore
4+
import UrlPattern from "../src/url-pattern.ts";
45

56
tape("instance of UrlPattern is handled correctly as constructor argument", (t: tape.Test) => {
67
const pattern = new UrlPattern("/user/:userId/task/:taskId");

test/parser-combinators.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import * as tape from "tape";
33
import {
44
newRegexParser,
55
newStringParser,
6-
} from "../src/parser-combinators";
6+
// @ts-ignore
7+
} from "../src/parser-combinators.ts";
78

89
tape("newStringParser", (t: tape.Test) => {
910
const parse = newStringParser("foo");

test/parser.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import {
55
newNamedWildcardParser,
66
newStaticContentParser,
77
newUrlPatternParser,
8-
} from "../src/parser";
8+
// @ts-ignore
9+
} from "../src/parser.ts";
910

1011
import {
1112
defaultOptions,
12-
} from "../src/options";
13+
// @ts-ignore
14+
} from "../src/options.ts";
1315

1416
const parse = newUrlPatternParser(defaultOptions);
1517
const parseNamedSegment = newNamedSegmentParser(defaultOptions);

test/readme.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import * as tape from "tape";
44

5-
import UrlPattern from "../src/url-pattern";
5+
// @ts-ignore
6+
import UrlPattern from "../src/url-pattern.ts";
67

78
tape("match a pattern against a string and extract values", (t: tape.Test) => {
89
const pattern = new UrlPattern("/api/users(/:id)");

test/stringify-fixtures.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import * as tape from "tape";
44

5-
import UrlPattern from "../src/url-pattern";
5+
// @ts-ignore
6+
import UrlPattern from "../src/url-pattern.ts";
67

78
tape("stringify", (t: tape.Test) => {
89
let pattern = new UrlPattern("/foo");

0 commit comments

Comments
 (0)