0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-24 22:46:02 -05:00

[ci] format

This commit is contained in:
natemoo-re 2023-11-01 21:03:36 +00:00 committed by astrobot-houston
parent 937522fb70
commit 74fa4adba0

View file

@ -28,7 +28,7 @@ const kebab = (k: string) =>
k.toLowerCase() === k ? k : k.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
const toStyleString = (obj: Record<string, any>) =>
Object.entries(obj)
.filter(([k, v]) => typeof v === 'string' && v.trim() || typeof v === 'number')
.filter(([k, v]) => (typeof v === 'string' && v.trim()) || typeof v === 'number')
.map(([k, v]) => {
if (k[0] !== '-' && k[1] !== '-') return `${kebab(k)}:${v}`;
return `${k}:${v}`;