@travetto/base
Advanced tools
Comparing version 0.0.37 to 0.0.38
@@ -22,3 +22,3 @@ { | ||
"scripts": {}, | ||
"version": "0.0.37" | ||
"version": "0.0.38" | ||
} |
@@ -51,3 +51,3 @@ import * as path from 'path'; | ||
export function bulkRequire(globs: string | string[], base?: string, exclude?: (name: string) => boolean) { | ||
export function bulkRequire<T = any>(globs: string | string[], base?: string, exclude?: (name: string) => boolean): T[] { | ||
return bulkFindSync(globs, base, exclude) | ||
@@ -54,0 +54,0 @@ .map(require) |
@@ -6,2 +6,11 @@ import { AppEnv } from './env'; | ||
const initializers = | ||
bulkRequire<{ init: Function, priority?: number }>( | ||
'*/src/startup.ts', | ||
`${process.cwd()}/node_modules/@travetto`, | ||
x => x.includes('/base/') | ||
) | ||
.map(x => ({ priority: 100, ...x })) | ||
.sort((a, b) => a.priority - b.priority); | ||
export function init() { | ||
@@ -26,5 +35,5 @@ | ||
for (const startup of bulkRequire('*/src/startup.ts', `${process.cwd()}/node_modules/@travetto`, x => x.includes('/base/'))) { | ||
for (const startup of initializers) { | ||
startup.init(); | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12498
391