@danielhaim/titlecaser 1.7.0 → 1.7.2
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/README.md +231 -87
- package/dist/titlecaser.amd.js +5 -0
- package/dist/titlecaser.module.js +5 -0
- package/index.d.ts +23 -0
- package/package.json +16 -14
- package/src/TitleCaser.js +120 -53
- package/src/TitleCaserConsts.js +188 -33
- package/src/TitleCaserUtils.js +166 -202
- package/src/data/brandList.json +532 -89
- package/src/data/businessFinanceLegalTerms.json +108 -14
- package/src/data/eCommerceDigitalTerms.json +13 -3
- package/src/data/globalGeography.json +197 -41
- package/src/data/marketingMediaTerms.json +37 -6
- package/src/data/militaryTerms.json +153 -0
- package/src/data/miscSpecializedTerms.json +12 -3
- package/src/data/techComputingConcepts.json +184 -26
- package/src/data/timeAcademicTerms.json +32 -5
package/README.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
TitleCaser
|
|
2
|
-
==========
|
|
1
|
+
# TitleCaser
|
|
3
2
|
|
|
4
3
|
[](https://www.npmjs.com/package/@danielhaim/titlecaser)
|
|
5
4
|
[](https://www.npmjs.com/package/@danielhaim/titlecaser)
|
|
6
5
|

|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
A powerful utility for converting text to title case with support for multiple style guides and extensive customization options.
|
|
9
8
|
|
|
10
9
|
<a target="_blank" href="https://danielhaim1.github.io/TitleCaser/"><img src="https://raw.githubusercontent.com/danielhaim1/TitleCaser/main/docs/assets/demo.png" width="100%" height="auto" alt="TitleCaser Demo"></a>
|
|
11
10
|
|
|
@@ -31,69 +30,108 @@ Transform any text to proper title case format using popular style guides such a
|
|
|
31
30
|
* [Test](#test)
|
|
32
31
|
* [Resources](#resources)
|
|
33
32
|
* [Report Bugs](#report-bugs)
|
|
33
|
+
* [Contributing](CONTRIBUTING.md)
|
|
34
|
+
* [Changelog](CHANGELOG.md)
|
|
34
35
|
|
|
35
|
-
Overview
|
|
36
|
-
--------
|
|
36
|
+
## Overview
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
TitleCaser is a comprehensive solution for converting text to title case according to various style guides (AP, APA, Chicago, NYT, Wikipedia, British). It handles special cases like hyphens, apostrophes, Roman numerals, and acronyms, and provides extensive customization options.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
## Language Conventions and Style Library
|
|
41
41
|
|
|
42
|
-
The
|
|
42
|
+
**The comprehensive Language Conventions and Style Library (LCSL)** is specifically designed to assist web content developers in adhering to the latest style guides and English language conventions. This all-inclusive library has various features, including support for numerous style guides such as **AP, APA, Chicago, NY Times, Wikipedia, and British styles** and customizable preferences to tailor to individual needs. **TitleCaser is a component of this library**, and LCSL is set to be open-sourced by the end of 2023.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
### Streamlined Workflow
|
|
45
|
+
To streamline workflow, modules are available in both **browser and node environment versions** and include a command-line interface for building, testing, and minimizing the module. Additionally, it features a **filter ability** that allows users to ignore certain phrases containing short words, preventing the module from mistakenly flagging instances where short words are used as part of a larger term or phrase.
|
|
45
46
|
|
|
46
|
-
###
|
|
47
|
+
### Comprehensive Capitalization Handling
|
|
48
|
+
The module has been designed to handle various capitalization scenarios, including:
|
|
49
|
+
- **Hyphenated words**
|
|
50
|
+
- **Prefixes and suffixes**
|
|
51
|
+
- **Reserved words**
|
|
52
|
+
- **Roman numerals**
|
|
53
|
+
- **Proper nouns** that contain lowercase letters
|
|
54
|
+
- **Words that require capitalization** in specific contexts
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
- Advanced capitalization handling for suffixes, prefixes, hyphenated words, and reserved words
|
|
50
|
-
- Support for proper capitalization of Roman numerals and exclusion of specific words and phrases from title capitalization
|
|
51
|
-
- Word replacement capabilities for consistency in capitalization
|
|
52
|
-
Command-line interface for building, testing, and minimizing the module
|
|
53
|
-
- Pre-defined word lists for articles, conjunctions, prepositions, and non-capitalized words in titles
|
|
54
|
-
- Exclusion of common phrases from title capitalization
|
|
56
|
+
This ensures that your content meets the appropriate style and formatting guidelines, regardless of the context. It also offers **word replacement capabilities**, as well as **ignored phrases** to create consistency in cases where certain terms may be capitalized differently depending on the context.
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
### Essential Tool for Content Developers
|
|
59
|
+
Whether you're developing web content for a major news organization or simply looking to improve your writing skills, this module is an **essential tool** that can help ensure your work is accurate, consistent, and conforms to the latest style guidelines.
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
### Key Features:
|
|
62
|
+
- **Support for popular style guides** and customizable preferences
|
|
63
|
+
- **Advanced capitalization handling** for suffixes, prefixes, hyphenated words, and reserved words
|
|
64
|
+
- **Support for proper capitalization** of Roman numerals and exclusion of specific words and phrases from title capitalization
|
|
65
|
+
- **Word replacement capabilities** for consistency in capitalization
|
|
66
|
+
- **Command-line interface** for building, testing, and minimizing the module
|
|
67
|
+
- **Pre-defined word lists** for articles, conjunctions, prepositions, and non-capitalized words in titles
|
|
68
|
+
- **Exclusion of common phrases** from title capitalization
|
|
69
|
+
|
|
70
|
+
## Features
|
|
71
|
+
|
|
72
|
+
- **Multiple Style Support**: AP, APA, Chicago, NYT, Wikipedia, and British title case styles
|
|
73
|
+
- **Special Case Handling**: Hyphens, apostrophes, Roman numerals, acronyms, and more
|
|
74
|
+
- **Word Replacement**: Replace specific words with their correct forms
|
|
75
|
+
- **Exact Phrase Replacement**: Replace exact phrases with their correct forms
|
|
76
|
+
- **Smart Quotes**: Optional conversion to smart quotes
|
|
77
|
+
- **Extensive Term Lists**: Includes extensive lists of correctly cased terms
|
|
78
|
+
- **Customizable Options**: Customize word lists, replacements, and other options
|
|
79
|
+
|
|
80
|
+
## Installation
|
|
60
81
|
|
|
61
82
|
```bash
|
|
62
|
-
npm
|
|
83
|
+
npm install @danielhaim/titlecaser
|
|
63
84
|
```
|
|
64
85
|
|
|
65
|
-
|
|
86
|
+
## Usage
|
|
66
87
|
|
|
67
|
-
The package can be imported and used in both Node.js and browser environments
|
|
88
|
+
The package can be imported and used in both Node.js and browser environments:
|
|
68
89
|
|
|
69
|
-
```
|
|
70
|
-
import
|
|
90
|
+
```javascript
|
|
91
|
+
import { TitleCaser } from '@danielhaim/titlecaser';
|
|
71
92
|
|
|
72
|
-
|
|
93
|
+
// Basic usage with Chicago style
|
|
94
|
+
const titleCaser = new TitleCaser({
|
|
73
95
|
style: 'chicago'
|
|
74
|
-
};
|
|
96
|
+
});
|
|
97
|
+
const result = titleCaser.toTitleCase('the book of life');
|
|
98
|
+
console.log(result); // "The Book of Life"
|
|
75
99
|
|
|
76
|
-
|
|
100
|
+
// With custom options
|
|
101
|
+
const customTitleCaser = new TitleCaser({
|
|
102
|
+
style: 'ap',
|
|
103
|
+
smartQuotes: true,
|
|
104
|
+
ignoredWords: ['a', 'an', 'the'],
|
|
105
|
+
acronyms: ['API', 'JSON', 'XML']
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const customResult = customTitleCaser.toTitleCase('the api and json data');
|
|
109
|
+
console.log(customResult); // "The API and JSON Data"
|
|
77
110
|
|
|
78
|
-
|
|
79
|
-
|
|
111
|
+
// Add custom word replacements
|
|
112
|
+
titleCaser.addReplaceTerm('js', 'JavaScript');
|
|
113
|
+
const jsResult = titleCaser.toTitleCase('js development');
|
|
114
|
+
console.log(jsResult); // "JavaScript Development"
|
|
80
115
|
|
|
81
|
-
|
|
116
|
+
// Add exact phrase replacements
|
|
117
|
+
titleCaser.addExactPhraseReplacements([
|
|
118
|
+
{ 'the correct phrase': 'The Correct Phrase' }
|
|
119
|
+
]);
|
|
120
|
+
const phraseResult = titleCaser.toTitleCase('this is the correct phrase');
|
|
121
|
+
console.log(phraseResult); // "This Is The Correct Phrase"
|
|
82
122
|
```
|
|
83
123
|
|
|
84
|
-
|
|
124
|
+
## Usage in the Browser
|
|
85
125
|
|
|
86
126
|
The function can also be used in a browser environment by including the `TitleCaser.amd.js` script in your HTML file:
|
|
87
127
|
|
|
88
|
-
Here's an example of how to use the modulate function:
|
|
89
|
-
|
|
90
128
|
```html
|
|
91
129
|
<script src="./path/to/TitleCaser.amd.js"></script>
|
|
92
130
|
```
|
|
93
131
|
|
|
94
132
|
After that, the `toTitleCase()` function can be accessed in your JavaScript code like this:
|
|
95
133
|
|
|
96
|
-
```
|
|
134
|
+
```javascript
|
|
97
135
|
const options = {
|
|
98
136
|
style: 'apa'
|
|
99
137
|
};
|
|
@@ -103,7 +141,7 @@ const output = input.toTitleCase(options);
|
|
|
103
141
|
console.log(output); // The Future of DevOps: The Next Era
|
|
104
142
|
```
|
|
105
143
|
|
|
106
|
-
### Example
|
|
144
|
+
### Example with HTML Elements
|
|
107
145
|
|
|
108
146
|
```html
|
|
109
147
|
<h2>nodejs development on aws: an in-depth tutorial on server-side javascript deployment</h2>
|
|
@@ -111,7 +149,7 @@ console.log(output); // The Future of DevOps: The Next Era
|
|
|
111
149
|
<h2>back-end and front-end</h2>
|
|
112
150
|
```
|
|
113
151
|
|
|
114
|
-
```
|
|
152
|
+
```javascript
|
|
115
153
|
function applyTitleCaseToH2Elements(options = { style: "apa" }) {
|
|
116
154
|
try {
|
|
117
155
|
const h2Elements = document.querySelectorAll("h2");
|
|
@@ -131,8 +169,7 @@ function applyTitleCaseToH2Elements(options = { style: "apa" }) {
|
|
|
131
169
|
applyTitleCaseToH2Elements();
|
|
132
170
|
```
|
|
133
171
|
|
|
134
|
-
Options
|
|
135
|
-
-------
|
|
172
|
+
## Options
|
|
136
173
|
|
|
137
174
|
The `{options}` parameter is an object that contains the settings for the conversion process.
|
|
138
175
|
|
|
@@ -144,8 +181,7 @@ The `{options}` parameter is an object that contains the settings for the conver
|
|
|
144
181
|
- `wordReplacementsList` is a map of terms that will be replaced during the title case conversion process.
|
|
145
182
|
- `smartQuotes` boolean value that determines whether quotes should be replaced with smart quotes.
|
|
146
183
|
|
|
147
|
-
Methods
|
|
148
|
-
-------
|
|
184
|
+
## Methods
|
|
149
185
|
|
|
150
186
|
- `setReplaceTerms(terms)`: Updates the `wordReplacementsList` with new term-replacement pairs. It accepts an array of objects, each containing a single key-value pair representing the term and its replacement.
|
|
151
187
|
- `removeReplaceTerm(term)`: Removes a replaced term from the `wordReplacementsList` array in the option object of the `TitleCaser` instance. Throws an error if the term is not found in the array, otherwise removes it from the array and updates the option object.
|
|
@@ -154,17 +190,24 @@ Methods
|
|
|
154
190
|
- `setStyle(style: string)`: Sets the style option in the object of the TitleCaser instance. The method takes a string argument style that specifies the style to use for the title casing. If the argument is not a string, the method throws a TypeError. Otherwise, it updates the style option in the object.
|
|
155
191
|
- `smartQuotes(smartQuotes: boolean)`: Specifies whether to replace straight quotes with smart quotes during title casing. Provide a boolean argument smartQuotes to enable or disable this feature.
|
|
156
192
|
|
|
157
|
-
Examples
|
|
158
|
-
--------
|
|
193
|
+
## Examples
|
|
159
194
|
|
|
160
|
-
|
|
195
|
+
### Basic Usage
|
|
161
196
|
|
|
162
|
-
|
|
197
|
+
```javascript
|
|
198
|
+
import { TitleCaser } from '@danielhaim/titlecaser';
|
|
199
|
+
|
|
200
|
+
const titleCaser = new TitleCaser();
|
|
201
|
+
const result = titleCaser.toTitleCase('hello world');
|
|
202
|
+
console.log(result); // "Hello World"
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Customizing Word Replacements Method
|
|
163
206
|
|
|
164
207
|
In the example below, we create a new instance of the `TitleCaser` class with the `APA` style option. We then set multiple replacement terms using two separate calls to the `setReplaceTerms()` method. Descriptive variable names are used for the input string and expected output. We call `toTitleCase()` to convert the input string to a title case.
|
|
165
208
|
|
|
166
|
-
```
|
|
167
|
-
import
|
|
209
|
+
```javascript
|
|
210
|
+
import { TitleCaser } from '@danielhaim/titlecaser';
|
|
168
211
|
|
|
169
212
|
const titleCaser = new TitleCaser({
|
|
170
213
|
style: 'apa'
|
|
@@ -187,12 +230,12 @@ const expectedOutput = "Hello World, Replace Me!";
|
|
|
187
230
|
const outputString = titleCaser.toTitleCase(inputString);
|
|
188
231
|
```
|
|
189
232
|
|
|
190
|
-
### Customizing TitleCaser
|
|
233
|
+
### Customizing TitleCaser
|
|
191
234
|
|
|
192
235
|
The example below demonstrates how to use the TitleCaser class to convert a string to a title case with specific settings.
|
|
193
236
|
|
|
194
|
-
```
|
|
195
|
-
import
|
|
237
|
+
```javascript
|
|
238
|
+
import { TitleCaser } from '@danielhaim/titlecaser';
|
|
196
239
|
|
|
197
240
|
// Set the options object
|
|
198
241
|
const options = {
|
|
@@ -217,12 +260,12 @@ const expectedOutput = "The Basics of Node.js Development with MongoDB";
|
|
|
217
260
|
const actualOutput = titleCaser.toTitleCase(input);
|
|
218
261
|
```
|
|
219
262
|
|
|
220
|
-
### TitleCaser with Default Word Replacement
|
|
263
|
+
### TitleCaser with Default Word Replacement
|
|
221
264
|
|
|
222
265
|
The example below demonstrates how to use the TitleCaser class to convert a string to a title case with AP style formatting, including hyphenated words and word/brand replacement.
|
|
223
266
|
|
|
224
|
-
```
|
|
225
|
-
import
|
|
267
|
+
```javascript
|
|
268
|
+
import { TitleCaser } from '@danielhaim/titlecaser';
|
|
226
269
|
|
|
227
270
|
// Instantiate a new TitleCaser object with AP style formatting
|
|
228
271
|
const titleCaser = new TitleCaser({ style: 'ap' });
|
|
@@ -237,12 +280,12 @@ const expectedOutput = 'Node.js Development on AWS: An In-depth Tutorial on Serv
|
|
|
237
280
|
const actualOutput = titleCaser.toTitleCase(input);
|
|
238
281
|
```
|
|
239
282
|
|
|
240
|
-
### TitleCaser with Possessive Noun and a Colon
|
|
283
|
+
### TitleCaser with Possessive Noun and a Colon
|
|
241
284
|
|
|
242
285
|
The example below demonstrates how to use the TitleCaser class to convert a string to title case with AP style formatting, including a possessive noun and a colon.
|
|
243
286
|
|
|
244
|
-
```
|
|
245
|
-
import
|
|
287
|
+
```javascript
|
|
288
|
+
import { TitleCaser } from '@danielhaim/titlecaser';
|
|
246
289
|
|
|
247
290
|
// Instantiate a new TitleCaser object with AP style formatting
|
|
248
291
|
const titleCaser = new TitleCaser({ style: "ap" });
|
|
@@ -257,12 +300,12 @@ const expectedOutput = "The iPhone's Impact on Modern Communication: A Socioling
|
|
|
257
300
|
const actualOutput = titleCaser.toTitleCase(input);
|
|
258
301
|
```
|
|
259
302
|
|
|
260
|
-
### TitleCaser with Smart Quotes
|
|
303
|
+
### TitleCaser with Smart Quotes
|
|
261
304
|
|
|
262
305
|
The example below demonstrates how to use the TitleCaser with smart quotes.
|
|
263
306
|
|
|
264
|
-
```
|
|
265
|
-
import
|
|
307
|
+
```javascript
|
|
308
|
+
import { TitleCaser } from '@danielhaim/titlecaser';
|
|
266
309
|
|
|
267
310
|
// Instantiate a new TitleCaser object with AP style formatting and smart quotes enabled
|
|
268
311
|
const titleCaser = new TitleCaser({
|
|
@@ -274,14 +317,104 @@ const titleCaser = new TitleCaser({
|
|
|
274
317
|
const input = '"Never underestimate the power O\' persistence,"';
|
|
275
318
|
|
|
276
319
|
// Set the expected output
|
|
277
|
-
const expectedOutput = '
|
|
320
|
+
const expectedOutput = '"Never Underestimate the Power O' Persistence,"';
|
|
278
321
|
|
|
279
322
|
// Call the toTitleCase method and store the result in actualOutput
|
|
280
323
|
const actualOutput = titleCaser.toTitleCase(input);
|
|
281
324
|
```
|
|
282
325
|
|
|
283
|
-
|
|
284
|
-
|
|
326
|
+
## Architecture
|
|
327
|
+
|
|
328
|
+
TitleCaser is structured into three main components:
|
|
329
|
+
|
|
330
|
+
1. **TitleCaser.js** - The main class that provides the public API
|
|
331
|
+
2. **TitleCaserConsts.js** - Contains constants, configuration, and data structures
|
|
332
|
+
3. **TitleCaserUtils.js** - Contains utility functions for text processing
|
|
333
|
+
|
|
334
|
+
### Data Structure
|
|
335
|
+
|
|
336
|
+
The package uses several JSON files to store specialized terms:
|
|
337
|
+
|
|
338
|
+
- **brandList.json**: Brand names and trademarks
|
|
339
|
+
- **businessFinanceLegalTerms.json**: Business and legal terminology
|
|
340
|
+
- **eCommerceDigitalTerms.json**: E-commerce and digital terms
|
|
341
|
+
- **globalGeography.json**: Geographic terms
|
|
342
|
+
- **marketingMediaTerms.json**: Marketing and media terms
|
|
343
|
+
- **miscSpecializedTerms.json**: Miscellaneous specialized terms
|
|
344
|
+
- **techComputingConcepts.json**: Technology and computing terms
|
|
345
|
+
- **timeAcademicTerms.json**: Time and academic terms
|
|
346
|
+
|
|
347
|
+
## API Reference
|
|
348
|
+
|
|
349
|
+
### Constructor
|
|
350
|
+
|
|
351
|
+
```javascript
|
|
352
|
+
new TitleCaser(options)
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
#### Options
|
|
356
|
+
|
|
357
|
+
- `style` (string): Title case style ('ap', 'apa', 'chicago', 'nyt', 'wikipedia', 'british')
|
|
358
|
+
- `smartQuotes` (boolean): Convert straight quotes to curly quotes
|
|
359
|
+
- `ignoredWords` (array): Words to ignore in title casing
|
|
360
|
+
- `acronyms` (array): Words to treat as acronyms
|
|
361
|
+
|
|
362
|
+
### Methods
|
|
363
|
+
|
|
364
|
+
#### toTitleCase(text)
|
|
365
|
+
|
|
366
|
+
Converts text to title case according to the selected style.
|
|
367
|
+
|
|
368
|
+
```javascript
|
|
369
|
+
const result = titleCaser.toTitleCase('hello world');
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
#### setReplaceTerms(replaceTerms)
|
|
373
|
+
|
|
374
|
+
Sets the word replacement list.
|
|
375
|
+
|
|
376
|
+
```javascript
|
|
377
|
+
titleCaser.setReplaceTerms([
|
|
378
|
+
{ 'js': 'JavaScript' },
|
|
379
|
+
{ 'api': 'API' }
|
|
380
|
+
]);
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
#### addReplaceTerm(term, replacement)
|
|
384
|
+
|
|
385
|
+
Adds a single term replacement.
|
|
386
|
+
|
|
387
|
+
```javascript
|
|
388
|
+
titleCaser.addReplaceTerm('js', 'JavaScript');
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
#### removeReplaceTerm(term)
|
|
392
|
+
|
|
393
|
+
Removes a term from the replacement list.
|
|
394
|
+
|
|
395
|
+
```javascript
|
|
396
|
+
titleCaser.removeReplaceTerm('js');
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
#### addExactPhraseReplacements(phrases)
|
|
400
|
+
|
|
401
|
+
Adds exact phrase replacements.
|
|
402
|
+
|
|
403
|
+
```javascript
|
|
404
|
+
titleCaser.addExactPhraseReplacements([
|
|
405
|
+
{ 'the correct phrase': 'The Correct Phrase' }
|
|
406
|
+
]);
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
#### setStyle(style)
|
|
410
|
+
|
|
411
|
+
Sets the title case style.
|
|
412
|
+
|
|
413
|
+
```javascript
|
|
414
|
+
titleCaser.setStyle('chicago');
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
## Build Process
|
|
285
418
|
|
|
286
419
|
```bash
|
|
287
420
|
npm run build-package
|
|
@@ -290,14 +423,46 @@ npm run copy-package-to-docs
|
|
|
290
423
|
npm run test
|
|
291
424
|
```
|
|
292
425
|
|
|
293
|
-
Test
|
|
294
|
-
----
|
|
426
|
+
## Test
|
|
295
427
|
|
|
296
428
|
```bash
|
|
297
429
|
npm run test
|
|
298
430
|
```
|
|
299
431
|
|
|
300
|
-
|
|
432
|
+
## Resources
|
|
433
|
+
|
|
434
|
+
Useful materials for improving your knowledge of writing and language style guides. These resources include various books and manuals, such as the Publication Manual of the American Psychological Association, the Chicago Manual of Style, and the AP Stylebook, which are widely recognized as authoritative sources on grammar, punctuation, and capitalization rules.
|
|
435
|
+
|
|
436
|
+
- [AP Stylebook, 56th Edition](https://store.stylebooks.com/ap-stylebook-56th-edition-print.html)
|
|
437
|
+
- [Publication Manual of the American Psychological Association, Seventh Edition (2020)](https://apastyle.apa.org/products/publication-manual-7th-edition)
|
|
438
|
+
- [Chicago Manual of Style: Capitalization](https://chat.openai.com/chat/643828ec-d4b5-4f21-b035-62946dd2cec3#:~:text=Chicago%20Manual%20of%20Style%3A%20Capitalization)
|
|
439
|
+
- [The Bluebook: A Uniform System of Citation. 21st ed. Cambridge: Harvard Law Review Association, 2020](https://open.mitchellhamline.edu/cgi/viewcontent.cgi?article=2782&context=wmlr)
|
|
440
|
+
- [The Chicago Manual of Style, 17th Edition](https://press.uchicago.edu/ucp/books/book/chicago/C/bo25956703.html)
|
|
441
|
+
- [The New York Times Manual of Style and Usage](https://www.worldcat.org/title/946964415)
|
|
442
|
+
- [Wikipedia: Letter case](https://chat.openai.com/chat/643828ec-d4b5-4f21-b035-62946dd2cec3#:~:text=Wikipedia%3A%20Letter%20case)
|
|
443
|
+
- [Wikipedia:Manual of Style/Titles of works](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Titles_of_works#Capital_letters)
|
|
444
|
+
|
|
445
|
+
## Report Bugs
|
|
446
|
+
|
|
447
|
+
If you encounter any bugs or issues while using the library or the demo page, please report them by opening a new issue in the repository's issue tracker.
|
|
448
|
+
|
|
449
|
+
When reporting a bug, please provide as much detail as possible, including the steps to reproduce the issue and any error messages that you see. I appreciate any contribution to improving this library.
|
|
450
|
+
|
|
451
|
+
## Contributing
|
|
452
|
+
|
|
453
|
+
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
|
|
454
|
+
|
|
455
|
+
## License
|
|
456
|
+
|
|
457
|
+
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
|
|
458
|
+
|
|
459
|
+
## Changelog
|
|
460
|
+
|
|
461
|
+
See [CHANGELOG.md](CHANGELOG.md) for a list of changes and version history.
|
|
462
|
+
|
|
463
|
+
## Tests
|
|
464
|
+
|
|
465
|
+
```bash
|
|
301
466
|
Testing Acronym/Pronoun of Alpha2/3 Country Codes
|
|
302
467
|
✓ Capitalizes country code "US" correctly in a geopolitical context (4 ms)
|
|
303
468
|
✓ Does not capitalize "us" when used as a pronoun (2 ms)
|
|
@@ -358,25 +523,4 @@ Test Reserved Words
|
|
|
358
523
|
✓ Title case transformation for a sentence with HTML line break (nl2br) without space after colon using <br> tag (1 ms)
|
|
359
524
|
✓ Ampersand in a sentence should return & and not &Amp; (1 ms)
|
|
360
525
|
✓ Untrimmed white spaces
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
Resources
|
|
364
|
-
---------
|
|
365
|
-
|
|
366
|
-
Useful materials for improving your knowledge of writing and language style guides. These resources include various books and manuals, such as the Publication Manual of the American Psychological Association, the Chicago Manual of Style, and the AP Stylebook, which are widely recognized as authoritative sources on grammar, punctuation, and capitalization rules.
|
|
367
|
-
|
|
368
|
-
- [AP Stylebook, 56th Edition](https://store.stylebooks.com/ap-stylebook-56th-edition-print.html)
|
|
369
|
-
- [Publication Manual of the American Psychological Association, Seventh Edition (2020)](https://apastyle.apa.org/products/publication-manual-7th-edition)
|
|
370
|
-
- [Chicago Manual of Style: Capitalization](https://chat.openai.com/chat/643828ec-d4b5-4f21-b035-62946dd2cec3#:~:text=Chicago%20Manual%20of%20Style%3A%20Capitalization)
|
|
371
|
-
- [The Bluebook: A Uniform System of Citation. 21st ed. Cambridge: Harvard Law Review Association, 2020](https://open.mitchellhamline.edu/cgi/viewcontent.cgi?article=2782&context=wmlr)
|
|
372
|
-
- [The Chicago Manual of Style, 17th Edition](https://press.uchicago.edu/ucp/books/book/chicago/C/bo25956703.html)
|
|
373
|
-
- [The New York Times Manual of Style and Usage](https://www.worldcat.org/title/946964415)
|
|
374
|
-
- [Wikipedia: Letter case](https://chat.openai.com/chat/643828ec-d4b5-4f21-b035-62946dd2cec3#:~:text=Wikipedia%3A%20Letter%20case)
|
|
375
|
-
- [Wikipedia:Manual of Style/Titles of works](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Titles_of_works#Capital_letters)
|
|
376
|
-
|
|
377
|
-
Report Bugs
|
|
378
|
-
-----------
|
|
379
|
-
|
|
380
|
-
If you encounter any bugs or issues while using the library or the demo page, please report them by opening a new issue in the repository's issue tracker.
|
|
381
|
-
|
|
382
|
-
When reporting a bug, please provide as much detail as possible, including the steps to reproduce the issue and any error messages that you see. I appreciate any contribution to improving this library.
|
|
526
|
+
```
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @danielhaim/titlecaser - v1.7.2 - 2025-04-09
|
|
3
|
+
* https://github.com/danielhaim1/titlecaser.git
|
|
4
|
+
* Copyright (c) 2025 Daniel Haim, Licensed Apache-2.0
|
|
5
|
+
*/(()=>{var e={16:e=>{"use strict";e.exports=JSON.parse('{"ranks":["Pvt.","Cpl.","Sgt.","SSgt.","GySgt.","MSgt.","1stSgt.","SgtMaj.","WO1","CW2","CW3","CW4","CW5","2ndLt.","1stLt.","Capt.","Maj.","LtCol.","Col.","BrigGen.","MajGen.","LtGen.","Gen.","Adm.","Cpt.","Cmdr.","Lt.","Ens."],"branches":["Army","Navy","Air Force","Marines","Coast Guard","Space Force","National Guard","People\'s Liberation Army","Russian Ground Forces","JASDF","ROKA"],"units":["Platoon","Company","Battalion","Regiment","Brigade","Division","Corps","Squad","Fleet","Wing","Squadron","Task Force","Eurocorps","Battlegroup","Rapid Reaction Force","Joint Expeditionary Force"],"acronyms":["DoD","NATO","EUFOR","EUTM","OSCE","UNSC","JAG","ROTC","AFB","MOS","AWOL","MRE","IED","FOB","TOC","CONUS","OCONUS","UCMJ","USMC","USAF","USN","USA","SOCOM","CENTCOM","NORAD","PACOM","JTF","RPG","SAM","ASEAN","AUKUS","QUAD","CSTO","SCO","CFSP","EEAS","EUMS","Frontex","GRU","FSB","PLAN","PLAAF"],"equipment":["Humvee","MRAP","Apache","Black Hawk","Bradley","Abrams","F-16","F-22","F-35","B-2","B-52","C-130","LCAC","MRE"],"operations":["Operation Desert Storm","Operation Enduring Freedom","Operation Iraqi Freedom","Operation Inherent Resolve"],"treaties":["Lisbon Treaty","Maastricht Treaty","Treaty of Rome","Nice Treaty","Schengen Agreement"],"regions":["South China Sea","Taiwan Strait","Korean DMZ","Kashmir","Kuril Islands","Senkaku Islands"],"alliances":["NATO","AUKUS","QUAD","ASEAN","SCO","CSTO","Five Eyes"]}')},157:e=>{"use strict";e.exports=JSON.parse('{"countries":["Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cabo Verde","Cambodia","Cameroon","Canada","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo","Costa Rica","Cote d\'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Fiji","Finland","France","Gabon","Gambia","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","North Macedonia","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Korea","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor-Leste","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe"],"alpha2":["UK"],"alpha3":["USA"]}')},223:e=>{"use strict";e.exports=JSON.parse('{"sports":["FIFA","UEFA","NBA","NFL","MLB","NHL","NASCAR","IOC","FIBA","ATP","WTA","PGA","LPGA","FIA","WADA","ITF","AFL","NRL","ICC","IRB","IHF","FIVB","FINA","UCI","IAAF","ISU","WSF","BWF","WBC","WBO","IBF","IBO","UEFA","CONMEBOL","CONCACAF","CAF","AFC","OFC","CPL","MLS","LaLiga","Bundesliga","Ligue1","Eredivisie","JLeague","KLeague","Ryder Cup","Davis Cup","FedCup","XGames","Olympics","Paralympics","Dakar"],"apple":["Apple","AirDrop","AirPlay","AirPods","AirTags","FinalCut","GarageBand","iBooks","iCloud","iLife","iMac","iMessage","iMovie","iPhoto","iWatch","iWork","LogicPro","macOS","ProTools","QuickTime","iPhone","iPad","iPod","iOS","macOS","tvOS","watchOS"],"corporate":["Deloitte","Devoteam","ExxonMobil","GE","Boeing","Shell","Chevron"],"tech":["Bing","Salesforce","Asus","Acer","Lenovo","Huawei","Xiaomi","Epson","Nvidia","AMD","Qualcomm","Logitech","Panasonic","Sharp","Toshiba","Philips","Fujitsu","Netgear","Lexmark","Razer","SAP","Symantec","Kaspersky","Avast","McAfee","Siemens","Canon","Nikon","Garmin","GoPro","Oculus","Zoom","Slack","Trello","WeChat","Alibaba","Tencent","Baidu","Roku","Fitbit","Dropbox","Reddit","TikTok","Slack","Trello","Uber","Zoom","Reddit","Quora","JIRA","ZoomInfo","HubSpot","Mailchimp","WeChat","Dropbox","Uber","Telegram","Discord","StackOverflow","Quora","Reddit","ZoomInfo","Airbnb","LinkedIn","Snapchat","GitHub","GitLab","Nginx","OpenSSL","Webpack","Unity3D","Figma","JIRA","Kubernetes","TensorFlow","NPM","WooCommerce","WordPress","Slack","Trello","Uber","Zoom","Reddit","Quora","WeChat","Dropbox","Telegram","Discord","StackOverflow","Airbnb","LinkedIn","Snapchat","JIRA","MobX","VMware","Google"],"business":["Visa","Mastercard","Citibank","JPMorgan","Barclay","AMEX","Citigroup","PayPal","BNP","HSBC","Santander","UBS","Allianz","Prudential","Vanguard","BlackRock","CapitalOne","TD","Robinhood","MoneyGram","SoFi","Experian","Equifax","TransUnion","MasterCard","Blockchain","Coinbase","Binance","Kraken","Ethereum","Bitcoin"],"automotive":["BMW","Ford","Mercedes","Nissan","Tesla","Toyota","Audi","Chevrolet","Chrysler","Dodge","Ferrari","Fiat","Honda","Hyundai","Infiniti","Jaguar","Jeep","Kia","Lamborghini","LandRover","Lexus","Maserati","Mazda","McLaren","Mitsubishi","Peugeot","Porsche","Renault","RollsRoyce","Saab","Subaru","Suzuki","Volkswagen","Volvo","Alfa Romeo","Bentley","Bugatti","Cadillac","Citroen","Daewoo","Daihatsu","Datsun","DeLorean","Fiat Chrysler","GMC","Holden","Hummer","Isuzu","Koenigsegg","Lancia","Lincoln","Lotus","Mahindra","Suzuki","Opel","Pagani","Perodua","Proton","Rover","Scania","Skoda","SsangYong","Tata","Vauxhall","VinFast","Yugo","Zenvo"],"media":["Disney","Netflix","YouTube","Instagram","Twitter","Facebook","Spotify","Hulu","TikTok","Snapchat","Vimeo","Twitch","Reddit","HBO","Showtime","Starz","Crunchyroll","Audible","Pixar","DreamWorks","MGM","Lionsgate","Miramax","EpicGames","Ubisoft","Blizzard","Capcom","Bethesda","Sega","Roku","Fandango","IMDb","Shazam","SoundCloud","Vevo","Vine","Zynga","Tidal","Quibi","Crave","Gaia","PlutoTV","Vudu","Kanopy","Mubi","BritBox"],"telecom":["Verizon","Sprint","Nokia","Ericsson","Vodafone","AT&T","Huawei","Xiaomi","Orange","NTT","T-Mobile","Telefonica","Airtel","Telstra","Rogers","Bell","MTN","ZTE","Qualcomm","Motorola","Telus","BT","Swisscom","SoftBank","KDDI"],"entertainment":["Disney","Netflix","YouTube","Instagram","Twitter","Facebook","Spotify","Hulu","TikTok","Snapchat","Vimeo","Twitch","Reddit","Pandora","HBO","Showtime","Starz","Paramount","Peacock","Crunchyroll","Audible","Pixar","DreamWorks","MGM","Lionsgate","Miramax","EpicGames","Ubisoft","Blizzard","Capcom","Bethesda","Sega","Roku","Fandango","IMDb","Shazam","SoundCloud","Vevo","Zynga","Tidal","Oscars"],"retail":["Amazon","eBay","IKEA","Walmart","Zara","Target","Costco","Sephora","Nordstrom","Tesco","Asda","Aldi","Lidl","Carrefour","Uniqlo","H&M","Gap","Cabela’s","BassPro","REI","Ulta","Saks","JCPenney","Belk","Argos","Safeway","Kroger","Publix","HomeDepot","Woolworths","Staples","OfficeMax","B&H","Newegg","MicroCenter","Frys","Monoprix","Waitrose","Morrisons","Ocado","Flipkart","Rakuten","Alibaba","JD","Taobao","Tmall","Guomei","Suning"],"food":["Nestle","Pepsi","Coca-Cola","PepsiCo","Starbucks","KFC","BurgerKing","PizzaHut","TacoBell","Kroger","Costco","Woolworths","Carrefour","Tesco","Aldi","Lidl","Walmart","Safeway","Publix","WholeFoods","RedBull","Monster","Nespresso","Heineken","Budweiser","Corona","Guinness","GeneralMills","Unilever","Kraft","Heinz","Danone","Campbell","Tyson","Conagra","Mondelez","Suntory","Diageo","Pernod"],"pharmaceutical":["Pfizer","Moderna","Gilead","Merck","Novartis","Sanofi","Roche","AbbVie","Amgen","Bayer","Biogen","BristolMyers","Celgene","GSK","Janssen","Lilly","Medtronic","Mylan","NovoNordisk","Regeneron","Teva","AstraZeneca","Boehringer","Daiichi","Eisai","Genentech","Grifols","Ipsen","Mundipharma","Otsuka","Purdue","Sandoz","Servier","SunPharma","Takeda","UCB","Viatris","Wockhardt","Zydus","Alkem"],"nonprofit":["NGO","NPO","NGOs","NPOs","UN","UNESCO","UNICEF","UNHCR","UNODC","UNDP","UNFPA","UNEP","UNRWA"]}')},279:(e,t,r)=>{var n,i;n=[t,r(416)],void 0===(i=function(e,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=u(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function u(e,t){if(e){if("string"==typeof e)return c(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function d(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(e,"__esModule",{value:!0}),t.TitleCaserUtils=void 0;var y=t.TitleCaserUtils=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,u=[{key:"validateOption",value:function(e,t){if(!Array.isArray(t))throw new TypeError("Invalid option: ".concat(e," must be an array"));if(!t.every((function(e){return"string"==typeof e})))throw new TypeError("Invalid option: ".concat(e," must be an array of strings"))}},{key:"validateOptions",value:function(e){for(var t=0,n=Object.keys(e);t<n.length;t++){var i=n[t];if("style"!==i)if("wordReplacementsList"!==i){if(!r.titleCaseDefaultOptionsList.hasOwnProperty(i))throw new TypeError("Invalid option: ".concat(i));this.TitleCaseValidator.validateOption(i,e[i])}else{if(!Array.isArray(e.wordReplacementsList))throw new TypeError("Invalid option: ".concat(i," must be an array"));var o,a=l(e.wordReplacementsList);try{for(a.s();!(o=a.n()).done;)if("string"!=typeof o.value)throw new TypeError("Invalid option: ".concat(i," must contain only strings"))}catch(e){a.e(e)}finally{a.f()}}else{if("string"!=typeof e.style)throw new TypeError("Invalid option: ".concat(i," must be a string"));if(!r.allowedTitleCaseStylesList.includes(e.style))throw new TypeError("Invalid option: ".concat(i," must be a string"))}}}},{key:"getTitleCaseOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=JSON.stringify({options:t,lowercaseWords:n});if(e.titleCaseOptionsCache.has(a))return e.titleCaseOptionsCache.get(a);var l=s(s(s({},r.titleCaseDefaultOptionsList[t.style||"ap"]),t),{},{smartQuotes:!!t.hasOwnProperty("smartQuotes")&&t.smartQuotes}),u=l.articlesList.concat(n).filter((function(e,t,r){return r.indexOf(e)===t})),c=l.shortConjunctionsList.concat(n).filter((function(e,t,r){return r.indexOf(e)===t})),p=l.shortPrepositionsList.concat(n).filter((function(e,t,r){return r.indexOf(e)===t})),d=[].concat(o((l.replaceTerms||[]).map((function(e){var t=i(e,2),r=t[0],n=t[1];return[r.toLowerCase(),n]}))),o(r.wordReplacementsList)),f={articlesList:u,shortConjunctionsList:c,shortPrepositionsList:p,neverCapitalizedList:o(l.neverCapitalizedList),replaceTerms:d,smartQuotes:l.smartQuotes};return e.titleCaseOptionsCache.set(a,f),f}},{key:"capitalizeFirstLetter",value:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}},{key:"isShortConjunction",value:function(t,r){var n=o(e.getTitleCaseOptions({style:r}).shortConjunctionsList),i=t.toLowerCase();return n.includes(i)}},{key:"isArticle",value:function(t,r){return e.getTitleCaseOptions({style:r}).articlesList.includes(t.toLowerCase())}},{key:"isShortPreposition",value:function(t,r){return e.getTitleCaseOptions({style:r}).shortPrepositionsList.includes(t.toLowerCase())}},{key:"isNeverCapitalized",value:function(t,r){var n="".concat(r,"_").concat(t.toLowerCase());if(e.isNeverCapitalizedCache.has(n))return e.isNeverCapitalizedCache.get(n);var i=e.getTitleCaseOptions({style:r}).neverCapitalizedList.includes(t.toLowerCase());return e.isNeverCapitalizedCache.set(n,i),i}},{key:"isShortWord",value:function(t,i){if("string"!=typeof t)throw new TypeError("Invalid input: word must be a string. Received ".concat(n(t),"."));if(!r.allowedTitleCaseStylesList.includes(i))throw new Error("Invalid option: style must be one of ".concat(r.allowedTitleCaseStylesList.join(", "),"."));return e.isShortConjunction(t,i)||e.isArticle(t,i)||e.isShortPreposition(t,i)||e.isNeverCapitalized(t,i)}},{key:"hasNumbers",value:function(e){return/\d/.test(e)}},{key:"hasUppercaseMultiple",value:function(e){for(var t=0,r=0;r<e.length&&t<2;r++)/[A-Z]/.test(e[r])&&t++;return t>=2}},{key:"hasUppercaseIntentional",value:function(e){if(e.length<=4)return/[A-Z]/.test(e.slice(1));var t=/[A-Z]/.test(e.slice(1)),r=/[a-z]/.test(e.slice(1));return t&&r}},{key:"isEntirelyUppercase",value:function(e){return e===e.toUpperCase()&&e!==e.toLowerCase()&&e.length>1}},{key:"isRegionalAcronym",value:function(e){if("string"!=typeof e)throw new TypeError("Invalid input: word must be a string.");if(e.length<2)return!1;var t=e.toLowerCase();return r.regionalAcronymList.includes(t)}},{key:"isRegionalAcronymNoDot",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"!=typeof e||"string"!=typeof t)return!1;var i=e.toLowerCase().replace(/[^\w\s]/g,""),o=t.toLowerCase().replace(/[^\w\s]/g,"");return!!(n&&r.regionalAcronymList.includes(i)&&["the"].includes(n.toLowerCase()))||r.regionalAcronymList.includes(i)&&r.directFollowingIndicatorsRegionalAcronym.includes(o)}},{key:"isFinalWordRegionalAcronym",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"!=typeof e||"string"!=typeof t)return!1;var i=e.toLowerCase().replace(/[^\w]/g,""),o=t.toLowerCase().replace(/[^\w]/g,""),a="string"==typeof n?n.toLowerCase().replace(/[^\w]/g,""):null;return!!(r.regionalAcronymList.includes(i)&&(r.regionalAcronymPrecedingWords.includes(o)||"the"===o&&a&&r.regionalAcronymPrecedingWords.includes(a)))}},{key:"normalizeRegionalAcronym",value:function(e){if("string"!=typeof e)throw new TypeError("Invalid input: word must be a string.");return e.toUpperCase()}},{key:"normalizeAcronymKey",value:function(e){return e.toLowerCase().replace(/\./g,"")}},{key:"normalizeCasingForWordByStyle",value:function(e,t){if(!e||!t||!r.titleCaseDefaultOptionsList[t])return!1;var n=e.toLowerCase(),i=r.titleCaseDefaultOptionsList[t],a=i.shortConjunctionsList,s=i.articlesList,l=i.shortPrepositionsList,u=i.neverCapitalizedList;return!![].concat(o(a),o(s),o(l),o(u)).includes(n)&&e}},{key:"hasSuffix",value:function(e){return e.length>2&&e.endsWith("'s")}},{key:"hasApostrophe",value:function(e){return-1!==e.indexOf("'")}},{key:"hasHyphen",value:function(e){return-1!==e.indexOf("-")||-1!==e.indexOf("–")||-1!==e.indexOf("—")}},{key:"hasRomanNumeral",value:function(e){if("string"!=typeof e||""===e)throw new TypeError("Invalid input: word must be a non-empty string.");var t=e.includes("'")?e.split("'"):[e],r=/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/i;return t.every((function(e){return r.test(e)}))}},{key:"hasHyphenRomanNumeral",value:function(t){if("string"!=typeof t||""===t)throw new TypeError("Invalid input: word must be a non-empty string.");for(var r=t.split("-"),n=0;n<r.length;n++)if(!e.hasRomanNumeral(r[n]))return!1;return!0}},{key:"hasHtmlBreak",value:function(e){return"nl2br"===e}},{key:"hasUnicodeSymbols",value:function(e){return/[^\x00-\x7F\u00A0-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u02B0-\u02FF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0800-\u083F\u0840-\u085F\u0860-\u087F\u0880-\u08AF\u08B0-\u08FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF]/.test(e)}},{key:"hasCurrencySymbols",value:function(e){return/[^\x00-\x7F\u00A0-\u00FF\u20AC\u20A0-\u20B9\u20BD\u20A1-\u20A2\u00A3-\u00A5\u058F\u060B\u09F2-\u09F3\u0AF1\u0BF9\u0E3F\u17DB\u20A6\u20A8\u20B1\u2113\u20AA-\u20AB\u20AA\u20AC-\u20AD\u20B9]/.test(e)}},{key:"isWordAmpersand",value:function(e){return/&|&/.test(e)}},{key:"startsWithSymbol",value:function(e){if("string"!=typeof e)throw new Error("Parameter 'word' must be a string. Received '".concat(n(e),"' instead."));if(0===e.length)return!1;var t=e.charAt(0);return"#"===t||"@"===t||"."===t}},{key:"escapeSpecialCharacters",value:function(e){return e.replace(/[&<>"']/g,(function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";default:return e}}))}},{key:"unescapeSpecialCharacters",value:function(e){return e.replace(/&|<|>|"|'/g,(function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'";default:return e}}))}},{key:"endsWithSymbol",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[".",",",";",":","?","!"];if("string"!=typeof e||!Array.isArray(t))throw new Error("Invalid arguments");return t.some((function(t){return e.endsWith(t)}))||t.includes(e.slice(-2))}},{key:"isWordIgnored",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.ignoredWordList;if(!Array.isArray(n))throw new TypeError("Invalid input: ignoredWords must be an array.");if("string"!=typeof e||""===e.trim())throw new TypeError("Invalid input: word must be a non-empty string.");return t=e.toLowerCase().trim(),n.includes(t)}},{key:"isWordInArray",value:function(e,t){return!!Array.isArray(t)&&t.some((function(t){return t.toLowerCase()===e.toLowerCase()}))}},{key:"convertQuotesToCurly",value:function(e){for(var t={"'":["‘","’"],'"':["“","”"]},r="",n=0;n<e.length;n++){var i=e[n],o=t[i];if(o){var a=e[n-1],s=e[n+1],l=a&&" "!==a&&"\n"!==a?o[1]:o[0];r+=l,l===o[1]&&/[.,;!?()\[\]{}:]/.test(s)&&(r+=s,n++)}else r+=i}return r}},{key:"replaceTerm",value:function(e,t){if("string"!=typeof e||""===e)throw new TypeError("Invalid input: word must be a non-empty string.");if(!t||"object"!==n(t))throw new TypeError("Invalid input: replaceTermObj must be a non-null object.");var r;if(r=e.toLowerCase(),t.hasOwnProperty(r))return t[r];if(t.hasOwnProperty(e))return t[e];var i=e.toUpperCase();return t.hasOwnProperty(i)?t[i]:e}},{key:"isElidedWord",value:function(e){if("string"!=typeof e||""===e.trim())throw new TypeError("Invalid input: word must be a non-empty string.");var t,r=new Set(["o’","fo’","ne’er","e’er","’tis","’twas","’n’"]),n=e.trim().toLowerCase().replace(/'/g,"’"),i=l(r);try{for(i.s();!(t=i.n()).done;){var o=t.value;if(n.startsWith(o))return!0}}catch(e){i.e(e)}finally{i.f()}return!1}},{key:"normalizeElidedWord",value:function(e){if("string"!=typeof e||""===e.trim())throw new TypeError("Invalid input: word must be a non-empty string.");var t,r=new Set(["o’","fo’","ne’er","e’er","’tis","’twas","’n’"]),n=e.trim(),i=n.replace(/'/g,"’").toLowerCase(),o=l(r);try{for(o.s();!(t=o.n()).done;){var a=t.value;if(i.startsWith(a)){var s=a.length,u=n.slice(s);return a.charAt(0).toUpperCase()+a.slice(1)+(u.length>0?u.charAt(0).toUpperCase()+u.slice(1):"")}}}catch(e){o.e(e)}finally{o.f()}return!1}},{key:"correctSuffix",value:function(e,t){if("string"!=typeof e||""===e)throw new TypeError("Invalid input: word must be a non-empty string.");if(!t||!Array.isArray(t)||t.some((function(e){return"string"!=typeof e})))throw new TypeError("Invalid input: correctTerms must be an array of strings.");if(/'s$/i.test(e)){var r=e.slice(0,-2),n=t.findIndex((function(e){return e.toLowerCase()===r.toLowerCase()}));if(n>=0){var i=t[n];return"".concat(i,"'s")}var o=r.charAt(0).toUpperCase()+r.slice(1);return"".concat(o,"'s")}return e}},{key:"correctTerm",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/[-']/;if("string"!=typeof e||""===e)throw new TypeError("Invalid input: word must be a non-empty string.");if(!t||!Array.isArray(t))throw new TypeError("Invalid input: correctTerms must be an array.");if(!("string"==typeof r||Array.isArray(r)||r instanceof RegExp))throw new TypeError("Invalid input: delimiters must be a string, an array of strings, or a regular expression.");"string"==typeof r?r=new RegExp("[".concat(r,"]")):Array.isArray(r)&&(r=new RegExp("[".concat(r.join(""),"]")));for(var n=e.split(r),i=n.length,o=function(){var e=n[a].toLowerCase(),r=t.findIndex((function(t){return t.toLowerCase()===e}));n[a]=r>=0?t[r]:n[a].charAt(0).toUpperCase()+n[a].slice(1).toLowerCase()},a=0;a<i;a++)o();var s=r.source.charAt(0);return e.includes("-")?s="-":e.includes("'")&&(s="'"),n.join(s)}},{key:"correctTermHyphenated",value:function(t,n){var i=t.split("-"),o=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},a=function(e){return e.charAt(0)+e.slice(1).toLowerCase()},s={ap:function(e,t){return 0===t?o(e):a(e)},chicago:o,apa:function(t,r,i){return e.isShortWord(t,n)&&r>0&&r<i-1?t.toLowerCase():o(t)},nyt:function(e,t){return 0===t?o(e):a(e)},wikipedia:function(e,t){return 0===t?o(e):a(e)}},l=s[n]||a,u=i.map((function(e,t){var n=e;if(/^(M{0,3})(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})'s$/i.test(e))return n.toUpperCase().replace(/'S$/,"'s");var o=/^(M{0,3})(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/i;if(o.test(e))return e.toUpperCase();if(e.includes("'")){var a=e.split("'");return a.every((function(e){return o.test(e)}))?n=a.map((function(e){return e.toUpperCase()})).join("'"):l(n,t,i.length)}var s=e.toLowerCase(),u=r.correctTitleCasingList.findIndex((function(e){return e.toLowerCase()===s}));if(u>=0)n=r.correctTitleCasingList[u];else if(s.endsWith("'s")){var c=s.substring(0,s.length-2),p=r.correctTitleCasingList.findIndex((function(e){return e.toLowerCase()===c}));p>=0&&(n="".concat(r.correctTitleCasingList[p],"'s"))}return l(n,t,i.length)}));return u.join("-")}}],(a=null)&&p(t.prototype,a),u&&p(t,u),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,a,u}();d(y,"TitleCaseValidator",void 0),d(y,"titleCaseOptionsCache",new Map),d(y,"isNeverCapitalizedCache",new Map)}.apply(t,n))||(e.exports=i)},321:e=>{"use strict";e.exports=JSON.parse('{"advertising":["AdWords","AdSense","AdMob","DoubleClick","SpotX"],"digitalMarketing":["DSP","SSP","CTR","CPA","CPC","CPL","CPM","CRM","SEO","SEM","SMM","A/B","CTOR","KPI","SERP","FAQ","PR"],"general":["B2B","B2C","CMO","USP","PWA","SMO","T&C","TOS","PP","UI","UX","UI/UX"],"blockchain":["PoE","PoW","PoC"],"accessibility":["A11Y"]}')},388:(e,t,r)=>{var n,i;n=[t,r(416),r(279)],void 0===(i=function(e,r,n){"use strict";function i(e,t,r){return(t=p(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return l(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function p(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}Object.defineProperty(e,"__esModule",{value:!0}),t.TitleCaser=void 0;t.TitleCaser=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,this.debug=t.debug||!1,this.wordReplacementsList=r.wordReplacementsList,this.correctPhraseCasingList=r.correctPhraseCasingList},(t=[{key:"logWarning",value:function(e){this.debug&&console.warn("Warning: ".concat(e))}},{key:"toTitleCase",value:function(e){var t=this;try{if(0===e.trim().length)throw new TypeError("Invalid input: input must not be empty.");if("string"!=typeof e)throw new TypeError("Invalid input: input must be a string.");if(void 0!==this.options&&"object"!==u(this.options))throw new TypeError("Invalid options: options must be an object.");var i=this.options,s=i.style,l=void 0===s?"ap":s,c=i.neverCapitalize,p=void 0===c?[]:c,d=i.replaceTermList,f=void 0===d?this.wordReplacementsList:d,y=i.smartQuotes,m=void 0!==y&&y,g=["nl2br"].concat(a(p)),h=n.TitleCaserUtils.getTitleCaseOptions(this.options,r.commonShortWords,r.wordReplacementsList),C=(h.articlesList,h.shortConjunctionsList,h.shortPrepositionsList,h.neverCapitalizedList,h.replaceTerms,h.smartQuotes,f.map((function(e){return Object.keys(e)[0].toLowerCase()}))),v=Object.fromEntries(f.map((function(e){return[Object.keys(e)[0].toLowerCase(),Object.values(e)[0]]})));this.logWarning("replaceTermsArray: ".concat(C)),this.logWarning("this.wordReplacementsList: ".concat(this.wordReplacementsList));var b=e.trim();b=(b=b.replace(/<\s*br\s*\/?\s*>/gi," nl2br ")).replace(/ {2,}/g,(function(e){return e.slice(0,1)})),n.TitleCaserUtils.isEntirelyUppercase(b.replace(/[^a-zA-Z]/g,""))&&(this.logWarning("Input string is entirely uppercase, normalizing to lowercase first"),b=b.toLowerCase());var S=b.split(" "),w=S.map((function(e,i){switch(!0){case n.TitleCaserUtils.isWordAmpersand(e):case n.TitleCaserUtils.hasHtmlBreak(e):case n.TitleCaserUtils.isWordIgnored(e,g):return e;case C.includes(e.toLowerCase()):return v[e.toLowerCase()];case n.TitleCaserUtils.isWordInArray(e,r.correctTitleCasingList):return n.TitleCaserUtils.correctTerm(e,r.correctTitleCasingList);case n.TitleCaserUtils.isElidedWord(e):return n.TitleCaserUtils.normalizeElidedWord(e);case n.TitleCaserUtils.hasHyphen(e):var o=e.replace(/[\W_]+$/,""),a=e.slice(o.length),s=o.split("-"),u=s.map((function(e){var t=e.toLowerCase();return C.includes(t)?v[t]:e})),c=u.every((function(e,t){return e===s[t]}))?n.TitleCaserUtils.correctTermHyphenated(e,l):u.join("-");return c.endsWith(a)?c:c+a;case n.TitleCaserUtils.hasSuffix(e,l):return n.TitleCaserUtils.correctSuffix(e,r.correctTitleCasingList);case n.TitleCaserUtils.hasUppercaseIntentional(e):return e;case n.TitleCaserUtils.isShortWord(e,l)&&0!==i:return i>0&&n.TitleCaserUtils.endsWithSymbol(S[i-1],[":","?","!","."])?e.charAt(0).toUpperCase()+e.slice(1):n.TitleCaserUtils.normalizeCasingForWordByStyle(e,l);case n.TitleCaserUtils.endsWithSymbol(e):t.logWarning("Check if the word ends with a symbol: ".concat(e));var p=e.split(/([.,\/#!$%\^&\*;:{}=\-_`~()?])/g);t.logWarning("Splitting word at symbols, result: ".concat(p));var d=p.map((function(e){if(t.logWarning("Processing part: ".concat(e)),n.TitleCaserUtils.endsWithSymbol(e))return t.logWarning("Part is a symbol: ".concat(e)),e;if(t.logWarning("Part is a word: ".concat(e)),n.TitleCaserUtils.isWordInArray(e,r.correctTitleCasingList)){var i=n.TitleCaserUtils.correctTerm(e,r.correctTitleCasingList);return t.logWarning("Word is in correctTitleCasingList, corrected term: ".concat(i)),i}if(C.includes(e)){var o=v[e];return t.logWarning("Word is in replaceTermsArray, replacement: ".concat(o)),o}var a=e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();return t.logWarning("Applying title casing to word: ".concat(a)),a}));return d.join("");case n.TitleCaserUtils.startsWithSymbol(e):return n.TitleCaserUtils.isWordInArray(e,r.correctTitleCasingList)?n.TitleCaserUtils.correctTerm(e):e;case n.TitleCaserUtils.hasRomanNumeral(e):return e.toUpperCase();case n.TitleCaserUtils.hasNumbers(e):return e;default:return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}}));b=(b=w.join(" ")).replace(/nl2br/gi,"<br>"),m&&(b=n.TitleCaserUtils.convertQuotesToCurly(b));for(var A=b.split(" "),T=A[0],L=A[1]||null,O=(A[A.length-1],0);O<A.length;O++){O>0&&A[O-1];var P=A[O],I=O<A.length-1?A[O+1]:null,F=P.match(/[.,!?;:]+$/),k="";F&&(k=F[0],P=P.replace(/[.,!?;:]+$/,"")),n.TitleCaserUtils.isRegionalAcronym(P)&&(P=n.TitleCaserUtils.normalizeRegionalAcronym(P)),n.TitleCaserUtils.isRegionalAcronymNoDot(P,I)&&(P=n.TitleCaserUtils.normalizeRegionalAcronym(P)),""!==k&&(P+=k)}for(var E=(b=A.join(" ")).split(" "),R=1;R<E.length-1;R++){var M=E[R];E[R-1],E[R+1],M===M.toUpperCase()||n.TitleCaserUtils.hasUppercaseIntentional(M)||n.TitleCaserUtils.isWordInArray(M,r.commonShortWords)&&(E[R]=M.length<=3?M.toLowerCase():M)}for(var U=(b=E.join(" ")).split(" "),B=0;B<U.length;B++){var N=U[B],D=U[B+1],j=U[B-1];null!==D&&n.TitleCaserUtils.isRegionalAcronymNoDot(N,D,j)&&(U[B]=N.toUpperCase())}var W=U[U.length-1],x=U[U.length-2],G=U[U.length-3];n.TitleCaserUtils.isRegionalAcronym(T)&&(console.log("firstWord is a regional acronym, proof: ",T),U[0]=T.toUpperCase()),n.TitleCaserUtils.isRegionalAcronymNoDot(T,L)&&(U[0]=T.toUpperCase()),n.TitleCaserUtils.isFinalWordRegionalAcronym(W,x,G)&&(U[U.length-1]=W.toUpperCase()),b=U.join(" ");for(var z=0,H=Object.entries(this.correctPhraseCasingList);z<H.length;z++){var V=o(H[z],2),K=V[0],Q=V[1],J=new RegExp(K.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");b=b.replace(J,Q)}return b}catch(e){throw new Error(e)}}},{key:"setReplaceTerms",value:function(e){var t=this;if(!Array.isArray(e))throw new TypeError("Invalid argument: setReplaceTerms must be an array of objects.");e.forEach((function(e){if(e&&"object"===u(e)){var r=o(Object.entries(e)[0],2),n=r[0],a=r[1],s=t.wordReplacementsList.findIndex((function(e){return e.hasOwnProperty(n)}));-1!==s?t.wordReplacementsList[s][n]=a:t.wordReplacementsList.push(i({},n,a))}else console.warn("Invalid entry in terms array:",e)})),this.options.wordReplacementsList=this.wordReplacementsList,this.logWarning("Log the updated this.wordReplacementsList: ".concat(this.wordReplacementsList))}},{key:"addReplaceTerm",value:function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Invalid argument: term and replacement must be strings.");var r=this.wordReplacementsList.findIndex((function(t){return Object.keys(t)[0]===e}));-1!==r?this.wordReplacementsList[r][e]=t:this.wordReplacementsList.push(i({},e,t)),this.options.wordReplacementsList=this.wordReplacementsList}},{key:"removeReplaceTerm",value:function(e){if("string"!=typeof e)throw new TypeError("Invalid argument: term must be a string.");var t=this.wordReplacementsList.findIndex((function(t){return Object.keys(t)[0]===e}));if(-1===t)throw new Error("Term '".concat(e,"' not found in word replacements list."));this.wordReplacementsList.splice(t,1),this.options.wordReplacementsList=this.wordReplacementsList,this.logWarning("Log the updated this.wordReplacementsList: ".concat(this.wordReplacementsList))}},{key:"addExactPhraseReplacements",value:function(e){var t=this;if(!Array.isArray(e))throw new TypeError("Invalid argument: newPhrases must be an array.");e.forEach((function(e){if("object"!==u(e)||Array.isArray(e)||1!==Object.keys(e).length){if("object"!==u(e)||Array.isArray(e))throw new TypeError("Invalid argument: Each item must be an object with a single key-value pair.");Object.entries(e).forEach((function(e){var r=o(e,2),n=r[0],i=r[1];if("string"!=typeof n||"string"!=typeof i)throw new TypeError("Invalid argument: Each key-value pair must contain strings.");t.correctPhraseCasingList[n]=i}))}else{var r=Object.keys(e)[0],n=e[r];if("string"!=typeof r||"string"!=typeof n)throw new TypeError("Invalid argument: Each key-value pair must contain strings.");t.correctPhraseCasingList[r]=n}})),this.logWarning("Log the this.correctPhraseCasingList: ".concat(this.correctPhraseCasingList))}},{key:"setStyle",value:function(e){if("string"!=typeof e)throw new TypeError("Invalid argument: style must be a string.");this.options.style=e}}])&&c(e.prototype,t),s&&c(e,s),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,s}()}.apply(t,n))||(e.exports=i)},416:(e,t,r)=>{var n,i;n=[t,r(223),r(814),r(661),r(157),r(321),r(742),r(501),r(491),r(16)],void 0===(i=function(e,r,n,i,o,a,s,l,u,c){"use strict";function p(e){return e&&e.__esModule?e:{default:e}}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),t.wordReplacementsList=t.titleCaseStylesList=t.titleCaseDefaultOptionsList=t.regionalAcronymPrecedingWords=t.regionalAcronymList=t.ignoredWordList=t.directFollowingIndicatorsRegionalAcronym=t.correctTitleCasingList=t.correctPhraseCasingList=t.commonShortWords=t.allowedTitleCaseStylesList=void 0,r=p(r),n=p(n),i=p(i),o=p(o),a=p(a),s=p(s),l=p(l),u=p(u),c=p(c);var m=function(){for(var e=[],t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){Array.isArray(t)?t.forEach((function(t){Object.values(t).forEach((function(t){e.push.apply(e,f(t))}))})):"object"===d(t)&&Object.values(t).forEach((function(t){e.push.apply(e,f(t))}))})),f(new Set(e))}(r.default,n.default,i.default,o.default,a.default,s.default,l.default,u.default,c.default),g=(t.correctTitleCasingList=m,t.commonShortWords=["the","in","to","within","towards","into","at","of","for","by","on","from","with","through","about","across","over","under","between"],t.wordReplacementsList=[{"a.k.a":"AKA"},{"a.s.a.p":"ASAP"},{"f.a.q":"FAQ"},{"f.a.q.s":"FAQs"},{FAQS:"FAQs"},{"f.y.i":"FYI"},{"d.i.y":"DIY"},{"t.b.d":"TBD"},{"back-end":"Backend"},{"front-end":"Frontend"},{"full-stack":"Fullstack"},{nodejs:"Node.js"},{nextjs:"Next.js"},{nuxtjs:"Nuxt.js"},{reactjs:"React"},{"react.js":"React"},{"cyber-security":"Cybersecurity"}],t.titleCaseStylesList=Object.freeze({AP:"ap",APA:"apa",BRITISH:"british",CHICAGO:"chicago",NYT:"nyt",WIKIPEDIA:"wikipedia"}));t.allowedTitleCaseStylesList=Object.values(g),t.titleCaseDefaultOptionsList=Object.freeze({ap:{shortConjunctionsList:["and","but","or","for","nor","yet","so"],articlesList:["a","an","the"],shortPrepositionsList:["as","at","by","in","into","of","off","on","onto","out","over","to","up","via","with","from","under","upon","among"],neverCapitalizedList:[]},apa:{shortConjunctionsList:["and","but","by","for","in","nor","of","on","or","so","to","yet"],articlesList:["a","an","the"],shortPrepositionsList:["about","above","across","after","against","along","among","around","as","at","before","behind","below","beneath","beside","between","beyond","by","despite","down","during","except","for","from","in","inside","into","like","near","of","off","on","onto","out","outside","over","past","since","through","throughout","till","to","toward","under","underneath","until","up","upon","via","with","within","without"],neverCapitalizedList:[]},british:{shortConjunctionsList:["and","but","or","for","nor","yet","so"],articlesList:["a","an","the"],shortPrepositionsList:["as","at","by","in","into","of","off","on","onto","out","over","to","up","via","with","from","under","upon"],neverCapitalizedList:[]},chicago:{shortConjunctionsList:["and","but","or","for","nor","yet","so"],articlesList:["a","an","the"],shortPrepositionsList:["as","at","by","in","into","of","off","on","onto","out","over","to","up","via","with","from","under","upon"],neverCapitalizedList:["etc."]},nyt:{shortConjunctionsList:["and","but","or","for","nor","yet","so"],articlesList:["a","an","the"],shortPrepositionsList:["as","at","by","in","into","of","off","on","onto","out","over","to","up","via","with","from","under","upon"],neverCapitalizedList:[]},wikipedia:{shortConjunctionsList:["and","as","but","for","nor","or","so","yet"],articlesList:["a","an","the"],shortPrepositionsList:["as","at","by","in","into","of","off","on","onto","out","over","to","up","via","with","from","under","upon"],neverCapitalizedList:[]}}),t.ignoredWordList=[],t.correctPhraseCasingList={"the cybersmile foundation":"The Cybersmile Foundation","co. by colgate":"CO. by Colgate","on & off":"On & Off","on and off":"On and Off"},t.regionalAcronymList=["usa","us","u.s.a","u.s.","u.s","u.s.a.","eu","e.u.","e.u","uk","u.k.","u.k"],t.regionalAcronymPrecedingWords=["the","via","among","across","beyond","outside","alongside","throughout","despite","unlike","upon"],t.directFollowingIndicatorsRegionalAcronym=["act","acts","administration","administrations","agency","agencies","agreement","agreements","airforce","airforces","aid","alliance","alliances","ambassador","ambassadors","authority","authorities","bill","bills","bloc","blocs","budget","budgets","bureau","bureaus","cabinet","cabinets","charter","charters","command","commands","commission","commissions","conference","conferences","congress","congresses","convention","conventions","council","councils","court","courts","defense","defences","defence","defenses","delegation","delegations","democracy","democracies","department","departments","development","developments","directive","directives","diplomacy","division","divisions","economy","economies","embassy","embassies","engagement","engagements","envoy","envoys","exports","federation","federations","finance","finances","forces","framework","frameworks","funding","government","governments","hearing","hearings","imports","initiative","initiatives","intel","intelligence","intervention","interventions","jurisdiction","jurisdictions","law","laws","leadership","leaders","legislation","liaison","liaisons","mandate","mandates","markets","marines","military","militaries","ministry","ministries","mission","missions","navy","navies","negotiations","office","offices","operations","oversight","parliament","parliaments","plan","plans","policies","policy","policy-makers","precedent","precedents","presence","program","programme","programmes","programs","project","projects","protocol","protocols","province","provinces","reform","reforms","regulation","regulations","regulator","regulators","relations","representation","representations","republic","republics","resolution","resolutions","ruling","rulings","sanctions","security","securities","senate","senates","service","services","state","states","statute","statutes","strategy","strategies","summit","summits","summitry","surveillance","talks","tariffs","territory","territories","trade","trades","treasury","treasuries","treaty","treaties","tribunal","tribunals","troops","union","unions","veterans","warships","zone","zones"]}.apply(t,n))||(e.exports=i)},491:e=>{"use strict";e.exports=JSON.parse('{"timeRelated":["a.m.","p.m.","ca.","cc.","fig.","pl.","pt.","rev.","sr.","v.","vol.","et al.","pp.","p."],"academic":["adj.","adv.","cf.","cm.","co.","corp.","dept.","dist.","ed.","edn.","esp.","etc.","ex.","i.e.","e.g.","op. cit.","vs."]}')},501:e=>{"use strict";e.exports=JSON.parse('{"terms":["API","APIs","ASCII","CI","CLI","DLL","DNS","EC2","FTP","HTTP","HTTPS","ICMP","IDE","IP","ISP","LPWAN","M2M","MQTT","OOP","REST","SSH","SSL","TCP","UDP","URL","WLAN","WYSIWYG","IMAP","RSS","IaaS","PaaS","SaaS","CaaS","FaaS","XaaS","RaaS","IoE","IoT","LoRa","NB-IoT","RFID","RF","RFI","RFQ","ECMAScript","IO","I/O","DevOps","SecOps","DDoS","VoIP","AI","AR","ML","VR","CI/CD","DevSecOps","UI/UX","UX/UI","UI","UX","MVC","ORM","3G","4G","5G","NumPy","VPN","PKI","WAN","NAT","GPU","SSD","HDD","RAM","Frontend","Backend","Fullstack"],"legal":["DMCA","GDPR","HIPAA","NDA","SOW","TOS"],"languages":["JavaScript","TypeScript","Java","PHP","SQL","CSS",".NET","ES5","ES6","NoSQL","DynamoDB","Terraform","CloudFormation","RDS","Python","Ruby","Go","Swift","Kotlin","Perl"],"formats":["JSON","XML","YAML","GraphQL","WebSocket","RESTful"],"secops":["RaaS","DevSecOps","SecOps","Cybersecurity","DDoS"],"technologies":["AWS","Azure","GCP","VMware","Docker","Ansible","Chef","Puppet","Git","Subversion","Jenkins","CircleCI","Hadoop","Spark","BigQuery","PowerBI","Tableau"],"os":["Android","macOS","Windows","Linux","iOS","Ubuntu","CentOS","Fedora","Debian","SUSE","HarmonyOS","FreeRTOS","BeOS","BSD","Cordova","Flutter"],"programming":["Angular","Bootstrap","CodeIgniter","jQuery","Laravel","Redux","Vue.js","VueX","SCSS","AJAX","GraphQL","HTML","HTML5","MySQL","MongoDB","PostgresQL","SQLite","ASP","ASPX","Elasticsearch","Nginx","OpenSSL","Webpack","Unity3D","Kubernetes","TensorFlow","NPM","cURL"]}')},661:e=>{"use strict";e.exports=JSON.parse('{"eterms":["eBook","eBooks","eMarket","eMarketplace","eMarketplaces","eMarkets","eReader","eShop","eShops","eStore","eStores","E-commerce","E-com"]}')},742:e=>{"use strict";e.exports=JSON.parse('{"miscellaneous":["w/","w/o","Open Source","Cybersecurity","Ecosystem","Biodiversity","LGBT","LGBTQ+","LGBTQIA+","2SLGBTQ+","BIPOC"]}')},814:e=>{"use strict";e.exports=JSON.parse('{"commercial":["Ltd.","LLC","PLC","Co.","Inc.","St.","Ave.","Bldg.","No.","GmbH"],"titles":["CEO","CEOs","CFO","CFOs","CIO","CIOs","CMO","CMOs","COO","COOs","CPO","CPOs","CRO","CROs","CSO","CSOs","CTO","CTOs","EVP","EVPs","HR","HRs","SVP","SVPs","VP","VPs","CMTO","CDO"],"accounting":["AP","COGS","EBIT","EPS","FIFO","GAAP","LIFO","P&L","ROI","SOX","TCO","VAT","EBITDA","NPV","WACC","AR"],"finance":["CAGR","DCF","ETF","IPO","IRR","M&A","NAV","PE","PEG","PPE","ROE","S&P","TVM","VC","FOMC","FX","ETF"],"legal":["AFA","ADR","CCPA","CFAA","CISG","DMCA","EULA","GDPR","HIPAA","NDA","SOW","TOS","LLM","JD","Esq.","AG","SARL","KYC","AML","ph.d.","m.d.","d.d.s.","d.m.d.","d.o.","d.c.","d.v.m.","d.n.p.","d.p.m.","d.s.w.","d.s.n.","d.n.sc.","d.n.a.","d.n.t.","d.n.p.t.","d.n.o.","d.n.m.","d.n.e.","d.n.s.","d.n.p.s."]}')},987:(e,t,r)=>{var n,i;e=r.nmd(e),n=[r(388)],void 0===(i=function(t){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}void 0===String.prototype.toTitleCase&&(String.prototype.toTitleCase=function(e){return new t.TitleCaser(e).toTitleCase(this)}),"object"===r(e)&&e.exports&&(e.exports={TitleCaser:t.TitleCaser}),"undefined"!=typeof window&&window.document&&(window.TitleCaser=t.TitleCaser)}.apply(t,n))||(e.exports=i)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n](o,o.exports,r),o.loaded=!0,o.exports}r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);r(987)})();
|