react-file-previewer
Version:
A browser/device-agnostic file previewer for PDF and image file types built on top of React-PDF.
21 lines (17 loc) • 368 B
JavaScript
import * as R from 'ramda';
const SCALE_FACTOR = 0.25;
/**
* Reduce the document scale by 25%.
*
* @param {Object} files
* @return {Object}
*/
const setZoomOut = R.converge(R.assoc('scale'), [
R.compose(
R.map(R.subtract(R.__, SCALE_FACTOR)),
R.when(R.is(Number), R.of),
R.propOr([1], 'scale'),
),
R.identity,
]);
export default setZoomOut;