Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit404420e

Browse files
authored
Add ts support (for vscode-leetcode) (#45)
1 parent5a23270 commit404420e

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

‎lib/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ const DEFAULT_CONFIG = {
2929
'ruby',
3030
'rust',
3131
'scala',
32-
'swift'
32+
'swift',
33+
'typescript'
3334
],
3435
urls:{
3536
// base urls

‎lib/helper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ const LANGS = [
4545
{lang:'ruby',ext:'.rb',style:'#'},
4646
{lang:'rust',ext:'.rs',style:'c'},
4747
{lang:'scala',ext:'.scala',style:'c'},
48-
{lang:'swift',ext:'.swift',style:'c'}
48+
{lang:'swift',ext:'.swift',style:'c'},
49+
{lang:'typescript',ext:'.ts',style:'c'}
4950
];
5051

5152
consth={};

‎test/test_helper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ describe('helper', function() {
136136
assert.equal(h.langToExt('scala'),'.scala');
137137
assert.equal(h.langToExt('swift'),'.swift');
138138
assert.equal(h.langToExt('rust'),'.rs');
139+
assert.equal(h.langToExt('typescript'),'.ts');
139140
});
140141
});// #langToExt
141142

@@ -158,6 +159,7 @@ describe('helper', function() {
158159
assert.equal(h.extToLang('~/leetcode/../file.sql'),'mysql');
159160
assert.equal(h.extToLang('/home/skygragon/file.dat'),'unknown');
160161
assert.equal(h.extToLang('~/leetcode/file.rs'),'rust');
162+
assert.equal(h.extToLang('~/leetcode/file.ts'),'typescript');
161163
});
162164
});// #extToLang
163165

@@ -182,6 +184,7 @@ describe('helper', function() {
182184
assert.deepEqual(h.langToCommentStyle('ruby'),RUBY_STYLE);
183185
assert.deepEqual(h.langToCommentStyle('scala'),C_STYLE);
184186
assert.deepEqual(h.langToCommentStyle('swift'),C_STYLE);
187+
assert.deepEqual(h.langToCommentStyle('typescript'),C_STYLE);
185188
});
186189
});// #langToCommentStyle
187190

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp