Skip to content

Commit

Permalink
Fixed naming of const to be consistent with coding convention.
Browse files Browse the repository at this point in the history
  • Loading branch information
msfterictraut committed Jul 13, 2020
1 parent 60f4105 commit 8420847
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/src/analyzer/typeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export interface TypedDictEntry {
isProvided: boolean;
}

const SingleTickRegEx = /'/g;
const TripleTickRegEx = /'''/g;
const singleTickRegEx = /'/g;
const tripleTickRegEx = /'''/g;

export function isOptionalType(type: Type): boolean {
if (type.category === TypeCategory.Union) {
Expand Down Expand Up @@ -1649,9 +1649,9 @@ export function printLiteralValue(type: ObjectType): string {
const prefix = type.classType.details.name === 'bytes' ? 'b' : '';
literalStr = literalValue.toString();
if (literalStr.indexOf('\n') >= 0) {
literalStr = `${prefix}'''${literalStr.replace(TripleTickRegEx, "\\'\\'\\'")}'''`;
literalStr = `${prefix}'''${literalStr.replace(tripleTickRegEx, "\\'\\'\\'")}'''`;
} else {
literalStr = `${prefix}'${literalStr.replace(SingleTickRegEx, "\\'")}'`;
literalStr = `${prefix}'${literalStr.replace(singleTickRegEx, "\\'")}'`;
}
} else if (typeof literalValue === 'boolean') {
literalStr = literalValue ? 'True' : 'False';
Expand Down

0 comments on commit 8420847

Please sign in to comment.