Skip to content

Commit cbaf505

Browse files
author
Sophia Marie Terry
committed
CLOUDP-328955: Switched from ember-inflector to inflection
1 parent 2deddc9 commit cbaf505

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
"precommit": "husky install"
1515
},
1616
"jest": {
17-
"transformIgnorePatterns": [
18-
"/node_modules/(?!ember-inflector/)"
19-
],
2017
"transform": {
2118
"^.+\\.[t|j]sx?$": "babel-jest"
2219
},
@@ -36,6 +33,7 @@
3633
"dotenv": "^17.0.1",
3734
"ember-inflector": "^6.0.0",
3835
"eslint-plugin-jest": "^29.0.1",
36+
"inflection": "^3.0.2",
3937
"markdown-table": "^3.0.4",
4038
"openapi-to-postmanv2": "5.0.0",
4139
"parquet-wasm": "^0.6.1"
@@ -49,14 +47,14 @@
4947
"aws-sdk-client-mock": "^4.1.0",
5048
"babel-jest": "^30.0.2",
5149
"babel-plugin-transform-import-meta": "^2.3.3",
50+
"brace-expansion": "4.0.1",
5251
"eslint": "^9.30.1",
5352
"eslint-plugin-require-extensions": "^0.1.3",
5453
"globals": "^16.3.0",
5554
"husky": "^9.1.7",
5655
"jest": "^30.0.3",
5756
"lint-staged": "^16.1.2",
58-
"prettier": "3.6.2",
59-
"brace-expansion": "4.0.1"
57+
"prettier": "3.6.2"
6058
},
6159
"engineStrict": false,
6260
"engines": {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { singularize } from 'ember-inflector';
1+
const inflection = require('inflection');
22
import { isPathParam, removePrefix, isSingleResourceIdentifier } from './resourceEvaluation.js';
33

44
const CAMEL_CASE = /[A-Z]?[a-z]+/g;
@@ -29,12 +29,12 @@ export function generateOperationID(method, path) {
2929

3030
let opID = verb;
3131
for (let i = 0; i < nouns.length - 1; i++) {
32-
opID += singularize(nouns[i]);
32+
opID += inflection.singularize(nouns[i]);
3333
}
3434

3535
// singularize final noun, dependent on resource identifier
3636
if (isSingleResourceIdentifier(resourceIdentifier) || verb === 'create') {
37-
nouns[nouns.length - 1] = singularize(nouns[nouns.length - 1]);
37+
nouns[nouns.length - 1] = inflection.singularize(nouns[nouns.length - 1]);
3838
}
3939

4040
opID += nouns.pop();

0 commit comments

Comments
 (0)