Documentation
¶
Index ¶
- Constants
- func DisallowedURLScheme(url string) (string, bool)
- func InSliceInt(needle int, haystack []int) bool
- func InSliceString(needle string, haystack []string) bool
- func IsKebabCase(val string) bool
- func IsScreamingSnakeCase(val string) bool
- func NormalizeURL(url string) string
- func ToKebabCase(val string) string
- func TrimWhitespace(s string) string
Constants ¶
const Whitespace = " \t"
Whitespace is the whitespace of Compono: U+0020 (space) and U+0009 (tab).
Variables ¶
This section is empty.
Functions ¶
func DisallowedURLScheme ¶ added in v0.7.0
DisallowedURLScheme returns the lowercased scheme of the normalized url and true when the url has a scheme other than http, https, mailto or tel. The url has a scheme when it starts with an ASCII letter followed only by ASCII letters, digits, '+', '-' and '.' up to its first ':'. Otherwise it is a relative url and is allowed.
func InSliceInt ¶
func InSliceString ¶
func IsKebabCase ¶ added in v0.4.0
func IsScreamingSnakeCase ¶
func NormalizeURL ¶ added in v0.7.0
NormalizeURL returns url as the WHATWG URL parser reads it before it looks for a scheme: without leading and trailing C0 control characters (U+0000 to U+001F) and spaces, and without any ASCII tab or newline (U+0009, U+000A, U+000D) inside it.
func ToKebabCase ¶ added in v0.4.0
func TrimWhitespace ¶ added in v0.7.0
TrimWhitespace returns s without the Compono whitespace at its start and end.
Types ¶
This section is empty.