str_slice function

This commit is contained in:
Asaki Yuki 2026-02-23 10:45:53 +07:00
parent cba4669d54
commit 581228ada9
3 changed files with 54 additions and 2 deletions

View file

@ -30,6 +30,14 @@ export function isHasBinding(input: string) {
return /#\w+/.test(input)
}
export function isBinding(input: string) {
return /^#\w+$/.test(input)
}
export function isNumber(input: string) {
return /^[+-]?(?:\d+|\d+\.\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(input)
}
export function isString(input: string) {
return /^'.+'$/.test(input)
}