| 9 | * @param config - configuration object |
| 10 | */ |
| 11 | const checkParams = config => { |
| 12 | const DEFAULT_GUTTER = 25; |
| 13 | const booleanProps = ["useTransform", "center"]; |
| 14 | |
| 15 | |
| 16 | if (!config) { |
| 17 | throw new Error("No config object has been provided."); |
| 18 | } |
| 19 | |
| 20 | for(let prop of booleanProps){ |
| 21 | if(typeof config[prop] !== "boolean"){ |
| 22 | config[prop] = true; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | |
| 27 | if(typeof config.gutter !== "number"){ |
| 28 | config.gutter = DEFAULT_GUTTER; |
| 29 | } |
| 30 | |
| 31 | if (!config.container) error("container"); |
| 32 | if (!config.items && !config.static) error("items or static"); |
| 33 | }; |
| 34 | |
| 35 | |
| 36 | /** |