-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
44 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
25 changes: 25 additions & 0 deletions
25
components/parser/src/main/kotlin/io/github/composegears/valkyrie/parser/IconType.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.github.composegears.valkyrie.parser | ||
|
||
import java.nio.file.Path | ||
import kotlin.io.path.extension | ||
|
||
@PublishedApi | ||
internal enum class IconType(val extension: String) { | ||
SVG("svg"), | ||
XML("xml"), | ||
; | ||
|
||
companion object { | ||
fun from(extension: String): IconType? = when { | ||
extension.isSvg -> SVG | ||
extension.isXml -> XML | ||
else -> null | ||
} | ||
} | ||
} | ||
|
||
inline val String?.isSvg: Boolean get() = equals(other = IconType.SVG.extension, ignoreCase = true) | ||
inline val String?.isXml: Boolean get() = equals(other = IconType.XML.extension, ignoreCase = true) | ||
|
||
inline val Path.isSvg: Boolean get() = extension.isSvg | ||
inline val Path.isXml: Boolean get() = extension.isXml |
15 changes: 0 additions & 15 deletions
15
components/parser/src/main/kotlin/io/github/composegears/valkyrie/parser/IconTypeParser.kt
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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