plastikfan / zenobia

Regular expression based file management library
MIT License
0 stars 0 forks source link

Add expression-builder #6

Closed plastikfan closed 4 years ago

plastikfan commented 5 years ago
plastikfan commented 5 years ago

Branch: add-expression-builder

plastikfan commented 5 years ago

Expression normalisation can possibly be achieved using Ramda groupBy followed by reduce. The only issue/complication is the fact that groupBy will still produce an array (which under normal circumstances will contain just a single item; regular expression names must be unique). So the key will be the name of the regular expression and this would be mapped to a single element array. If there is a way to flatten this out removing the encapsulating array, this will make it easier for client operations to use. Without this, any client process will index into the collection retrieving the array and then have to index into the first element, which is an unnecessary burden that it would be best to remove.