Skip to content

Commit 44fc449

Browse files
committed
supports ts files
1 parent 7500a01 commit 44fc449

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

codepen-data.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ var moduleTest = /type=["']([\w\/]+)["']/;
66
var srcTest = /src=/;
77
var DEFAULT_EDITORS = "0011";
88

9+
function typescript(text) {
10+
return {
11+
js: text,
12+
js_pre_processor: "typescript",
13+
editors: DEFAULT_EDITORS
14+
};
15+
}
16+
917
var types = {
1018
html: function htmlType(text) {
1119
var result;
@@ -71,13 +79,8 @@ var types = {
7179
editors: DEFAULT_EDITORS
7280
};
7381
},
74-
typescript: function(text) {
75-
return {
76-
js: text,
77-
js_pre_processor: "typescript",
78-
editors: DEFAULT_EDITORS
79-
};
80-
},
82+
typescript: typescript,
83+
ts: typescript,
8184
jsx: function(text) {
8285
return {
8386
js: text,

test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,8 @@ describe("bit-docs-html-codepen-link", function() {
219219
<div class="gmap"></div>
220220
</template>`)
221221
});
222+
223+
it("supports ts files", function() {
224+
assert.ok(codepenData.ts, "there is a ts");
225+
});
222226
});

0 commit comments

Comments
 (0)