@danielhaim/titlecaser 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielhaim/titlecaser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Converts a string to title case with multiple style options, ability to ignore certain words, and handle acronyms",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"title case",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"tree": "tree -a -I 'node_modules|.git|.DS_Store'"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@babel/cli": "^7.
|
|
55
|
+
"@babel/cli": "^7.23.9",
|
|
56
56
|
"@babel/core": "^7.22.1",
|
|
57
57
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
58
58
|
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"exports-loader": "^5.0.0",
|
|
67
67
|
"jest": "^29.7.0",
|
|
68
68
|
"jest-environment-jsdom": "^29.5.0",
|
|
69
|
-
"jest-environment-puppeteer": "^
|
|
70
|
-
"jest-puppeteer": "^
|
|
71
|
-
"puppeteer": "^
|
|
72
|
-
"puppeteer-core": "^
|
|
69
|
+
"jest-environment-puppeteer": "^10.0.1",
|
|
70
|
+
"jest-puppeteer": "^10.0.1",
|
|
71
|
+
"puppeteer": "^22.1.0",
|
|
72
|
+
"puppeteer-core": "^22.1.0",
|
|
73
73
|
"terser-webpack-plugin": "^5.3.9",
|
|
74
|
-
"webpack": "^5.90.
|
|
74
|
+
"webpack": "^5.90.2",
|
|
75
75
|
"webpack-cli": "^5.1.4",
|
|
76
76
|
"webpack-node-externals": "^3.0.0"
|
|
77
77
|
},
|
package/src/TitleCaser.js
CHANGED
|
@@ -278,15 +278,14 @@ export class TitleCaser {
|
|
|
278
278
|
throw new TypeError("Invalid argument: term and replacement must be strings.");
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
+
const index = this.wordReplacementsList.findIndex((obj) => Object.keys(obj)[0] === term);
|
|
282
|
+
|
|
281
283
|
if (index !== -1) {
|
|
282
|
-
// If the term already exists in the array, update the replacement value
|
|
283
284
|
this.wordReplacementsList[index][term] = replacement;
|
|
284
285
|
} else {
|
|
285
|
-
// If the term doesn't exist in the array, add a new object with the term and replacement
|
|
286
286
|
this.wordReplacementsList.push({ [term]: replacement });
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
// Update the replace terms option
|
|
290
289
|
this.options.wordReplacementsList = this.wordReplacementsList;
|
|
291
290
|
}
|
|
292
291
|
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
"Redux", "Vue.js", "VueX", "SCSS", "AJAX", "GraphQL", "HTML",
|
|
32
32
|
"HTML5", "MySQL", "MongoDB", "PostgresQL", "SQLite", "ASP", "ASPX",
|
|
33
33
|
"Elasticsearch", "Nginx", "OpenSSL", "Webpack", "Unity3D",
|
|
34
|
-
"Kubernetes", "TensorFlow", "NPM"
|
|
34
|
+
"Kubernetes", "TensorFlow", "NPM", "cURL"
|
|
35
35
|
]
|
|
36
36
|
}
|