MCPcopy Create free account
hub / github.com/HashLips/generative-art-opensource / getElements

Function getElements

input/config.js:30–41  ·  view source on GitHub ↗
(_path, _elementCount)

Source from the content-addressed store, hash-verified

28
29// reads the filenames of a given folder and returns it with its name and path
30const 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

Callers 1

addLayerFunction · 0.85

Calls 1

cleanNameFunction · 0.85

Tested by

no test coverage detected