transformers.js
28ca8a84 - Use custom cache over FSCache if specified (#1285)

Commit
1 year ago
Use custom cache over FSCache if specified (#1285) * Use custom cache over FSCache if specified Currently, if both `useFSCache` and `useCustomCache` env options are set to true (perhaps because `useFSCache` is true by default and the user forgot to unset it), the code defaults to instantiating a FileCache instead of using the custom cache implementation passed in by the user. This commit changes the default to be the custom cache if specified. * Use custom cache over browser cache if specified If `useCustomCache` is set, try to use the custom cache before falling back to the browser or the fs caches. * Throw an error if fs is not available for FSCache Meant to handle cases where the user sets `useFSCache` from an environment that doesn't support `fs`.
Author
Parents
Loading