airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
29.85k stars 2.85k forks source link

fix eval if function passed instead of string function #2998

Open yoni12ab opened 1 year ago

yoni12ab commented 1 year ago

when using in CSP header the unsafe-eval property Lottie fail to load see: https://github.com/airbnb/lottie-web/issues/2927 so this pr lets you send in 'animationData' x property function not only a string function as today

example for using the function: https://stackblitz.com/edit/typescript-xm1gpw?file=lottie.ts added an npm library with the change @sentinel-one/lottie-web-no-eval