(_path, _elementCount)
| 28 | |
| 29 | // reads the filenames of a given folder and returns it with its name and path |
| 30 | const getElements = (_path, _elementCount) => { |
| 31 | return fs |
| 32 | .readdirSync(_path) |
| 33 | .filter((item) => !/(^|\/)\.[^\/\.]/g.test(item)) |
| 34 | .map((i) => { |
| 35 | return { |
| 36 | id: _elementCount, |
| 37 | name: cleanName(i), |
| 38 | path: `${_path}/${i}` |
| 39 | }; |
| 40 | }); |
| 41 | }; |
| 42 | |
| 43 | // adds a layer to the configuration. The layer will hold information on all the defined parts and |
| 44 | // where they should be rendered in the image |