bajo 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,9 +14,10 @@ async function buildCollections (options = {}) {
|
|
|
14
14
|
const deleted = []
|
|
15
15
|
for (const index in data) {
|
|
16
16
|
const item = data[index]
|
|
17
|
+
if (config.tool && item.skipOnTool) continue
|
|
17
18
|
if (useDefaultName) {
|
|
18
19
|
if (!has(item, 'name')) {
|
|
19
|
-
if (find(data, { name: 'default' })) throw error('
|
|
20
|
+
if (find(data, { name: 'default' })) throw error('Collection \'default\' already exists')
|
|
20
21
|
else item.name = 'default'
|
|
21
22
|
}
|
|
22
23
|
}
|
package/boot/helper/run-hook.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { filter, isEmpty, orderBy } from 'lodash-es'
|
|
1
|
+
import { filter, isEmpty, orderBy, pullAt } from 'lodash-es'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @module helper/runHook
|
|
@@ -26,6 +26,7 @@ async function runHook (hookName, ...args) {
|
|
|
26
26
|
if (isEmpty(fns)) return
|
|
27
27
|
fns = orderBy(fns, ['level'])
|
|
28
28
|
const results = []
|
|
29
|
+
const removed = []
|
|
29
30
|
for (const i in fns) {
|
|
30
31
|
const fn = fns[i]
|
|
31
32
|
/*
|
|
@@ -36,10 +37,12 @@ async function runHook (hookName, ...args) {
|
|
|
36
37
|
const res = await fn.handler.call(this, ...args)
|
|
37
38
|
results.push({
|
|
38
39
|
hook: hookName,
|
|
39
|
-
tag: fn.tag,
|
|
40
40
|
resp: res
|
|
41
41
|
})
|
|
42
|
+
if (path.startsWith('once')) removed.push(i)
|
|
42
43
|
}
|
|
44
|
+
if (removed.length > 0) pullAt(this.bajo.hooks, removed)
|
|
45
|
+
|
|
43
46
|
return results
|
|
44
47
|
}
|
|
45
48
|
|