Skip to content

Commit

Permalink
fe
Browse files Browse the repository at this point in the history
  • Loading branch information
soya-miruku committed Nov 23, 2023
1 parent ac9caa0 commit b0481df
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@soyamiruku/typed-surql",
"version": "1.0.23"
"version": "1.0.24"
}
59 changes: 30 additions & 29 deletions src/functions/strings.ts
Original file line number Diff line number Diff line change
@@ -1,118 +1,119 @@
import { parseType, qlFn } from "./index.ts"

export function concat(...args: string[]) {
type Input = string | qlFn
export function concat(...args: Input[]) {
return qlFn.create(`string::concat(${args.map(s => `"${s}"`).join(",")})`)
}

export function contains(value: string, search: string) {
export function contains(value: Input, search: Input) {
return qlFn.create(`string::contains(${parseType(value)},"${search}")`)
}

export function endsWith(value: string, search: string) {
export function endsWith(value: Input, search: Input) {
return qlFn.create(`string::endsWith(${parseType(value)},"${search}")`)
}

export function join(value: string, ...others: string[]) {
export function join(value: Input, ...others: Input[]) {
return qlFn.create(`string::join(${parseType(value)},${others.map(s => `"${s}"`).join(",")})`)
}

export function len(value: string) {
export function len(value: Input) {
return qlFn.create(`string::len(${parseType(value)})`)
}

export function lowercase(value: string) {
export function lowercase(value: Input) {
return qlFn.create(`string::lowercase(${parseType(value)})`)
}

export function repeat(value: string, count: number) {
export function repeat(value: Input, count: number) {
return qlFn.create(`string::repeat(${parseType(value)},${count})`)
}

export function replace(value: string, search: string, replace: string) {
export function replace(value: Input, search: Input, replace: Input) {
return qlFn.create(`string::replace(${parseType(value)},"${search}","${replace}")`)
}

export function reverse(value: string) {
export function reverse(value: Input) {
return qlFn.create(`string::reverse(${parseType(value)})`)
}

export function slice(value: string, start: number, end: number) {
export function slice(value: Input, start: number, end: number) {
return qlFn.create(`string::slice(${parseType(value)},${start},${end})`)
}

export function slug(value: string) {
export function slug(value: Input) {
return qlFn.create(`string::slug(${parseType(value)})`)
}

export function split(value: string, separator = ",") {
export function split(value: Input, separator = ",") {
return qlFn.create(`string::split(${parseType(value)},"${separator}")`)
}

export function startsWith(value: string, search: string) {
export function startsWith(value: Input, search: Input) {
return qlFn.create(`string::startsWith(${parseType(value)},"${search}")`)
}

export function trim(value: string) {
export function trim(value: Input) {
return qlFn.create(`string::trim(${parseType(value)})`)
}

export function uppercase(value: string | qlFn) {
export function uppercase(value: Input) {
return qlFn.create(`string::uppercase(${parseType(value)})`)
}

export function words(value: string) {
export function words(value: Input) {
return qlFn.create(`string::words(${parseType(value)})`)
}

export function is_alphanum(value: string) {
export function is_alphanum(value: Input) {
return qlFn.create(`string::is::alphanum(${parseType(value)})`)
}

export function is_alpha(value: string) {
export function is_alpha(value: Input) {
return qlFn.create(`string::is::alpha(${parseType(value)})`)
}

export function is_ascii(value: string) {
export function is_ascii(value: Input) {
return qlFn.create(`string::is::ascii(${parseType(value)})`)
}

export function is_format(value: string, format: string) {
export function is_format(value: Input, format: Input) {
return qlFn.create(`string::is::format(${parseType(value)},"${format}")`)
}

export function is_domain(value: string) {
export function is_domain(value: Input) {
return qlFn.create(`string::is::domain(${parseType(value)})`)
}

export function is_email(value: string) {
export function is_email(value: Input) {
return qlFn.create(`string::is::email(${parseType(value)})`)
}

export function is_hexadecimal(value: string) {
export function is_hexadecimal(value: Input) {
return qlFn.create(`string::is::hexadecimal(${parseType(value)})`)
}

export function is_latitude(value: string) {
export function is_latitude(value: Input) {
return qlFn.create(`string::is::latitude(${parseType(value)})`)
}

export function is_longitude(value: string) {
export function is_longitude(value: Input) {
return qlFn.create(`string::is::longitude(${parseType(value)})`)
}

export function is_numeric(value: string) {
export function is_numeric(value: Input) {
return qlFn.create(`string::is::numeric(${parseType(value)})`)
}

export function is_semver(value: string) {
export function is_semver(value: Input) {
return qlFn.create(`string::is::semver(${parseType(value)})`)
}

export function is_url(value: string) {
export function is_url(value: Input) {
return qlFn.create(`string::is::url(${parseType(value)})`)
}

export function is_uuid(value: string) {
export function is_uuid(value: Input) {
return qlFn.create(`string::is::uuid(${parseType(value)})`)
}

Expand Down

0 comments on commit b0481df

Please sign in to comment.