0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 00:40:30 -05:00

🐛 Fix issue when typography name is empty.

This commit is contained in:
Andrey Antukh 2021-12-09 17:35:05 +01:00 committed by Andrés Moya
parent 9ee5a3159c
commit e44ea47497
3 changed files with 15 additions and 6 deletions

View file

@ -441,7 +441,7 @@
[path-name]
(let [path-name-split (split-path path-name)
path (str/join " / " (butlast path-name-split))
name (last path-name-split)]
name (or (last path-name-split) "")]
[path name]))
(defn merge-path-item

View file

@ -48,3 +48,12 @@
[:a :b :c :d]))
)
(t/deftest parse-path-name
(t/is (= ["foo" "bar"] (cph/parse-path-name "foo/bar")))
(t/is (= ["" "foo"] (cph/parse-path-name "foo")))
(t/is (= ["" "foo"] (cph/parse-path-name "/foo")))
(t/is (= ["" ""] (cph/parse-path-name "")))
(t/is (= ["" ""] (cph/parse-path-name nil)))
)