Files: 49c6e5459b68f2a30bcecf7727b8c9a99cfe4e79 / lib / scopeModule.js
313 bytesRaw
1 | const { basename, dirname, sep } = require('path') |
2 | const assign = require('object-assign') |
3 | |
4 | module.exports = (definition, { filename }) => { |
5 | const scope = dirname(filename).split(sep).slice(0, 1) |
6 | |
7 | return assign({}, definition, { |
8 | create: (api) => assign({ |
9 | scope |
10 | }, definition.create(api)) |
11 | }) |
12 | } |
13 |
Built with git-ssb-web