UNPKG

sinotron

Version:

Simple framework for Typescript Electron projects

16 lines (15 loc) 421 B
export const _str = { isYesInput(s) { return !!s && ['y', 'yes'].includes(s.trim().toLowerCase()); }, toTitleCase(s) { if (!s.length) return ''; if (s.length === 1) return s.toUpperCase(); return s.charAt(0).toUpperCase() + s.slice(1); }, sanitizeIdentifier(name) { return name.replace(/[^a-z0-9_-]/gi, '-').replace(/-+/, '-'); } };