Skip to content

Commit

Permalink
fix: crash to wrong spelling in localeCompare
Browse files Browse the repository at this point in the history
fixes #1218
  • Loading branch information
RomanHotsiy committed Mar 29, 2020
1 parent 89054da commit 3908a7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/services/models/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ export class SchemaModel {
}
}

const inversedMapping = isLimitedToMapping ? { ...explicitInversedMapping } : { ...implicitInversedMapping, ...explicitInversedMapping };
const inversedMapping = isLimitedToMapping
? { ...explicitInversedMapping }
: { ...implicitInversedMapping, ...explicitInversedMapping };

let refs: Array<{ $ref; name }> = [];

Expand All @@ -276,7 +278,7 @@ export class SchemaModel {
}
}

// Make the listing respects the mapping
// Make the listing respects the mapping
// in case a mapping is defined, the user usually wants to have the order shown
// as it was defined in the yaml. This will sort the names given the provided
// mapping (if provided).
Expand All @@ -292,7 +294,7 @@ export class SchemaModel {

if (indexLeft < 0 && indexRight < 0) {
// out of mapping, order by name
return left.name.localCompare(right.name);
return left.name.localeCompare(right.name);
} else if (indexLeft < 0) {
// the right is found, so mapping wins
return 1;
Expand Down

0 comments on commit 3908a7c

Please sign in to comment.