Skip to content

Commit

Permalink
fix: deepMerge is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Dec 18, 2020
1 parent fd31fa7 commit 22ef2cc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/commands/pattern/pattern-builder.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const patternBuilder = require("../shared/schema-browser");
const schemaBrowser = require("../shared/schema-browser");
const inputUtil = require("../shared/input-util");

async function buildPattern(format, schemas) {
const { sourceName, schema } = await patternBuilder.getSchema(schemas);
const { sourceName, schema } = await schemaBrowser.getSchema(schemas);

let pattern = init(
sourceName,
Expand All @@ -27,17 +27,17 @@ async function buildPattern(format, schemas) {
pattern = Object.assign({}, lastItem);
}
objectArray = [];
patternBuilder.outputPattern(pattern, format);
schemaBrowser.outputPattern(pattern, format);
continue;
}
if (property.id === inputUtil.DONE) {
patternBuilder.outputPattern(pattern, format);
schemaBrowser.outputPattern(pattern, format);
break;
}
const path = chosenProp.$ref;
if (path) {
// If property points at reference, go to reference in schema and continue
currentObject = patternBuilder.findCurrent(path, schema);
currentObject = schemaBrowser.findCurrent(path, schema);
if (currentObject.properties) {
continue;
}
Expand All @@ -47,8 +47,8 @@ async function buildPattern(format, schemas) {

let current = buildSegment(answer, objectArray);

pattern = deepMerge(pattern, current);
outputPattern(pattern, format);
pattern = schemaBrowser.deepMerge(pattern, current);
schemaBrowser.outputPattern(pattern, format);
history.push(Object.assign({}, pattern));
reset();
}
Expand Down

0 comments on commit 22ef2cc

Please sign in to comment.