This file contains hidden or 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
javascript:(() => { | |
const canonicalLink = document.querySelector('link[rel="canonical"]'); | |
if (!canonicalLink) { | |
alert("Canonical URLが見つかりませんでした"); | |
return; | |
} | |
const textToCopy = canonicalLink.href; | |
const hiddenInput = document.createElement("input"); | |
hiddenInput.value = textToCopy; |
This file contains hidden or 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
type StringKeyToAnyValue = Record<string, any>; | |
// 「.」より前の文字列を取り出す型 | |
type HeadProperty<T extends string> = T extends `${infer First}.${string}` ? First : T; | |
// 「.」より後の文字列を取り出す型 | |
type TailProperty<T extends string> = T extends `${string}.${infer Rest}` ? Rest : never; | |
// ネストしているオブジェクトを再起的にPickする型 | |
type DeepPick<T extends StringKeyToAnyValue, U extends string> = { | |
[K in HeadProperty<U> & keyof T]: K extends readonly unknown[] // Union Typesかどうか |
This file contains hidden or 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
// ---------------------------------------------------- | |
// 基底となる型を定義 | |
// ---------------------------------------------------- | |
enum SkillLevel { | |
Junior = 1, | |
Middle, | |
Senior, | |
SemiExport, | |
Export, | |
} |