@cabloy/module-info 1.0.3 → 1.0.5

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/README.md CHANGED
File without changes
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export * from './interface.js';
3
3
  export declare const ParseModuleNameLevelInit = 1;
4
4
  export declare function parseModuleName(level?: number): string | undefined;
5
5
  export declare function parseModuleInfo(level?: number): IModuleInfo | undefined;
6
- export declare function parseInfoFromPath(pathName: string): IModuleInfo | undefined;
6
+ export declare function parseInfoFromPath(pathName?: string | null): IModuleInfo | undefined;
7
7
  export declare function parseInfo(moduleName: any, type?: string): IModuleInfo | undefined;
8
8
  export declare function parseName(moduleUrl: any): any;
9
9
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -37,6 +37,8 @@ function parseModuleInfo(level = exports.ParseModuleNameLevelInit) {
37
37
  }
38
38
  exports.parseModuleInfo = parseModuleInfo;
39
39
  function parseInfoFromPath(pathName) {
40
+ if (!pathName)
41
+ return;
40
42
  pathName = pathName.replace(/\\/gi, '/');
41
43
  const parts = pathName.split('/');
42
44
  for (let i = parts.length - 1; i >= 0; i--) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/module-info",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "cabloy module-info",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -21,6 +21,9 @@
21
21
  "dist/**/*.js",
22
22
  "dist/**/*.d.ts"
23
23
  ],
24
+ "scripts": {
25
+ "lint": "eslint ."
26
+ },
24
27
  "keywords": [
25
28
  "egg",
26
29
  "egg-born",
@@ -30,8 +33,5 @@
30
33
  "author": "zhennann",
31
34
  "dependencies": {
32
35
  "stack-utils": "^2.0.6"
33
- },
34
- "scripts": {
35
- "lint": "eslint ."
36
36
  }
37
- }
37
+ }