から一人の答え をみて、
疑問に思ったこと
class Store { | |
status = "" | |
cycleCount = 0; | |
count = 0; | |
constructor(status){ | |
this.status = status | |
this.cycleCount = 3; | |
this.count = 1; | |
} |
global.fetch = require("node-fetch")
async function getApi(id){
try {
const response = await fetch(`https://petstore.swagger.io/v2/pet/${id}`, {
method: "GET",
mode: "cors",
credentials: "include",
headers: {
Upload the iPhone image file (File) to tilt horizontally (rotate 90 degrees) ~ iPhoneの画像ファイル(File)をアップロードした際に90度傾く対応) ~
フロントエンドでEXIFという画像のメタデータ内のOrientationの値を考慮して処理しないとそうなる。
よくある記事はimageのnodeに突っ込んでプレビューに出すみたいなのは多いのだけれど、 そうではなく、File型としてセットしたい時の方法。 callback関数を渡して、そこに処理させる
type N<T> = { name: T }
type E<T,> = T extends { [key in string]: infer I } ? { name: I } : never
type F<T> = T extends { [key in string]: infer I } ? I : never
const b: F<E<N<number>>> = 5