Skip to content

Commit

Permalink
feat(dandi/common): make AppError.indent public
Browse files Browse the repository at this point in the history
supports #69
  • Loading branch information
DanielSchaffer committed Feb 24, 2020
1 parent 3ccb202 commit d22518f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/dandi/common/src/app-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class AppError extends Error {
return undefined
}

private static indent(source: string, level: number): string {
public static indent(source: string, level: number): string {
if (!source) {
return source
}
Expand All @@ -29,6 +29,10 @@ export class AppError extends Error {
return lines.join(`${linebreak}${spacer}`)
}

public static indentLine(source: string, level: number): string {
return `${AppError.getIndent(level)}${source}`
}

private static getIndent(level: number): string {
return Array(level + 1).join(BASE_SPACER)
}
Expand Down

0 comments on commit d22518f

Please sign in to comment.