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

Commitcd15c80

Browse files
committed
task-a01 refactored
1 parentdfd2a8e commitcd15c80

File tree

7 files changed

+23
-11
lines changed

7 files changed

+23
-11
lines changed

‎build/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
44
};
55
Object.defineProperty(exports,"__esModule",{value:true});
66
console.log('TypeScript Code Index file - additional');
7-
consttask_a01_1=__importDefault(require("./task-a01"));
8-
(0,task_a01_1.default)();
7+
constleetcode_1=__importDefault(require("./leetcode"));
8+
(0,leetcode_1.default)();

‎build/leetcode/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"use strict";
2+
var__importDefault=(this&&this.__importDefault)||function(mod){
3+
return(mod&&mod.__esModule) ?mod :{"default":mod};
4+
};
5+
Object.defineProperty(exports,"__esModule",{value:true});
6+
consttask_a01_1=__importDefault(require("./task-a01"));
7+
exports.default=task_a01_1.default;

‎build/task-a01.jsrenamed to‎build/leetcode/task-a01.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ function armstrong(n) {
1212
returnn===a*a*a+b*b*b+c*c*c;
1313
}
1414
functionrun(){
15-
//console.log(palindrom(993));
16-
console.log(armstrong(153));
15+
constn=153;
16+
//console.log(`Is the number %{n} palindrom: ${palindrom(n)}`);
17+
console.log(`Is the number${n} armstorng's:${armstrong(n)}`);
1718
}
1819
exports.default=run;

‎src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
console.log('TypeScript Code Index file - additional');
22

3-
importa01from'./task-a01';
3+
importleetcodefrom'./leetcode';
44

5-
a01();
5+
leetcode();

‎src/leetcode/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
importtask_a01from'./task-a01';
2+
3+
exportdefaulttask_a01;

‎src/task-a01.tsrenamed to‎src/leetcode/task-a01.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ function armstrong(n: number): boolean {
1313
}
1414

1515
functionrun():void{
16-
//console.log(palindrom(993));
17-
console.log(armstrong(153));
16+
constn=153;
17+
//console.log(`Is the number %{n} palindrom: ${palindrom(n)}`);
18+
console.log(`Is the number${n} armstorng's:${armstrong(n)}`);
1819
}
1920

2021
exportdefaultrun;

‎tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
"rootDir":"src",/* Specify the root folder within your source files.*/
3030
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
3131
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32-
//"paths": {
33-
//"@/*": ["src/*"]
34-
//}, /* Specify a set of entries that re-map imports to additional lookup locations. */
32+
"paths": {
33+
"@/*": ["./src/*"]
34+
},/* Specify a set of entries that re-map imports to additional lookup locations.*/
3535
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
3636
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
3737
// "types": [], /* Specify type package names to be included without being referenced in a source file. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp