Last active
November 19, 2022 15:44
-
-
Save zakuroishikuro/55b9d17a9e58abfa9bc3fa0477c281ad to your computer and use it in GitHub Desktop.
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
declare global {interface Object { log<T>(this: T, msg?): T }} // prettier-ignore | |
export function main(input: string): number | string { | |
const [A, B] = input.split(/\s/).map(Number); | |
return input; | |
} | |
// === ここから読む必要なし === | |
const DEBUG = process.env.NODE_ENV === "test"; | |
Object.assign(Object.prototype,{log<T>(this:T,msg="log"){if(DEBUG)console.log(`[${msg}] ${this}`);return this}}) // prettier-ignore | |
if (!DEBUG) { | |
if (process.send) console.log(main(require("fs").readFileSync(0, "utf8").trim())); | |
else require("child_process").fork(__filename, { execArgv: ["--stack-size=99900"] }); | |
} |
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
{ | |
"configurations": [ | |
{ | |
"name": "Launch TypeScript Using ts-node", | |
"type": "node", | |
"request": "launch", | |
"env": { "NODE_ENV": "test" }, | |
"skipFiles": ["<node_internals>/**", "node_modules/**"], | |
"runtimeArgs": ["--stack-size=99900", "--nolazy", "-r", "ts-node/register"], | |
"program": "${file}" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
もうすでにけっこう変わってます。まとめなおす気は・・・・・