@ovotech/laminar-cli
Advanced tools
Comparing version 0.13.18 to 0.13.19
@@ -15,3 +15,3 @@ "use strict"; | ||
.createCommand('laminar') | ||
.version('0.13.18') | ||
.version('0.13.19') | ||
.description(`Laminar CLI - a tool for converting OpenApi and Avro Schemas to appropriate typescript types | ||
@@ -18,0 +18,0 @@ |
@@ -31,2 +31,3 @@ "use strict"; | ||
}; | ||
const toTypeScriptName = (name) => name.replace(/-/g, '_'); | ||
const convertArrayType = (context, schema) => (0, traverse_1.isSchemaObject)(schema) && Array.isArray(schema.type) | ||
@@ -66,3 +67,3 @@ ? (0, ts_compose_1.document)(context, ts_compose_1.Type.Union(schema.type.map(nodeType))) | ||
if ((0, traverse_1.isReferenceObject)(schema)) { | ||
const name = schema.$ref.split('/').reverse()[0]; | ||
const name = toTypeScriptName(schema.$ref.split('/').reverse()[0]); | ||
if ((_a = context.identifiers) === null || _a === void 0 ? void 0 : _a[name]) { | ||
@@ -69,0 +70,0 @@ return (0, ts_compose_1.document)(context, ts_compose_1.Type.Referance(name)); |
@@ -23,7 +23,7 @@ "use strict"; | ||
if (!context.refs[item.$ref]) { | ||
throw new Error(`Reference Error [${JSON.stringify(item)}] not found`); | ||
throw new Error(`Reference Error |${JSON.stringify(item)}| not found`); | ||
} | ||
const resolved = context.refs[item.$ref]; | ||
const resolved = (0, exports.getReferencedObject)(context.refs[item.$ref], guard, type, context); | ||
if (!guard(resolved)) { | ||
throw new Error(`Reference Error [${JSON.stringify(item)}] was not the expected type ${type}`); | ||
throw new Error(`Reference Error, the reference |${JSON.stringify(item)}| which was resolved to |${JSON.stringify(resolved)}| was not the expected type "${type}"`); | ||
} | ||
@@ -30,0 +30,0 @@ return resolved; |
{ | ||
"name": "@ovotech/laminar-cli", | ||
"version": "0.13.18", | ||
"version": "0.13.19", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108804
1834