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
import fs from "fs"; | |
import path from "path"; | |
import FormData from 'form-data'; | |
const main = async () => { | |
const file = fs.readFileSync(path.resolve(__dirname, '../../scripts/example.txt.zip')); | |
const form = new FormData(); | |
form.append('data', file.toString('base64'), { | |
filename: 'example.txt.zip', |
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
import { createContainer, asValue, asFunction, asClass } from "awilix"; | |
// 関数で生成する | |
// 引数は予めコンテナで設しておく | |
const loggerFactory = ({ path }: { path: string }) => { | |
return { | |
path | |
}; | |
}; |
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
const al = (n) => { | |
let r = n; | |
for (let i = 1; i <= n - 1; i++) { | |
r = r * i; | |
} | |
return r; | |
}; | |
console.log(al(2)); | |
console.log(al(3)); |
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
const items = [1, 2, 3]; | |
function pattern(items, paths, results) { | |
if (items.length === 0) { | |
results.push([ ...paths ]); | |
return results | |
} | |
let curr = results; | |
for (let i = 0; i < items.length; i++) { | |
paths.push(items[i]); |
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
node_modules |
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
node_modules |
NewerOlder