| 127 | }; |
| 128 | |
| 129 | export const getPageOptions = printSize => { |
| 130 | if (printSize) { |
| 131 | const dimensions = printSize.match(/^([\d.]+)x([\d.]+)([a-z]*)$/); |
| 132 | if (dimensions) { |
| 133 | const [width, height, unit] = dimensions.slice(1); |
| 134 | return { width: `${width}${unit}`, height: `${height}${unit}` }; |
| 135 | } |
| 136 | return { format: printSize }; |
| 137 | } else if (revealConfig && revealConfig.width && revealConfig.height) { |
| 138 | return { width: revealConfig.width, height: revealConfig.height }; |
| 139 | } else { |
| 140 | return { width: 960, height: 700 }; |
| 141 | } |
| 142 | }; |
no outgoing calls
no test coverage detected