How to use the style-value-types.complex.parse function in style-value-types

To help you get started, we’ve selected a few style-value-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Popmotion / popmotion / packages / popcorn / src / utils / mix-complex.ts View on Github external
export const mixComplex = (from: string, to: string) => {
  const valueTemplate = complex.createTransformer(from);

  invariant(
    valueTemplate(from) === complex.createTransformer(to)(from),
    `Values '${from}' and '${to}' are of different format, or a value might have changed value type.`
  );

  return pipe(
    mixArray(complex.parse(from), complex.parse(to)),
    valueTemplate
  );
};