@nattyjs/common 0.0.1-beta.31 → 0.0.1-beta.33

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/index.cjs CHANGED
@@ -404,7 +404,7 @@ class List {
404
404
  if (this.count()) {
405
405
  return predicate ? this.where(predicate).first() : this._entities[0];
406
406
  } else {
407
- throw new Error("No result found.");
407
+ return void 0;
408
408
  }
409
409
  }
410
410
  firstOrDefault(predicate) {
@@ -603,6 +603,10 @@ function registerType(type) {
603
603
  }
604
604
 
605
605
  class AbstractRunner {
606
+ stop() {
607
+ if (this.childProcess)
608
+ return this.childProcess.kill();
609
+ }
606
610
  async exec(command, args, cwd = process.cwd()) {
607
611
  const options = {
608
612
  cwd,
@@ -615,6 +619,7 @@ class AbstractRunner {
615
619
  [...args],
616
620
  options
617
621
  );
622
+ this.childProcess = child;
618
623
  child.stdout.on(
619
624
  "data",
620
625
  (data) => {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { RequestRouteInfo, IHttpResult, IModelBindingContext, ProblemDetail, IExceptionContext, HttpResponseInit, NattyTestModule, ModelBinding, BuildOptions, TypesInfo, ClassTypeInfo } from '@nattyjs/types';
2
+ import { ChildProcess } from 'child_process';
2
3
 
3
4
  interface ClassType<T> extends Function {
4
5
  new (...args: any[]): T;
@@ -90,6 +91,8 @@ interface NattyConfig {
90
91
 
91
92
  declare abstract class AbstractRunner {
92
93
  abstract run(): void;
94
+ childProcess: ChildProcess;
95
+ stop(): boolean;
93
96
  protected exec(command: string, args: any[], cwd?: string): Promise<null | string>;
94
97
  }
95
98
 
package/dist/index.mjs CHANGED
@@ -387,7 +387,7 @@ class List {
387
387
  if (this.count()) {
388
388
  return predicate ? this.where(predicate).first() : this._entities[0];
389
389
  } else {
390
- throw new Error("No result found.");
390
+ return void 0;
391
391
  }
392
392
  }
393
393
  firstOrDefault(predicate) {
@@ -586,6 +586,10 @@ function registerType(type) {
586
586
  }
587
587
 
588
588
  class AbstractRunner {
589
+ stop() {
590
+ if (this.childProcess)
591
+ return this.childProcess.kill();
592
+ }
589
593
  async exec(command, args, cwd = process.cwd()) {
590
594
  const options = {
591
595
  cwd,
@@ -598,6 +602,7 @@ class AbstractRunner {
598
602
  [...args],
599
603
  options
600
604
  );
605
+ this.childProcess = child;
601
606
  child.stdout.on(
602
607
  "data",
603
608
  (data) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nattyjs/common",
3
- "version": "0.0.1-beta.31",
3
+ "version": "0.0.1-beta.33",
4
4
  "description": "Now I’m the model of a modern major general / The venerated Virginian veteran whose men are all / Lining up, to put me up on a pedestal / Writin’ letters to relatives / Embellishin’ my elegance and eloquence / But the elephant is in the room / The truth is in ya face when ya hear the British cannons go / BOOM",
5
5
  "keywords": [],
6
6
  "author": "ajayojha <ojhaajay@outlook.com>",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/node": "20.3.1",
24
- "@nattyjs/types": "0.0.1-beta.31",
24
+ "@nattyjs/types": "0.0.1-beta.33",
25
25
  "unbuild": "1.2.1"
26
26
  }
27
27
  }