- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
22 lines
845 B
JavaScript
22 lines
845 B
JavaScript
import merge from './util/merge';
|
|
import assertString from './util/assertString';
|
|
import includes from './util/includesArray';
|
|
import { decimal } from './alpha';
|
|
function decimalRegExp(options) {
|
|
var regExp = new RegExp("^[-+]?([0-9]+)?(\\".concat(decimal[options.locale], "[0-9]{").concat(options.decimal_digits, "})").concat(options.force_decimal ? '' : '?', "$"));
|
|
return regExp;
|
|
}
|
|
var default_decimal_options = {
|
|
force_decimal: false,
|
|
decimal_digits: '1,',
|
|
locale: 'en-US'
|
|
};
|
|
var blacklist = ['', '-', '+'];
|
|
export default function isDecimal(str, options) {
|
|
assertString(str);
|
|
options = merge(options, default_decimal_options);
|
|
if (options.locale in decimal) {
|
|
return !includes(blacklist, str.replace(/ /g, '')) && decimalRegExp(options).test(str);
|
|
}
|
|
throw new Error("Invalid locale '".concat(options.locale, "'"));
|
|
} |