mirror of
https://github.com/withastro/astro.git
synced 2025-02-24 22:46:02 -05:00
[ci] format
This commit is contained in:
parent
937522fb70
commit
74fa4adba0
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ const kebab = (k: string) =>
|
||||||
k.toLowerCase() === k ? k : k.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
|
k.toLowerCase() === k ? k : k.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
|
||||||
const toStyleString = (obj: Record<string, any>) =>
|
const toStyleString = (obj: Record<string, any>) =>
|
||||||
Object.entries(obj)
|
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]) => {
|
.map(([k, v]) => {
|
||||||
if (k[0] !== '-' && k[1] !== '-') return `${kebab(k)}:${v}`;
|
if (k[0] !== '-' && k[1] !== '-') return `${kebab(k)}:${v}`;
|
||||||
return `${k}:${v}`;
|
return `${k}:${v}`;
|
||||||
|
|
Loading…
Add table
Reference in a new issue