import type { StyleFunctionResolver } from "../resolve"; /** * Handle the unparsable transform property by converting its values into StyleDeclarations * Each value should be a StyleDescriptor function of the transform type */ export const transform: StyleFunctionResolver = ( resolveValue, transformDescriptor, ) => { const transforms = resolveValue(transformDescriptor[2]); if (Array.isArray(transforms)) { return transforms.filter( (transform) => transform !== undefined && transform !== "initial", ) as unknown; } else if (transforms) { // If it's a single transform, wrap it in an array return [transforms]; } else { return; } };