xml-model 1.1.1 → 1.1.2

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
@@ -13,6 +13,7 @@ import XMLModelVitePlugin from "xml-model/vite";
13
13
  export default defineConfig({
14
14
  plugins: [
15
15
  // see options in JSDoc
16
+ // note that is tsconfig that includes your source files is not tsconfig.json you MUST use the tsconfig option
16
17
  XMLModelVitePlugin(),
17
18
  ],
18
19
  // ... rest of the config
@@ -1,6 +1,7 @@
1
1
  import { Constructor } from 'typescript-rtti';
2
2
  import { XMLModelOptions, XMLModelPropertyOptions, CreateXMLModelOptions } from './types';
3
3
  import { XMLRoot } from '../types';
4
+ export declare function getParentModel(model: XMLModel<any>): XMLModel<any>;
4
5
  export declare class XMLModel<T = any> {
5
6
  readonly type: Constructor<T>;
6
7
  options: XMLModelOptions<T>;
@@ -237,6 +237,7 @@ export {
237
237
  Prop,
238
238
  XMLModel,
239
239
  createModel,
240
- getModel
240
+ getModel,
241
+ getParentModel
241
242
  };
242
243
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-model",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "allows transparent XML <-> Object conversion in typescript",
5
5
  "license": "MIT",
6
6
  "author": "MathisTLD",
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "scripts": {
24
- "preversion": "npm test",
24
+ "preversion": "npm test -- --run",
25
25
  "version": "npm run build",
26
26
  "postversion": "git push && git push --tags",
27
27
  "build": "vite build",
@@ -6,6 +6,7 @@ import { Plugin } from 'vite';
6
6
  */
7
7
  export declare function FixClassNames(): Plugin;
8
8
  type RTTIPluginOptions = {
9
+ tsconfig?: string;
9
10
  /** Files where the rtti transformer should be applied
10
11
  *
11
12
  * If not set, will include every files by default
@@ -21,12 +21,13 @@ function FixClassNames() {
21
21
  };
22
22
  }
23
23
  function TypescriptRTTI(options = {}) {
24
- const { include, exclude, debug = false } = options;
24
+ const { tsconfig, include, exclude, debug = false } = options;
25
25
  const doTransform = !include && !exclude ? () => true : (path) => {
26
26
  if (exclude?.test(path)) return false;
27
27
  return include ? include.test(path) : true;
28
28
  };
29
29
  return typescript({
30
+ tsconfig,
30
31
  transformers: {
31
32
  before: [
32
33
  {