Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame contribute delete
516 Bytes
import { type Dict, walkObject } from "../utils"
import { type SystemContext } from "./types"
export function createNormalizeFn(context: {
utility: SystemContext["utility"]
normalize: SystemContext["normalizeValue"]
}) {
const { utility, normalize } = context
const { hasShorthand, resolveShorthand } = utility
return function (styles: Dict) {
return walkObject(styles, normalize, {
stop: (value) => Array.isArray(value),
getKey: hasShorthand ? resolveShorthand : undefined,
})
}
}