lambder 2.0.7 → 2.0.8

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.
@@ -154,10 +154,12 @@ export default class LambderResponseBuilder {
154
154
  ;
155
155
  async file(filePath, headers, fallbackFilePath) {
156
156
  const doesFileExist = await this.checkPublicFileExist(filePath);
157
- if (!doesFileExist && fallbackFilePath) {
158
- const doesFallbackExist = await this.checkPublicFileExist(fallbackFilePath);
159
- if (doesFallbackExist) {
160
- return await this.file(fallbackFilePath, headers);
157
+ if (!doesFileExist) {
158
+ if (fallbackFilePath) {
159
+ const doesFallbackExist = await this.checkPublicFileExist(fallbackFilePath);
160
+ if (doesFallbackExist) {
161
+ return await this.file(fallbackFilePath, headers);
162
+ }
161
163
  }
162
164
  return this.json({ error: "File not found: " + filePath });
163
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambder",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -211,10 +211,12 @@ export default class LambderResponseBuilder<TResponse = any> {
211
211
  fallbackFilePath?: string,
212
212
  ):Promise<LambderResolverResponse>{
213
213
  const doesFileExist = await this.checkPublicFileExist(filePath);
214
- if(!doesFileExist && fallbackFilePath){
215
- const doesFallbackExist = await this.checkPublicFileExist(fallbackFilePath);
216
- if(doesFallbackExist){
217
- return await this.file(fallbackFilePath, headers);
214
+ if(!doesFileExist){
215
+ if(fallbackFilePath){
216
+ const doesFallbackExist = await this.checkPublicFileExist(fallbackFilePath);
217
+ if(doesFallbackExist){
218
+ return await this.file(fallbackFilePath, headers);
219
+ }
218
220
  }
219
221
  return this.json({ error: "File not found: " + filePath })
220
222
  }