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.
- package/lib/cjs/generate.d.ts +1 -0
- package/lib/cjs/generate.js +3 -1
- package/lib/esm/generate.d.ts +1 -0
- package/lib/esm/generate.js +3 -1
- package/package.json +1 -1
package/lib/cjs/generate.d.ts
CHANGED
|
@@ -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;
|
package/lib/cjs/generate.js
CHANGED
|
@@ -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
|
|
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/lib/esm/generate.d.ts
CHANGED
|
@@ -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;
|
package/lib/esm/generate.js
CHANGED
|
@@ -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
|
|
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) {
|