Add require-param rule for sql-bindings (#19201)

* Add require-param rule for sql-bindings

* fix
This commit is contained in:
Charles Gagnon
2022-04-25 14:58:52 -07:00
committed by GitHub
parent 15803c2a05
commit 19dd85bfe3
5 changed files with 8 additions and 23 deletions

View File

@@ -28,6 +28,7 @@ export class TimeoutError extends Error { }
/**
* Consolidates on the error message string
* @param error The error object to get the message from
*/
export function getErrorMessage(error: any): string {
return (error instanceof Error)
@@ -94,24 +95,6 @@ export async function getAllProjectsInFolder(folder: vscode.Uri, projectExtensio
return (await glob(projFilter)).map(p => vscode.Uri.file(path.resolve(p)));
}
/**
* Format a string. Behaves like C#'s string.Format() function.
*/
export function formatString(str: string, ...args: any[]): string {
// This is based on code originally from https://github.com/Microsoft/vscode/blob/master/src/vs/nls.js
// License: https://github.com/Microsoft/vscode/blob/master/LICENSE.txt
let result: string;
if (args.length === 0) {
result = str;
} else {
result = str.replace(/\{(\d+)\}/g, (match, rest) => {
let index = rest[0];
return typeof args[index] !== 'undefined' ? args[index] : match;
});
}
return result;
}
/**
* Generates a quoted full name for the object
* @param schema of the object