tailwind-ctp-intellisense/packages/tailwindcss-language-service/src/util/naturalExpand.ts

9 lines
239 B
TypeScript
Raw Normal View History

2020-04-27 22:18:28 +00:00
function pad(n: string): string {
return ('00000000' + n).substr(-8)
}
export function naturalExpand(value: number | string): string {
let str = typeof value === 'string' ? value : value.toString()
return str.replace(/\d+/g, pad)
}