-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpath.js
More file actions
19 lines (16 loc) · 671 Bytes
/
path.js
File metadata and controls
19 lines (16 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const path = require('path');
/**
* just a global path finder to cut down on complex paths
* root filters out undefined paths and then reduces to a final absolute path
*/
global.paths = {
root: (...dests) =>
dests.filter((i) => i).reduce((acc, cur) => path.resolve(acc, cur), __dirname),
assets: (parent, child) => paths.root('assets', parent, child),
containers: (destination) => paths.assets('Containers', destination),
services: (dest) => paths.assets('Services', dest),
styles: (dest) => paths.assets('Styles', dest),
types: (dest) => paths.assets('Types', dest),
components: (dest) => paths.assets('components', dest)
}
module.exports = paths;