svelte-i18n/src/utils.js

7 lines
327 B
JavaScript
Raw Normal View History

export const capital = str => str.replace(/(^|\s)\S/, l => l.toUpperCase())
export const title = str => str.replace(/(^|\s)\S/g, l => l.toUpperCase())
export const upper = str => str.toLocaleUpperCase()
export const lower = str => str.toLocaleLowerCase()
2018-08-07 22:44:05 +02:00
export const isObject = obj => obj !== null && typeof obj === 'object'