Skip to content

Commit c02c04c

Browse files
committed
get rid of short-definition.js (for later PR)
1 parent 32d7c41 commit c02c04c

File tree

3 files changed

+73
-82
lines changed

3 files changed

+73
-82
lines changed

src/components/Term/index.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import "tippy.js/themes/material.css";
77
import { onlyText } from "react-children-utilities";
88
import styles from "./styles.module.css";
99
import definitions from "./definitions";
10-
import shortDefinitions from "./short-definitions.js";
1110
import typeMap from "./type-map.js";
1211

1312
/**
@@ -23,8 +22,7 @@ export default function Term({ type = null, children }) {
2322
Solution: explicitly specify term type, or add type definition to type-map.js`,
2423
);
2524

26-
const term =
27-
definitions.terms[type] || definitions.terms[shortDefinitions[type]];
25+
const term = definitions.terms[type];
2826
if (!term) throw new Error(`Type ${type} is not defined.`);
2927
const referencePageTitle =
3028
definitions.referencePageTitles[term.referencePage];

src/components/Term/short-definitions.js

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/components/Term/type-map.js

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,77 @@
2323
例: CSS の<Term type="cssProperty">プロパティ</Term> // /docs/
2424
*/
2525

26+
const typeMap = new Map([
27+
["拡張子", "fileExtension"],
28+
["フォーク", "fork"],
29+
["Git", "git"],
30+
["GitHub", "github"],
31+
["Gitpod", "gitpod"],
32+
["リポジトリ", "repository"],
33+
["HTML", "html"],
34+
["JavaScript", "javascript"],
35+
["開始タグ", "startTag"],
36+
["タグ", "tag"],
37+
["属性", "attribute"],
38+
["HTML 要素", "element"],
39+
["要素", "element"],
40+
["終了タグ", "endTag"],
41+
["CSS", "css"],
42+
["style 属性", "styleAttribute"],
43+
["文", "javascriptStatement"],
44+
["値", "javascriptValue"],
45+
["文字列", "javascriptString"],
46+
["演算子", "javascriptOperator"],
47+
["式", "javascriptExpression"],
48+
["評価", "javascriptEvaluation"],
49+
["変数", "javascriptVariable"],
50+
["宣言", "javascriptDeclaration"],
51+
["代入", "javascriptAssignment"],
52+
["キャメルケース", "camelCase"],
53+
["スネークケース", "snakeCase"],
54+
["パスカルケース", "pascalCase"],
55+
["真偽値", "javascriptBoolean"],
56+
["if 文", "javascriptIfStatement"],
57+
["制御構造", "javascriptControlFlow"],
58+
["関数", "javascriptFunction"],
59+
["引数", "javascriptParameter"],
60+
["渡す", "javascriptPass"],
61+
["戻り値", "javascriptReturnValue"],
62+
["返す", "javascriptReturn"],
63+
["スコープ", "javascriptScope"],
64+
["モジュール化", "javascriptModularization"],
65+
["オブジェクト", "javascriptObject"],
66+
["プリミティブ", "javascriptPrimitive"],
67+
["プロパティ", "javascriptProperty"],
68+
["DOM", "dom"],
69+
["イベント", "events"],
70+
["イベントハンドラ", "eventHandler"],
71+
["参照", "javascriptReference"],
72+
["副作用", "javascriptSideEffects"],
73+
["純粋関数", "javascriptPureFunction"],
74+
["参照透過性", "javascriptReferenceTransparency"],
75+
["クラス", "javascriptClass"],
76+
["インスタンス", "javascriptInstance"],
77+
["コンストラクタ", "javascriptConstructor"],
78+
["メソッド", "javascriptMethod"],
79+
["アロー関数", "arrowFunction"],
80+
["コールバック関数", "callBackFunction"],
81+
["モジュール", "javascriptModule"],
82+
["ライブラリ", "library"],
83+
["JSON", "json"],
84+
["クエリ文字列", "queryString"],
85+
["npx コマンド", "npxCommand"],
86+
["非同期処理", "asynchronousProcess"],
87+
["API", "api"],
88+
["スレッド", "thread"],
89+
["トランスパイル", "transpile"],
90+
["モジュールバンドラ", "moduleBundler"],
91+
["JSX", "jsx"],
92+
]);
93+
94+
export default typeMap;
95+
96+
/* for later use // no-more-meaningless-javascript
2697
const typeMap = new Map([
2798
["拡張子", "fileExtension"],
2899
["フォーク", "fork"],
@@ -90,5 +161,4 @@ const typeMap = new Map([
90161
["モジュールバンドラ", "moduleBundler"],
91162
["JSX", "jsx"],
92163
]);
93-
94-
export default typeMap;
164+
*/

0 commit comments

Comments
 (0)