lambder 1.0.8 → 1.0.10

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.
package/dist/Resolver.js CHANGED
@@ -36,6 +36,7 @@ export default class Resolver {
36
36
  readFileSync(filePath) {
37
37
  const publicPath = pathLibrary.resolve(this.publicPath);
38
38
  const absolutePath = pathLibrary.resolve(publicPath, filePath);
39
+ console.log("readFileSync", { filePath, publicPath, absolutePath });
39
40
  if (!absolutePath.includes(publicPath)) {
40
41
  return "forbiddenpath";
41
42
  }
@@ -43,8 +44,9 @@ export default class Resolver {
43
44
  }
44
45
  ;
45
46
  checkFileExist(filePath) {
46
- const absolutePath = pathLibrary.resolve(filePath);
47
47
  const publicPath = pathLibrary.resolve(this.publicPath);
48
+ const absolutePath = pathLibrary.resolve(this.publicPath, filePath);
49
+ console.log("checkFileExist", { filePath, publicPath, absolutePath });
48
50
  if (!absolutePath.includes(publicPath)) {
49
51
  return false;
50
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambder",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/Resolver.ts CHANGED
@@ -82,12 +82,14 @@ export default class Resolver {
82
82
  private readFileSync(filePath: string){
83
83
  const publicPath = pathLibrary.resolve(this.publicPath);
84
84
  const absolutePath = pathLibrary.resolve(publicPath, filePath);
85
+ console.log("readFileSync", { filePath, publicPath, absolutePath });
85
86
  if(!absolutePath.includes(publicPath)){ return "forbiddenpath"; }
86
87
  return fs.readFileSync(absolutePath);
87
88
  };
88
89
  private checkFileExist(filePath: string){
89
- const absolutePath = pathLibrary.resolve(filePath);
90
90
  const publicPath = pathLibrary.resolve(this.publicPath);
91
+ const absolutePath = pathLibrary.resolve(this.publicPath, filePath);
92
+ console.log("checkFileExist", { filePath, publicPath, absolutePath });
91
93
  if(!absolutePath.includes(publicPath)){ return false; }
92
94
  return fs.existsSync(absolutePath);
93
95
  };