Merge Complete
This commit is contained in:
1 parent
482ef7a81a
commit
dabe23d505
6483 files changed
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
export const mergeDirectoryModules = dirpath =>
|
||||
fs
|
||||
.readdirSync(dirpath, 'utf8')
|
||||
.filter(filename => !/^[_|index.]/.test(filename))
|
||||
.reduce(
|
||||
(acc, filename) => ({
|
||||
...acc,
|
||||
...require(path.resolve(dirpath, filename)).default,
|
||||
}),
|
||||
{}
|
||||
)
|
||||
|
||||
export const capitalize = (string) => {
|
||||
return (string).charAt(0).toUpperCase() + (string).slice(1)
|
||||
}
|
||||
|
||||
export default capitalize
|
||||
Reference in new issue
Block a user