cqrs-swissknife
Advanced tools
Comparing version 0.4.37 to 0.4.38
@@ -6,2 +6,4 @@ 'use strict'; | ||
const { firstFilenamePart } = require('../utils'); | ||
// const denormalizerBuilder = require('./denormalizerBuilder'); | ||
@@ -19,5 +21,10 @@ | ||
const basename = firstFilenamePart(collectionFile); | ||
if (collections[basename]) | ||
throw new Error(`Duplicate readmodel: [${basename}] in: ${collectionFile} and ${collections[basename].path}.`); | ||
const { schema } = require(collectionFile); // eslint-disable-line | ||
collections[path.basename(collectionName, '.js')] = { | ||
collections[basename] = { | ||
path: collectionFile, | ||
@@ -24,0 +31,0 @@ schema, |
@@ -6,3 +6,3 @@ 'use strict'; | ||
const { toFlatArray } = require('../utils'); | ||
const { toFlatArray, firstFilenamePart } = require('../utils'); | ||
@@ -38,9 +38,11 @@ const schemaExtractor = (handler = []) => ({ schema: (toFlatArray(handler).find(item => 'schema' in item) || {}).schema }); | ||
if (!fs.statSync(aggregateFile).isFile()) | ||
if (!fs.statSync(aggregateFile).isFile() || path.extname(aggregateFile) !== '.js') | ||
return; | ||
if (path.extname(aggregateFile) !== '.js') return; | ||
const basename = firstFilenamePart(aggregateFile); | ||
context[path.basename(aggregateName, '.js')] = loadAggregate(aggregateFile, require(aggregateFile)); // eslint-disable-line | ||
if (context[basename]) | ||
throw new Error(`Duplicate aggregator: [${basename}] in: ${aggregateFile} and ${context[basename].path}.`); | ||
context[basename] = loadAggregate(aggregateFile, require(aggregateFile)); // eslint-disable-line | ||
}); | ||
@@ -47,0 +49,0 @@ |
{ | ||
"name": "cqrs-swissknife", | ||
"version": "0.4.37", | ||
"version": "0.4.38", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,2 +6,4 @@ 'use strict'; | ||
const { firstFilenamePart } = require('../utils'); | ||
const loadCollections = (sagasDirectory) => { | ||
@@ -17,3 +19,8 @@ const sagas = {}; | ||
sagas[path.basename(sagaName, '.js')] = { | ||
const basename = firstFilenamePart(sagaFile); | ||
if (sagas[basename]) | ||
throw new Error(`Duplicate saga: [${basename}] in: ${sagaFile} and ${sagas[basename].path}.`); | ||
sagas[basename] = { | ||
path: sagaFile, | ||
@@ -20,0 +27,0 @@ }; |
@@ -112,2 +112,4 @@ 'use strict'; | ||
const firstFilenamePart = filename => filename.split('.', 1)[0]; | ||
module.exports = { | ||
@@ -125,2 +127,3 @@ toFlatArray, | ||
nameRetriever, | ||
firstFilenamePart, | ||
}; |
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
32186
839