web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

commit ad68f32f38a18b3d6a4bab1ab0485321e3977d46
parent 5ed388a9d35c67cc48cc7b2428f965e5451bd914
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Wed, 16 Oct 2024 20:53:10 +0000

utils: edit profile name regex, edit client window mobile_y, fix parse_currency_price, add types, update tsconfig

Diffstat:
Mutils/src/currency.ts | 4+---
Mutils/src/regex.ts | 2+-
Mutils/src/types.ts | 1+
Mutils/src/window.ts | 2+-
Mutils/tsconfig.json | 1+
5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/utils/src/currency.ts b/utils/src/currency.ts @@ -50,10 +50,8 @@ export const parse_currency_price = (locale: string, _currency: string, amount: return { symbol: symbol_val_i.charAt(0), currency, - val_i: Number(symbol_val_i.slice(1)), + val_i: Number(symbol_val_i.replaceAll(`,`, ``).slice(1)), val_f: Number(val_f), } - // - //return [a.charAt(0), a.slice(1), b.length > 1 ? b : '00']; }; diff --git a/utils/src/regex.ts b/utils/src/regex.ts @@ -6,6 +6,6 @@ export const regex: Record<string, RegExp> = { alphanum_ch: /[a-zA-Z0-9., ]/, price: /^\d+(\.\d+)?$/, price_ch: /[0-9.]$/, - profile_name: /^[a-zA-Z0-9._]{1,30}$/, + profile_name: /^[a-zA-Z0-9._]{3,30}$/, profile_name_ch: /[a-zA-Z0-9._]/, }; diff --git a/utils/src/types.ts b/utils/src/types.ts @@ -4,6 +4,7 @@ export type ErrorResponse = { error: string; }; export type ErrorMessage<T extends string> = { err: T }; export type ResultId = { id: string; }; +export type ResultPass = { pass: true; }; export type ResultsList<T> = { results: T[]; }; export type LocationPoint = GeolocationCoordinatesPoint & { diff --git a/utils/src/window.ts b/utils/src/window.ts @@ -15,7 +15,7 @@ export const wind: ClientWindow = { h: 600 }, mobile_y: { - h: 768 + h: 750 } } } diff --git a/utils/tsconfig.json b/utils/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "strict": true, "lib": [ "es2021", "dom"