mobiletto-orm-typedef-gen 2.1.42 → 2.1.43

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.
@@ -10,6 +10,7 @@ export type GenerateOptions = {
10
10
  header?: string;
11
11
  typescript?: boolean;
12
12
  name?: string;
13
+ rootOnly?: boolean;
13
14
  disclaimer?: string;
14
15
  prepareContext?: (typeDef: MobilettoOrmTypeDef, ctx: Record<string, unknown>) => Record<string, unknown>;
15
16
  mobilettoOrmObjectPackage?: string;
@@ -110,8 +110,10 @@ export const generate = (typeDef, templatePath, opts) => {
110
110
  const typescript = !opts || opts.typescript !== false;
111
111
  const mobilettoOrmObjectPackage = (opts === null || opts === void 0 ? void 0 : opts.mobilettoOrmObjectPackage) || "mobiletto-orm-typedef";
112
112
  const disclaimer = (opts === null || opts === void 0 ? void 0 : opts.disclaimer) ? opts.disclaimer : STANDARD_AUTOGEN_FILE_DISCLAIMER;
113
+ const rootOnly = (opts === null || opts === void 0 ? void 0 : opts.rootOnly) === true;
113
114
  const name = (opts === null || opts === void 0 ? void 0 : opts.name) ? opts.name : typeDef.typeName;
114
- const decls = [...findDecls(name, typeDef.fields), { name, fields: typeDef.fields, root: true }];
115
+ const rootDecl = { name, fields: typeDef.fields, root: true };
116
+ const decls = rootOnly ? [rootDecl] : [...findDecls(name, typeDef.fields), rootDecl];
115
117
  let allData = "";
116
118
  let first = true;
117
119
  while (decls.length > 0) {
@@ -10,6 +10,7 @@ export type GenerateOptions = {
10
10
  header?: string;
11
11
  typescript?: boolean;
12
12
  name?: string;
13
+ rootOnly?: boolean;
13
14
  disclaimer?: string;
14
15
  prepareContext?: (typeDef: MobilettoOrmTypeDef, ctx: Record<string, unknown>) => Record<string, unknown>;
15
16
  mobilettoOrmObjectPackage?: string;
@@ -110,8 +110,10 @@ export const generate = (typeDef, templatePath, opts) => {
110
110
  const typescript = !opts || opts.typescript !== false;
111
111
  const mobilettoOrmObjectPackage = (opts === null || opts === void 0 ? void 0 : opts.mobilettoOrmObjectPackage) || "mobiletto-orm-typedef";
112
112
  const disclaimer = (opts === null || opts === void 0 ? void 0 : opts.disclaimer) ? opts.disclaimer : STANDARD_AUTOGEN_FILE_DISCLAIMER;
113
+ const rootOnly = (opts === null || opts === void 0 ? void 0 : opts.rootOnly) === true;
113
114
  const name = (opts === null || opts === void 0 ? void 0 : opts.name) ? opts.name : typeDef.typeName;
114
- const decls = [...findDecls(name, typeDef.fields), { name, fields: typeDef.fields, root: true }];
115
+ const rootDecl = { name, fields: typeDef.fields, root: true };
116
+ const decls = rootOnly ? [rootDecl] : [...findDecls(name, typeDef.fields), rootDecl];
115
117
  let allData = "";
116
118
  let first = true;
117
119
  while (decls.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobiletto-orm-typedef-gen",
3
- "version": "2.1.42",
3
+ "version": "2.1.43",
4
4
  "type": "module",
5
5
  "description": "generate various files based on mobiletto-orm-typedef definitions",
6
6
  "keywords": [