Skip to content

Commit

Permalink
Sonar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrohr committed Jun 13, 2024
1 parent 9557a08 commit 929e370
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/property-extractor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("Property Extractor", () => {
expect(async () => {
await PropertyExtractor.getPropertyListForObject(badObj);
}).rejects.toEqual(
'The given object does not have a "getDynamicProperties" method. Can not process property list.',
new Error('The given object does not have a "getDynamicProperties" method. Can not process property list.'),
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/property-extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Property } from "./property";
*/
async function getPropertyListForObject(obj: any): Promise<Array<Property>> {
if (!obj.hasOwnProperty("getDynamicProperties")) {
await Promise.reject('The given object does not have a "getDynamicProperties" method. Can not process property list.');
await Promise.reject(new Error('The given object does not have a "getDynamicProperties" method. Can not process property list.'));
}

return await obj.getDynamicProperties();
Expand Down

0 comments on commit 929e370

Please sign in to comment.