@jsnw/srv-utils 2.0.0 → 2.1.0

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
@@ -293,11 +293,12 @@ const configSchemas = {
293
293
  * @param {WithNestFn} fn - The function to be executed with the NestJS application context.
294
294
  * It receives the application instance and a callback to prevent
295
295
  * automatic application context closure.
296
+ * @param {NestApplicationContextOptions} [options]
296
297
  * @returns {Promise<void>} A promise that resolves when the function execution is complete.
297
298
  * @throws - Will throw an error if the `@nestjs/core` and/or `@nestjs/common` library is not found.
298
299
  * @throws - Will propagate any error thrown by the executed function `fn`.
299
300
  */
300
- async function withNest(moduleCls, fn) {
301
+ async function withNest(moduleCls, fn, options) {
301
302
  let nestFactory = null;
302
303
  try {
303
304
  nestFactory = (await import("@nestjs/core"))?.NestFactory;
@@ -305,7 +306,7 @@ async function withNest(moduleCls, fn) {
305
306
  } catch (e) {
306
307
  throw new Error("@nestjs/core and @nestjs/common are required for this function to work");
307
308
  }
308
- const app = await nestFactory.createApplicationContext(moduleCls);
309
+ const app = await nestFactory.createApplicationContext(moduleCls, options);
309
310
  let closeApplication = true;
310
311
  let _e = void 0;
311
312
  try {
package/dist/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { ErrorResult } from "@jsnw/common-utils";
3
3
  import { INestApplicationContext } from "@nestjs/common";
4
+ import { NestApplicationContextOptions } from "@nestjs/common/interfaces/nest-application-context-options.interface";
4
5
 
5
6
  //#region src/file-exists.d.ts
6
7
  /**
@@ -151,11 +152,12 @@ type WithNestFn = (app: INestApplicationContext, preventClosing: () => void) =>
151
152
  * @param {WithNestFn} fn - The function to be executed with the NestJS application context.
152
153
  * It receives the application instance and a callback to prevent
153
154
  * automatic application context closure.
155
+ * @param {NestApplicationContextOptions} [options]
154
156
  * @returns {Promise<void>} A promise that resolves when the function execution is complete.
155
157
  * @throws - Will throw an error if the `@nestjs/core` and/or `@nestjs/common` library is not found.
156
158
  * @throws - Will propagate any error thrown by the executed function `fn`.
157
159
  */
158
- declare function withNest(moduleCls: any, fn: WithNestFn): Promise<void>;
160
+ declare function withNest(moduleCls: any, fn: WithNestFn, options?: NestApplicationContextOptions): Promise<void>;
159
161
  //#endregion
160
162
  //#region src/create-random-string.d.ts
161
163
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsnw/srv-utils",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Server-side utilities for Node.js/TypeScript: tsconfig paths, Nest helpers, and config loading.",
5
5
  "engines": {
6
6
  "node": ">=20"