mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-16 00:20:06 +00:00
Added suggestions
This commit is contained in:
@@ -3,20 +3,21 @@ export const assert = (
|
||||
message = "Assertion failed"
|
||||
) => {
|
||||
let result;
|
||||
|
||||
try {
|
||||
if (typeof expression === "boolean") {
|
||||
result = expression;
|
||||
} else {
|
||||
result = expression();
|
||||
}
|
||||
if (typeof expression === "boolean") result = expression;
|
||||
else result = expression();
|
||||
} catch (e) {
|
||||
console.error(message);
|
||||
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
if (!!result) {
|
||||
return;
|
||||
} else {
|
||||
console.error(message);
|
||||
|
||||
throw new Error(message);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user