@jmm-devkit/ngx-form-generator 1.5.0 → 1.5.1

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,9 +1,14 @@
1
1
  import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
2
3
  /**
3
4
  * Saves the generated file
4
5
  * @param content - The content of the file to save.
5
6
  * @param fileName - The name of the file to save.
6
7
  */
7
8
  export function saveFile(content, fileName) {
9
+ const dir = path.dirname(fileName);
10
+ if (!fs.existsSync(dir)) {
11
+ fs.mkdirSync(dir, { recursive: true });
12
+ }
8
13
  fs.writeFileSync(fileName, content);
9
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmm-devkit/ngx-form-generator",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Generates an Angular ReactiveForm from a Swagger or OpenAPI definition",
5
5
  "type": "module",
6
6
  "main": "dist/generator-lib.js",