リファレンス · 検索ボックス用の名前の一覧 (明るい星とメシエ天体ごとに、英語・日本語の名前、符号、星座、順位の重み、アドレスに使える ID、向ける先を持つ行。IDと名前で引けます)
slugOf関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
An address-safe id from a text: lower-case ASCII letters and digits in runs joined by one hyphen; an accent is dropped (Boötes gives bootes) and a Greek letter is spelt out (α1 Centauri gives alpha1-centauri).
インポート
import { slugOf } from "@johnmorrisdotca/hoshi-stars/names";
ほかのエクスポート元: @johnmorrisdotca/hoshi-stars/names/named, @johnmorrisdotca/hoshi-stars/names/ngc-ic
定義
function slugOf(text: string): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | Any text. |
戻り値
string
The id: letters, digits and hyphens only, or an empty string if the text has none.
例
import { slugOf } from "@johnmorrisdotca/hoshi-stars/names";
console.log(slugOf("Rigil Kentaurus"), slugOf("α Orionis"));rigil-kentaurus alpha-orionis出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。