Skip to content

Commit c95204c

Browse files
Apply refactor suggestions from code review
Co-authored-by: Lovisa Berggren <[email protected]>
1 parent a15ca0e commit c95204c

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tools/spectral/ipa/rulesets/functions/utils/extensions.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ return keys.contains(VERB_OVERRIDE_EXTENSION)
1919
* @returns {boolean} true if the object has an extension with customMethod=True, otherwise false
2020
*/
2121
export function hasCustomMethodOverride(object) {
22-
if (hasVerbOverride(object)) {
23-
return object[VERB_OVERRIDE_EXTENSION].customMethod;
24-
}
25-
return false;
22+
return hasVerbOverride(object)) && object[VERB_OVERRIDE_EXTENSION].customMethod;
2623
}
2724

2825
/**
@@ -32,12 +29,7 @@ export function hasCustomMethodOverride(object) {
3229
* @param verb the verb to inspect the extension for
3330
* @returns {boolean} true if the object has the extension with the given verb, otherwise false
3431
*/
35-
export function hasMethodVerbOverride(object, verb) {
36-
if (hasVerbOverride(object)) {
37-
return object[VERB_OVERRIDE_EXTENSION].verb === verb;
38-
}
39-
return false;
40-
}
32+
return hasVerbOverride(object) && object[VERB_OVERRIDE_EXTENSION].verb === verb
4133

4234
/**
4335
* Checks if the object has an extension "x-xgen-method-verb-override"

0 commit comments

Comments
 (0)