回答編集履歴
2
a
test
CHANGED
@@ -82,7 +82,7 @@
|
|
82
82
|
|
83
83
|
const slugify = compose(toLowerCase, joinWith('-'), splitBy(' '), trim)
|
84
84
|
|
85
|
-
console.log(slugify('
|
85
|
+
console.log(slugify(' My First Blog Entry ')); // "my-first-blog-entry"
|
86
86
|
|
87
87
|
```
|
88
88
|
|
1
a
test
CHANGED
@@ -78,9 +78,11 @@
|
|
78
78
|
|
79
79
|
|
80
80
|
|
81
|
+
// 左右の空白除去してハイフン区切りのスラグを作成する関数をcompose
|
82
|
+
|
81
83
|
const slugify = compose(toLowerCase, joinWith('-'), splitBy(' '), trim)
|
82
84
|
|
83
|
-
console.log(slugify('
|
85
|
+
console.log(slugify(' my first blog entry ')); // "my-first-blog-entry"
|
84
86
|
|
85
87
|
```
|
86
88
|
|