-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update deno.json, tsconfig.json, and bat/buildDeclarationFiles.bat
- Loading branch information
Showing
3 changed files
with
5 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
@ECHO OFF | ||
cd.. | ||
del /s/q/f types\*.d.ts | ||
tsc --declaration -p .\ -t esnext --emitDeclarationOnly --outDir types & pause | ||
if exist types\src\ (move types\src\*.d.ts types\ && rd types\src\) | ||
tsc --declaration -p .\ -t esnext --emitDeclarationOnly --outDir types\ | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,13 +86,13 @@ import { assert } from 'https://deno.land/[email protected]/assert/mod.ts'; | |
* @returns boolean <en_us>Conversion is successful or not.</en_us><zh_cn>转换成功与否</zh_cn><zh_tw>轉換成功與否</zh_tw> | ||
*/ | ||
export function convert(sourceFilename: string, goalFilename: string): boolean { | ||
const FILE_WRITE_MODE = { mode: 0o777 }; | ||
const FILE_MODE_ALL = { mode: 0o777 }; | ||
try { | ||
const fileInfo = Deno.statSync(sourceFilename); | ||
assert(fileInfo.isFile); | ||
|
||
const SOURCE_CONTENT = Deno.readTextFileSync(sourceFilename); | ||
Deno.writeTextFileSync(goalFilename, tw2cn(SOURCE_CONTENT), FILE_WRITE_MODE); | ||
Deno.writeTextFileSync(goalFilename, tw2cn(SOURCE_CONTENT), FILE_MODE_ALL); | ||
|
||
return true; | ||
} catch (e) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,10 @@ import { convert } from "../index.ts"; | |
import { assert } from 'https://deno.land/[email protected]/assert/mod.ts'; | ||
|
||
(() => { | ||
const FILE_WRITE_MODE = { mode: 0o777 }; | ||
const FILE_MODE_ALL = { mode: 0o777 }; | ||
|
||
const SOURCE_FILENAME = 'zh_tw.txt'; | ||
Deno.writeTextFileSync(SOURCE_FILENAME, '乾,天乾,今天乾燥,如今天乾燥熱,假如今天乾燥熱暈了', FILE_WRITE_MODE); | ||
Deno.writeTextFileSync(SOURCE_FILENAME, '乾,天乾,今天乾燥,如今天乾燥熱,假如今天乾燥熱暈了', FILE_MODE_ALL); | ||
|
||
const GOAL_FILENAME = 'zh_cn.txt'; | ||
console.log(convert(SOURCE_FILENAME, GOAL_FILENAME)); | ||
|