Skip to content

Commit

Permalink
feat: build individual files (#418)
Browse files Browse the repository at this point in the history
* feat: build individual files

* chore: set mocha timeout timeout

* chore: set mocha timeout timeout

* fix: Cannot read property 'forEach' of null

* fix: Cannot read property 'forEach' of null
  • Loading branch information
2fd authored Jan 31, 2023
1 parent 9abc987 commit 3e0ab15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ clean:

build: clean
@echo '> Building'
${TSC} --project . --declarationDir ./dist --outDir ./dist --noEmit false
${ROLLUP} -c --environment BUILD:production
$(MAKE) provision-bundled

Expand Down Expand Up @@ -49,7 +50,7 @@ lint:
${TSLINT} --project tsconfig.json

test:
node --experimental-modules --es-module-specifier-resolution=node node_modules/.bin/nyc node_modules/mocha/bin/_mocha
node --experimental-modules --es-module-specifier-resolution=node node_modules/.bin/nyc node_modules/mocha/bin/_mocha --timeout 60000
test-fast:
node --inspect --experimental-modules node_modules/.bin/_mocha $(TEST_ARGS)
test-fast-bail:
Expand Down
20 changes: 11 additions & 9 deletions src/Filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,17 @@ export abstract class AbstractFilter<ReceivedLog, TransformedLog = ReceivedLog>
if (this.callbacks.length) {
const result = await this.getChanges()

this.callbacks.forEach((cb) => {
if (this.formatter) {
result.forEach(($) => {
cb(this.formatter!($))
})
} else {
result.forEach(($) => cb($ as any))
}
})
if (result) {
this.callbacks.forEach((cb) => {
if (this.formatter) {
result.forEach(($) => {
cb(this.formatter!($))
})
} else {
result.forEach(($) => cb($ as any))
}
})
}
}

this.stopSemaphore.resolve(1)
Expand Down

0 comments on commit 3e0ab15

Please sign in to comment.