Skip to content

Commit e00ebcf

Browse files
author
Sophia Marie Terry
committed
CLOUDP-306294: Uncommented extension utilities
1 parent 875b880 commit e00ebcf

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ export const VERB_OVERRIDE_EXTENSION = 'x-xgen-method-verb-override';
33
// for endpoint
44
export function hasMethodWithVerbOverride(endpoint) {
55
const keys = Object.keys(endpoint);
6-
for (let i=0; i< keys.length; i++) {
6+
for (let i = 0; i < keys.length; i++) {
77
if (endpoint[keys[i]][VERB_OVERRIDE_EXTENSION]) {
8-
return true
8+
return true;
99
}
1010
}
1111
return false;
@@ -30,13 +30,13 @@ export function isLegacyCustomMethod(object) {
3030
export function isGetOverride(object) {
3131
if (hasVerbOverride(object)) {
3232
return object[VERB_OVERRIDE_EXTENSION].verb === 'get';
33-
}
33+
}
3434
return false;
3535
}
3636

3737
export function isListOverride(object) {
3838
if (hasVerbOverride(object)) {
3939
return object[VERB_OVERRIDE_EXTENSION].verb === 'list';
40-
}
40+
}
4141
return false;
42-
}
42+
}
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import { isSingleResourceIdentifier, isResourceCollectionIdentifier, isSingletonResource } from "./resourceEvaluation"
1+
import { isSingleResourceIdentifier, isResourceCollectionIdentifier, isSingletonResource } from './resourceEvaluation';
22

33
export function invalidGetMethod(resourcePath, resourcePaths) {
4-
return !isSingleResourceIdentifier(resourcePath) && !(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(resourcePaths))
4+
return (
5+
!isSingleResourceIdentifier(resourcePath) &&
6+
!(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(resourcePaths))
7+
);
58
}
69

710
export function invalidListMethod(resourcePath, resourcePaths) {
8-
return !isResourceCollectionIdentifier(resourcePath) || isSingletonResource(resourcePaths)
9-
}
11+
return !isResourceCollectionIdentifier(resourcePath) || isSingletonResource(resourcePaths);
12+
}

0 commit comments

Comments
 (0)