@webtypen/webframez-core 0.3.26 → 0.3.29

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.
@@ -44,8 +44,11 @@ class LocalStorageDriver {
44
44
  return key === mime;
45
45
  });
46
46
  if (configKey && ((_a = this.config.fileHandlers[configKey]) === null || _a === void 0 ? void 0 : _a.handlers)) {
47
- for (let handler of this.config.fileHandlers[configKey].handlers) {
48
- yield handler(p, contents, payload);
47
+ for (let handlerKey in this.config.fileHandlers[configKey].handlers) {
48
+ const handler = this.config.fileHandlers[configKey].handlers[handlerKey];
49
+ if (typeof handler === "function") {
50
+ yield handler(p, contents, payload);
51
+ }
49
52
  }
50
53
  }
51
54
  }
@@ -158,7 +158,7 @@ class Response {
158
158
  this.header("Content-Disposition", `attachment; filename="${filename}"`);
159
159
  }
160
160
  // @ts-ignore
161
- var readStream = fs_1.default.createReadStream(filePath, { start: start, end: end });
161
+ var readStream = fs_1.default.createReadStream(filepath, { start: start, end: end });
162
162
  readStream.on("error", (streamError) => {
163
163
  console.error("WebframezStreamError:", streamError);
164
164
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.3.26",
3
+ "version": "0.3.29",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",
@@ -37,8 +37,11 @@ export class LocalStorageDriver implements BaseStorageDriver {
37
37
  });
38
38
 
39
39
  if (configKey && this.config.fileHandlers[configKey]?.handlers) {
40
- for (let handler of this.config.fileHandlers[configKey].handlers) {
41
- await handler(p, contents, payload);
40
+ for (let handlerKey in this.config.fileHandlers[configKey].handlers) {
41
+ const handler = this.config.fileHandlers[configKey].handlers[handlerKey];
42
+ if (typeof handler === "function") {
43
+ await handler(p, contents, payload);
44
+ }
42
45
  }
43
46
  }
44
47
  }
@@ -166,7 +166,7 @@ export class Response {
166
166
  }
167
167
 
168
168
  // @ts-ignore
169
- var readStream = fs.createReadStream(filePath, { start: start, end: end });
169
+ var readStream = fs.createReadStream(filepath, { start: start, end: end });
170
170
 
171
171
  readStream.on("error", (streamError) => {
172
172
  console.error("WebframezStreamError:", streamError);