namirasoft-core 1.0.12 → 1.0.13

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.
@@ -1,7 +1,7 @@
1
1
  export declare class PackageService {
2
- static get(path: string): PackageService | null;
3
- static getMain(): PackageService | null;
4
- static getThis(): PackageService | null;
2
+ static get(path: string): PackageService;
3
+ static getMain(): PackageService;
4
+ static getThis(): PackageService;
5
5
  private json;
6
6
  constructor(json: any);
7
7
  getName(): string;
@@ -13,19 +13,19 @@ class PackageService {
13
13
  if (json)
14
14
  return new PackageService(json);
15
15
  }
16
- return null;
16
+ throw new Error("Coundn't find package");
17
17
  }
18
18
  static getMain() {
19
19
  const paths = (0, FindUp_1.FindUp)('package.json');
20
20
  if (paths)
21
21
  return this.get(paths[paths.length - 1]);
22
- return null;
22
+ throw new Error("Coundn't find package");
23
23
  }
24
24
  static getThis() {
25
25
  const paths = (0, FindUp_1.FindUp)('package.json');
26
26
  if (paths)
27
27
  return this.get(paths[0]);
28
- return null;
28
+ throw new Error("Coundn't find package");
29
29
  }
30
30
  constructor(json) {
31
31
  this.json = json;
@@ -1 +1 @@
1
- {"version":3,"file":"PackageService.js","sourceRoot":"","sources":["../src/PackageService.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,qCAAkC;AAElC,MAAa,cAAc;IAEvB,MAAM,CAAC,GAAG,CAAC,IAAY;QAEnB,IAAI,IAAI,EACR;YACI,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;YACvD,IAAI,IAAI;gBACJ,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;SACvC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,OAAO;QAEV,MAAM,KAAK,GAAG,IAAA,eAAM,EAAC,cAAc,CAAC,CAAC;QACrC,IAAI,KAAK;YACL,OAAO,IAAI,C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I,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC7C,CAAC;IACD,MAAM,CAAC,OAAO;QAEV,MAAM,KAAK,GAAG,IAAA,eAAM,EAAC,cAAc,CAAC,CAAC;QACrC,IAAI,KAAK;YACL,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC7C,CAAC;IACD,MAAM,CAAC,OAAO;QAEV,MAAM,KAAK,GAAG,IAAA,eAAM,EAAC,cAAc,CAAC,CAAC;QACrC,IAAI,KAAK;YACL,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC7C,CAAC;IAED,YAAY,IAAS;QAEjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IACD,OAAO;QAEH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,QAAQ;QAEJ,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3B,CAAC;IACD,cAAc;QAEV,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;IACjC,CAAC;IACD,OAAO;QAEH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,OAAO;QAEH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;IACD,UAAU;QAEN,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC7B,CAAC;CACJ;AAvDD,wCAuDC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "namirasoft-core",
3
3
  "description": "Namira Software Corporation Core NPM Package",
4
- "version": "1.0.12",
4
+ "version": "1.0.13",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "scripts": {},
@@ -3,7 +3,7 @@ import { FindUp } from "./FindUp";
3
3
 
4
4
  export class PackageService
5
5
  {
6
- static get(path: string): PackageService | null
6
+ static get(path: string): PackageService
7
7
  {
8
8
  if (path)
9
9
  {
@@ -11,21 +11,21 @@ export class PackageService
11
11
  if (json)
12
12
  return new PackageService(json);
13
13
  }
14
- return null;
14
+ throw new Error("Coundn't find package");
15
15
  }
16
- static getMain(): PackageService | null
16
+ static getMain(): PackageService
17
17
  {
18
18
  const paths = FindUp('package.json');
19
19
  if (paths)
20
20
  return this.get(paths[paths.length - 1]);
21
- return null;
21
+ throw new Error("Coundn't find package");
22
22
  }
23
- static getThis(): PackageService | null
23
+ static getThis(): PackageService
24
24
  {
25
25
  const paths = FindUp('package.json');
26
26
  if (paths)
27
27
  return this.get(paths[0]);
28
- return null;
28
+ throw new Error("Coundn't find package");
29
29
  }
30
30
  private json: any;
31
31
  constructor(json: any)