@stryke/string-format 0.11.0 → 0.12.1
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/dist/acronyms.cjs +25 -0
- package/dist/acronyms.mjs +1 -1
- package/dist/articles.cjs +7 -0
- package/dist/articles.d.ts +1 -0
- package/dist/articles.mjs +1 -0
- package/dist/combine.cjs +9 -0
- package/dist/combine.d.ts +8 -0
- package/dist/combine.mjs +1 -0
- package/dist/conjunctions.cjs +7 -0
- package/dist/conjunctions.d.ts +1 -0
- package/dist/conjunctions.mjs +1 -0
- package/dist/decamelize.cjs +9 -0
- package/dist/decamelize.d.ts +7 -0
- package/dist/decamelize.mjs +1 -0
- package/dist/format-special-cases.cjs +17 -0
- package/dist/format-special-cases.d.ts +19 -0
- package/dist/format-special-cases.mjs +1 -0
- package/dist/index.cjs +77 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.mjs +1 -1
- package/dist/prepositions.cjs +7 -0
- package/dist/prepositions.d.ts +1 -0
- package/dist/prepositions.mjs +1 -0
- package/dist/special-cases.cjs +7 -0
- package/dist/special-cases.d.ts +1 -0
- package/dist/special-cases.mjs +1 -0
- package/dist/title-case.cjs +5 -23
- package/dist/title-case.d.ts +5 -55
- package/dist/title-case.mjs +1 -1
- package/package.json +101 -3
package/dist/acronyms.cjs
CHANGED
|
@@ -101,6 +101,9 @@ const ACRONYMS = exports.ACRONYMS = {
|
|
|
101
101
|
CAPTCHA: {
|
|
102
102
|
description: "Completely Automated Public Turing test to tell Computers and Humans Apart"
|
|
103
103
|
},
|
|
104
|
+
CCTV: {
|
|
105
|
+
description: "Closed-Circuit Television"
|
|
106
|
+
},
|
|
104
107
|
CD: {
|
|
105
108
|
description: "Continuous Delivery / Compact Disc"
|
|
106
109
|
},
|
|
@@ -277,6 +280,10 @@ const ACRONYMS = exports.ACRONYMS = {
|
|
|
277
280
|
display: "FaaS"
|
|
278
281
|
},
|
|
279
282
|
FAQ: {
|
|
283
|
+
description: "Frequently Asked Questions",
|
|
284
|
+
display: "FAQs"
|
|
285
|
+
},
|
|
286
|
+
FAQS: {
|
|
280
287
|
description: "Frequently Asked Questions"
|
|
281
288
|
},
|
|
282
289
|
FBI: {
|
|
@@ -458,6 +465,9 @@ const ACRONYMS = exports.ACRONYMS = {
|
|
|
458
465
|
IPS: {
|
|
459
466
|
description: "Intrusion Prevention System"
|
|
460
467
|
},
|
|
468
|
+
ISO: {
|
|
469
|
+
description: "International Organization for Standardization"
|
|
470
|
+
},
|
|
461
471
|
IQ: {
|
|
462
472
|
description: "Intelligence Quotient",
|
|
463
473
|
display: "IQ"
|
|
@@ -784,6 +794,9 @@ const ACRONYMS = exports.ACRONYMS = {
|
|
|
784
794
|
"TLS1.3": {
|
|
785
795
|
description: "Transport Layer Security 1.3"
|
|
786
796
|
},
|
|
797
|
+
TOR: {
|
|
798
|
+
description: "The Onion Router"
|
|
799
|
+
},
|
|
787
800
|
TOTP: {
|
|
788
801
|
description: "Time-based One-Time Password"
|
|
789
802
|
},
|
|
@@ -862,6 +875,18 @@ const ACRONYMS = exports.ACRONYMS = {
|
|
|
862
875
|
WPA: {
|
|
863
876
|
description: "Wi-Fi Protected Access"
|
|
864
877
|
},
|
|
878
|
+
WPA2: {
|
|
879
|
+
description: "Wi-Fi Protected Access II"
|
|
880
|
+
},
|
|
881
|
+
WPA3: {
|
|
882
|
+
description: "Wi-Fi Protected Access III"
|
|
883
|
+
},
|
|
884
|
+
WWW: {
|
|
885
|
+
description: "World Wide Web"
|
|
886
|
+
},
|
|
887
|
+
WYSIWYG: {
|
|
888
|
+
description: "What You See Is What You Get"
|
|
889
|
+
},
|
|
865
890
|
XACML: {
|
|
866
891
|
description: "eXtensible Access Control Markup Language"
|
|
867
892
|
},
|
package/dist/acronyms.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ACRONYMS={"2D":{description:"Two-Dimensional",display:"2d"},"3D":{description:"Three-Dimensional",display:"3d"},"4D":{description:"Four-Dimensional",display:"4d"},"5G":{description:"Fifth Generation (mobile networks)"},"6G":{description:"Sixth Generation (mobile networks)"},"7G":{description:"Seventh Generation (mobile networks)"},"8G":{description:"Eighth Generation (mobile networks)"},ACID:{description:"Atomicity, Consistency, Isolation, Durability"},AITA:{description:"Am I The Asshole"},AES:{description:"Advanced Encryption Standard"},AI:{description:"Artificial Intelligence"},AJAX:{description:"Asynchronous JavaScript and XML"},API:{description:"Application Programming Interface"},AR:{description:"Augmented Reality"},ASCII:{description:"American Standard Code for Information Interchange"},ATF:{description:"Bureau of Alcohol, Tobacco, Firearms and Explosives"},ATM:{description:"Automated Teller Machine"},B2B:{description:"Business to Business"},B2C:{description:"Business to Consumer"},BATFE:{description:"Bureau of Alcohol, Tobacco, Firearms and Explosives"},BFF:{description:"Best Friends Forever"},BFFS:{description:"Best Friends Forever (plural)"},BI:{description:"Business Intelligence"},BIOS:{description:"Basic Input/Output System"},BGP:{description:"Border Gateway Protocol"},BOM:{description:"Bill of Materials / Byte Order Mark"},BSON:{description:"Binary JSON"},BYOD:{description:"Bring Your Own Device"},C2C:{description:"Consumer to Consumer"},CAGR:{description:"Compound Annual Growth Rate"},CAPTCHA:{description:"Completely Automated Public Turing test to tell Computers and Humans Apart"},CD:{description:"Continuous Delivery / Compact Disc"},CDN:{description:"Content Delivery Network"},CDP:{description:"Customer Data Platform"},CDT:{description:"Central Daylight Time"},CIA:{description:"Central Intelligence Agency"},CI:{description:"Continuous Integration"},"CI/CD":{description:"Continuous Integration/Continuous Delivery"},CIAM:{description:"Customer Identity and Access Management"},CICD:{description:"Continuous Integration Continuous Delivery",display:"CI/CD"},CLI:{description:"Command Line Interface"},CMDB:{description:"Configuration Management Database"},CORS:{description:"Cross-Origin Resource Sharing"},CPA:{description:"Certified Public Accountant"},CPU:{description:"Central Processing Unit"},CRUD:{description:"Create, Read, Update, Delete"},CSR:{description:"Certificate Signing Request / Corporate Social Responsibility"},CSS:{description:"Cascading Style Sheets"},CST:{description:"Central Standard Time"},CTA:{description:"Call To Action"},CWD:{description:"Current Working Directory"},CX:{description:"Customer Experience"},DAG:{description:"Directed Acyclic Graph"},DBMS:{description:"Database Management System"},DDOS:{description:"Distributed Denial of Service",display:"DDoS"},DEA:{description:"Drug Enforcement Administration"},DEVENV:{description:"Devenv",display:"Devenv"},DEVOPS:{description:"Development Operations",display:"DevOps"},DHS:{description:"Department of Homeland Security"},DIRENV:{description:"DirEnv",display:"DirEnv"},DNC:{description:"Democratic National Committee / Do Not Call"},DNS:{description:"Domain Name System"},DNSSEC:{description:"Domain Name System Security Extensions"},DOD:{description:"Department of Defense",display:"DoD"},DOJ:{description:"Department of Justice",display:"DoJ"},DOM:{description:"Document Object Model"},DOT:{description:"Department of Transportation",display:"DoT"},DOTENV:{description:"Dotenv (.env)",display:"Dotenv"},DR:{description:"Disaster Recovery"},DRM:{description:"Digital Rights Management"},DSN:{description:"Data Source Name"},DWH:{description:"Data Warehouse"},E2E:{description:"End to End"},EAI:{description:"Enterprise Application Integration"},EDT:{description:"Eastern Daylight Time"},EEA:{description:"European Economic Area"},EKS:{description:"Elastic Kubernetes Service"},EOF:{description:"End Of File"},EOD:{description:"End Of Day / Explosive Ordnance Disposal"},EPA:{description:"Environmental Protection Agency"},ER:{description:"Emergency Room / Entity Relationship"},EST:{description:"Eastern Standard Time"},ETC:{description:"Et Cetera"},ETL:{description:"Extract, Transform, Load"},EULA:{description:"End User License Agreement"},FAAS:{description:"Function as a Service",display:"FaaS"},FAQ:{description:"Frequently Asked Questions"},FBI:{description:"Federal Bureau of Investigation"},FCC:{description:"Federal Communications Commission"},FDA:{description:"Food and Drug Administration"},FIDO:{description:"Fast IDentity Online"},FLOTUS:{description:"First Lady of the United States"},FQDN:{description:"Fully Qualified Domain Name"},FTC:{description:"Federal Trade Commission"},FTP:{description:"File Transfer Protocol"},GC:{description:"Garbage Collection"},GCP:{description:"Google Cloud Platform"},GDPR:{description:"General Data Protection Regulation"},GMT:{description:"Greenwich Mean Time"},GOP:{description:"Grand Old Party"},GPU:{description:"Graphics Processing Unit"},GUID:{description:"Globally Unique Identifier"},GUI:{description:"Graphical User Interface"},GZIP:{description:"GNU Zip"},HCI:{description:"Human Computer Interaction / Hyper-Converged Infrastructure"},HDD:{description:"Hard Disk Drive"},HDFS:{description:"Hadoop Distributed File System"},HHS:{description:"Health and Human Services"},HIPAA:{description:"Health Insurance Portability and Accountability Act"},HMAC:{description:"Hash-based Message Authentication Code"},HOTP:{description:"HMAC-based One-Time Password"},HSM:{description:"Hardware Security Module"},HTML:{description:"HyperText Markup Language"},HTTP:{description:"HyperText Transfer Protocol (HTTP)"},"HTTP/2":{description:"HyperText Transfer Protocol Version 2 (HTTP/2)"},"HTTP/2.0":{description:"HyperText Transfer Protocol Version 2 (HTTP/2)",display:"HTTP2"},"HTTP/3":{description:"HyperText Transfer Protocol Version 3 (HTTP/3)"},"HTTP/3.0":{description:"HyperText Transfer Protocol Version 3 (HTTP/3)",display:"HTTP3"},HTTP2:{description:"HyperText Transfer Protocol Version 2 (HTTP/2)",display:"HTTP2"},"HTTP2.0":{description:"HyperText Transfer Protocol Version 2 (HTTP/2)",display:"HTTP2"},HTTP3:{description:"HyperText Transfer Protocol Version 3 (HTTP/3)",display:"HTTP3"},"HTTP3.0":{description:"HyperText Transfer Protocol Version 3 (HTTP/3)",display:"HTTP3"},HTTPS:{description:"HyperText Transfer Protocol Secure (HTTPS)"},"HTTPS/2":{description:"HyperText Transfer Protocol Secure Version 2 (HTTPS/2)"},"HTTPS/2.0":{description:"HyperText Transfer Protocol Secure Version 2 (HTTPS/2)",display:"HTTPS2"},"HTTPS/3":{description:"HyperText Transfer Protocol Secure Version 3 (HTTPS/3)"},"HTTPS/3.0":{description:"HyperText Transfer Protocol Secure Version 3 (HTTPS/3)",display:"HTTPS3"},HTTPS2:{description:"HyperText Transfer Protocol Secure Version 2 (HTTPS/2)",display:"HTTPS2"},"HTTPS2.0":{description:"HyperText Transfer Protocol Secure Version 2 (HTTPS/2)",display:"HTTPS2"},HTTPS3:{description:"HyperText Transfer Protocol Secure Version 3 (HTTPS/3)",display:"HTTPS3"},"HTTPS3.0":{description:"HyperText Transfer Protocol Secure Version 3 (HTTPS/3)",display:"HTTPS3"},IAAS:{description:"Infrastructure as a Service",display:"IaaS"},IAM:{description:"Identity and Access Management"},IAMM:{description:"Identity and Access Management and Monitoring"},IAMT:{description:"Identity and Access Management Tool"},ID:{description:"Identifier",display:"Id"},IFTTT:{description:"If This Then That"},IMAP:{description:"Internet Message Access Protocol"},IO:{description:"Input/Output"},IP:{description:"Internet Protocol"},IPFS:{description:"InterPlanetary File System"},IPS:{description:"Intrusion Prevention System"},IQ:{description:"Intelligence Quotient",display:"IQ"},IOT:{description:"Internet of Things",display:"IoT"},JSON:{description:"JavaScript Object Notation"},JSONP:{description:"JSON with Padding"},JWT:{description:"JSON Web Token"},K8S:{description:"Kubernetes",display:"K8s"},KMS:{description:"Key Management Service"},KPI:{description:"Key Performance Indicator"},KV:{description:"Key Value"},LAN:{description:"Local Area Network"},LHS:{description:"Left Hand Side"},LPGA:{description:"Ladies Professional Golf Association"},LXC:{description:"Linux Containers"},MDT:{description:"Mountain Daylight Time"},MFA:{description:"Multi-Factor Authentication"},ML:{description:"Machine Learning"},MLB:{description:"Major League Baseball"},MLOps:{description:"Machine Learning Operations"},MPA:{description:"Multi-Page Application"},MST:{description:"Mountain Standard Time"},MVC:{description:"Model View Controller"},MVP:{description:"Minimum Viable Product / Most Valuable Player"},NAIA:{description:"National Association of Intercollegiate Athletics"},NAS:{description:"Network Attached Storage"},NASA:{description:"National Aeronautics and Space Administration"},NASCAR:{description:"National Association for Stock Car Auto Racing"},NAT:{description:"Network Address Translation"},NBA:{description:"National Basketball Association"},NCAA:{description:"National Collegiate Athletic Association"},NDA:{description:"Non-Disclosure Agreement"},NFS:{description:"Network File System"},NHL:{description:"National Hockey League"},NIST:{description:"National Institute of Standards and Technology"},NLP:{description:"Natural Language Processing"},NPS:{description:"Net Promoter Score"},NRA:{description:"National Rifle Association"},NSFW:{description:"Not Safe For Work"},NX:{description:"Nx",display:"Nx"},OCR:{description:"Optical Character Recognition"},OEM:{description:"Original Equipment Manufacturer"},OKR:{description:"Objectives and Key Results"},OLAP:{description:"Online Analytical Processing"},OLTP:{description:"Online Transaction Processing"},OOP:{description:"Object Oriented Programming"},ORM:{description:"Object Relational Mapping"},OS:{description:"Operating System"},OSINT:{description:"Open Source Intelligence"},OSS:{description:"Open Source Software"},OTP:{description:"One-Time Password"},P2P:{description:"Peer to Peer"},PAAS:{description:"Platform as a Service",display:"PaaS"},PCI:{description:"Payment Card Industry"},PDP:{description:"Policy Decision Point / Product Detail Page"},PDT:{description:"Pacific Daylight Time"},PGA:{description:"Professional Golfers' Association"},POTUS:{description:"President of the United States"},PP:{description:"Pages / PayPal / Percentage Points"},PST:{description:"Pacific Standard Time"},PTO:{description:"Paid Time Off / Power Take-Off"},PKI:{description:"Public Key Infrastructure"},PWA:{description:"Progressive Web App"},PX:{description:"Pixel"},QA:{description:"Quality Assurance"},R2:{description:"R2"},RAID:{description:"Redundant Array of Independent Disks"},RAM:{description:"Random Access Memory"},RDS:{description:"Relational Database Service"},REST:{description:"Representational State Transfer"},RHS:{description:"Right Hand Side"},ROI:{description:"Return on Investment"},RPC:{description:"Remote Procedure Call"},RPA:{description:"Robotic Process Automation"},RSC:{description:"React Server Components"},RSS:{description:"Really Simple Syndication"},RUM:{description:"Real User Monitoring"},S3:{description:"Simple Storage Service (S3)"},SAN:{description:"Storage Area Network"},SASE:{description:"Secure Access Service Edge"},SCOTUS:{description:"Supreme Court of the United States"},SDLC:{description:"Software Development Life Cycle"},SDK:{description:"Software Development Kit"},SEC:{description:"Securities and Exchange Commission"},SEO:{description:"Search Engine Optimization"},SFTP:{description:"SSH File Transfer Protocol / Secure File Transfer Protocol"},SIEM:{description:"Security Information and Event Management"},SLA:{description:"Service Level Agreement"},SMB:{description:"Server Message Block / Small and Medium Business"},SMTP:{description:"Simple Mail Transfer Protocol"},SOAP:{description:"Simple Object Access Protocol"},SOA:{description:"Service Oriented Architecture"},SOC:{description:"Security Operations Center / System on Chip"},SPA:{description:"Single Page Application"},SPDY:{description:'Speedy (pronounced "SPeeDY")'},SPF:{description:"Sender Policy Framework"},SQL:{description:"Structured Query Language"},SRV:{description:"Service"},SRE:{description:"Site Reliability Engineering"},SSH:{description:"Secure Shell"},SSDL:{description:"Secure Software Development Lifecycle"},SSG:{description:"Static Site Generation"},SSR:{description:"Server Side Rendering"},SSO:{description:"Single Sign-On"},SSL:{description:"Secure Sockets Layer"},TDD:{description:"Test Driven Development"},TLD:{description:"Top Level Domain"},TLS:{description:"Transport Layer Security"},"TLS1.3":{description:"Transport Layer Security 1.3"},TOTP:{description:"Time-based One-Time Password"},TRPC:{description:"TypeScript Remote Procedure Call"},TSA:{description:"Transportation Security Administration"},TTL:{description:"Time To Live"},UDP:{description:"User Datagram Protocol"},UI:{description:"User Interface"},UID:{description:"Unique Identifier"},URI:{description:"Uniform Resource Identifier"},URL:{description:"Uniform Resource Locator"},USOPC:{description:"United States Olympic & Paralympic Committee"},USPS:{description:"United States Postal Service"},USTA:{description:"United States Tennis Association"},UTF:{description:"Unicode Transformation Format"},UTC:{description:"Coordinated Universal Time"},UUID:{description:"Universally Unique Identifier"},UX:{description:"User Experience"},VM:{description:"Virtual Machine"},VLAN:{description:"Virtual Local Area Network"},VPN:{description:"Virtual Private Network"},VPPA:{description:"Video Privacy Protection Act"},VR:{description:"Virtual Reality"},WAF:{description:"Web Application Firewall"},WAN:{description:"Wide Area Network"},WNBA:{description:"Women's National Basketball Association"},WLAN:{description:"Wireless Local Area Network"},WPA:{description:"Wi-Fi Protected Access"},XACML:{description:"eXtensible Access Control Markup Language"},XDG:{description:"Cross-Desktop Group"},XML:{description:"eXtensible Markup Language"},XSRF:{description:"Cross-Site Request Forgery"},XSS:{description:"Cross-Site Scripting"},XR:{description:"Extended Reality"},YAML:{description:"YAML Ain't Markup Language"},YMCA:{description:"Young Men's Christian Association"},YWCA:{description:"Young Women's Christian Association"},ZTA:{description:"Zero Trust Architecture"}},ACRONYM_DISPLAY=Object.fromEntries(Object.entries(ACRONYMS).map(([e,i])=>[e,i.display??e])),ACRONYM_DESCRIPTION=Object.fromEntries(Object.entries(ACRONYMS).map(([e,i])=>[e,i.description])),ACRONYM_LIST=Object.keys(ACRONYMS);
|
|
1
|
+
export const ACRONYMS={"2D":{description:"Two-Dimensional",display:"2d"},"3D":{description:"Three-Dimensional",display:"3d"},"4D":{description:"Four-Dimensional",display:"4d"},"5G":{description:"Fifth Generation (mobile networks)"},"6G":{description:"Sixth Generation (mobile networks)"},"7G":{description:"Seventh Generation (mobile networks)"},"8G":{description:"Eighth Generation (mobile networks)"},ACID:{description:"Atomicity, Consistency, Isolation, Durability"},AITA:{description:"Am I The Asshole"},AES:{description:"Advanced Encryption Standard"},AI:{description:"Artificial Intelligence"},AJAX:{description:"Asynchronous JavaScript and XML"},API:{description:"Application Programming Interface"},AR:{description:"Augmented Reality"},ASCII:{description:"American Standard Code for Information Interchange"},ATF:{description:"Bureau of Alcohol, Tobacco, Firearms and Explosives"},ATM:{description:"Automated Teller Machine"},B2B:{description:"Business to Business"},B2C:{description:"Business to Consumer"},BATFE:{description:"Bureau of Alcohol, Tobacco, Firearms and Explosives"},BFF:{description:"Best Friends Forever"},BFFS:{description:"Best Friends Forever (plural)"},BI:{description:"Business Intelligence"},BIOS:{description:"Basic Input/Output System"},BGP:{description:"Border Gateway Protocol"},BOM:{description:"Bill of Materials / Byte Order Mark"},BSON:{description:"Binary JSON"},BYOD:{description:"Bring Your Own Device"},C2C:{description:"Consumer to Consumer"},CAGR:{description:"Compound Annual Growth Rate"},CAPTCHA:{description:"Completely Automated Public Turing test to tell Computers and Humans Apart"},CCTV:{description:"Closed-Circuit Television"},CD:{description:"Continuous Delivery / Compact Disc"},CDN:{description:"Content Delivery Network"},CDP:{description:"Customer Data Platform"},CDT:{description:"Central Daylight Time"},CIA:{description:"Central Intelligence Agency"},CI:{description:"Continuous Integration"},"CI/CD":{description:"Continuous Integration/Continuous Delivery"},CIAM:{description:"Customer Identity and Access Management"},CICD:{description:"Continuous Integration Continuous Delivery",display:"CI/CD"},CLI:{description:"Command Line Interface"},CMDB:{description:"Configuration Management Database"},CORS:{description:"Cross-Origin Resource Sharing"},CPA:{description:"Certified Public Accountant"},CPU:{description:"Central Processing Unit"},CRUD:{description:"Create, Read, Update, Delete"},CSR:{description:"Certificate Signing Request / Corporate Social Responsibility"},CSS:{description:"Cascading Style Sheets"},CST:{description:"Central Standard Time"},CTA:{description:"Call To Action"},CWD:{description:"Current Working Directory"},CX:{description:"Customer Experience"},DAG:{description:"Directed Acyclic Graph"},DBMS:{description:"Database Management System"},DDOS:{description:"Distributed Denial of Service",display:"DDoS"},DEA:{description:"Drug Enforcement Administration"},DEVENV:{description:"Devenv",display:"Devenv"},DEVOPS:{description:"Development Operations",display:"DevOps"},DHS:{description:"Department of Homeland Security"},DIRENV:{description:"DirEnv",display:"DirEnv"},DNC:{description:"Democratic National Committee / Do Not Call"},DNS:{description:"Domain Name System"},DNSSEC:{description:"Domain Name System Security Extensions"},DOD:{description:"Department of Defense",display:"DoD"},DOJ:{description:"Department of Justice",display:"DoJ"},DOM:{description:"Document Object Model"},DOT:{description:"Department of Transportation",display:"DoT"},DOTENV:{description:"Dotenv (.env)",display:"Dotenv"},DR:{description:"Disaster Recovery"},DRM:{description:"Digital Rights Management"},DSN:{description:"Data Source Name"},DWH:{description:"Data Warehouse"},E2E:{description:"End to End"},EAI:{description:"Enterprise Application Integration"},EDT:{description:"Eastern Daylight Time"},EEA:{description:"European Economic Area"},EKS:{description:"Elastic Kubernetes Service"},EOF:{description:"End Of File"},EOD:{description:"End Of Day / Explosive Ordnance Disposal"},EPA:{description:"Environmental Protection Agency"},ER:{description:"Emergency Room / Entity Relationship"},EST:{description:"Eastern Standard Time"},ETC:{description:"Et Cetera"},ETL:{description:"Extract, Transform, Load"},EULA:{description:"End User License Agreement"},FAAS:{description:"Function as a Service",display:"FaaS"},FAQ:{description:"Frequently Asked Questions",display:"FAQs"},FAQS:{description:"Frequently Asked Questions"},FBI:{description:"Federal Bureau of Investigation"},FCC:{description:"Federal Communications Commission"},FDA:{description:"Food and Drug Administration"},FIDO:{description:"Fast IDentity Online"},FLOTUS:{description:"First Lady of the United States"},FQDN:{description:"Fully Qualified Domain Name"},FTC:{description:"Federal Trade Commission"},FTP:{description:"File Transfer Protocol"},GC:{description:"Garbage Collection"},GCP:{description:"Google Cloud Platform"},GDPR:{description:"General Data Protection Regulation"},GMT:{description:"Greenwich Mean Time"},GOP:{description:"Grand Old Party"},GPU:{description:"Graphics Processing Unit"},GUID:{description:"Globally Unique Identifier"},GUI:{description:"Graphical User Interface"},GZIP:{description:"GNU Zip"},HCI:{description:"Human Computer Interaction / Hyper-Converged Infrastructure"},HDD:{description:"Hard Disk Drive"},HDFS:{description:"Hadoop Distributed File System"},HHS:{description:"Health and Human Services"},HIPAA:{description:"Health Insurance Portability and Accountability Act"},HMAC:{description:"Hash-based Message Authentication Code"},HOTP:{description:"HMAC-based One-Time Password"},HSM:{description:"Hardware Security Module"},HTML:{description:"HyperText Markup Language"},HTTP:{description:"HyperText Transfer Protocol (HTTP)"},"HTTP/2":{description:"HyperText Transfer Protocol Version 2 (HTTP/2)"},"HTTP/2.0":{description:"HyperText Transfer Protocol Version 2 (HTTP/2)",display:"HTTP2"},"HTTP/3":{description:"HyperText Transfer Protocol Version 3 (HTTP/3)"},"HTTP/3.0":{description:"HyperText Transfer Protocol Version 3 (HTTP/3)",display:"HTTP3"},HTTP2:{description:"HyperText Transfer Protocol Version 2 (HTTP/2)",display:"HTTP2"},"HTTP2.0":{description:"HyperText Transfer Protocol Version 2 (HTTP/2)",display:"HTTP2"},HTTP3:{description:"HyperText Transfer Protocol Version 3 (HTTP/3)",display:"HTTP3"},"HTTP3.0":{description:"HyperText Transfer Protocol Version 3 (HTTP/3)",display:"HTTP3"},HTTPS:{description:"HyperText Transfer Protocol Secure (HTTPS)"},"HTTPS/2":{description:"HyperText Transfer Protocol Secure Version 2 (HTTPS/2)"},"HTTPS/2.0":{description:"HyperText Transfer Protocol Secure Version 2 (HTTPS/2)",display:"HTTPS2"},"HTTPS/3":{description:"HyperText Transfer Protocol Secure Version 3 (HTTPS/3)"},"HTTPS/3.0":{description:"HyperText Transfer Protocol Secure Version 3 (HTTPS/3)",display:"HTTPS3"},HTTPS2:{description:"HyperText Transfer Protocol Secure Version 2 (HTTPS/2)",display:"HTTPS2"},"HTTPS2.0":{description:"HyperText Transfer Protocol Secure Version 2 (HTTPS/2)",display:"HTTPS2"},HTTPS3:{description:"HyperText Transfer Protocol Secure Version 3 (HTTPS/3)",display:"HTTPS3"},"HTTPS3.0":{description:"HyperText Transfer Protocol Secure Version 3 (HTTPS/3)",display:"HTTPS3"},IAAS:{description:"Infrastructure as a Service",display:"IaaS"},IAM:{description:"Identity and Access Management"},IAMM:{description:"Identity and Access Management and Monitoring"},IAMT:{description:"Identity and Access Management Tool"},ID:{description:"Identifier",display:"Id"},IFTTT:{description:"If This Then That"},IMAP:{description:"Internet Message Access Protocol"},IO:{description:"Input/Output"},IP:{description:"Internet Protocol"},IPFS:{description:"InterPlanetary File System"},IPS:{description:"Intrusion Prevention System"},ISO:{description:"International Organization for Standardization"},IQ:{description:"Intelligence Quotient",display:"IQ"},IOT:{description:"Internet of Things",display:"IoT"},JSON:{description:"JavaScript Object Notation"},JSONP:{description:"JSON with Padding"},JWT:{description:"JSON Web Token"},K8S:{description:"Kubernetes",display:"K8s"},KMS:{description:"Key Management Service"},KPI:{description:"Key Performance Indicator"},KV:{description:"Key Value"},LAN:{description:"Local Area Network"},LHS:{description:"Left Hand Side"},LPGA:{description:"Ladies Professional Golf Association"},LXC:{description:"Linux Containers"},MDT:{description:"Mountain Daylight Time"},MFA:{description:"Multi-Factor Authentication"},ML:{description:"Machine Learning"},MLB:{description:"Major League Baseball"},MLOps:{description:"Machine Learning Operations"},MPA:{description:"Multi-Page Application"},MST:{description:"Mountain Standard Time"},MVC:{description:"Model View Controller"},MVP:{description:"Minimum Viable Product / Most Valuable Player"},NAIA:{description:"National Association of Intercollegiate Athletics"},NAS:{description:"Network Attached Storage"},NASA:{description:"National Aeronautics and Space Administration"},NASCAR:{description:"National Association for Stock Car Auto Racing"},NAT:{description:"Network Address Translation"},NBA:{description:"National Basketball Association"},NCAA:{description:"National Collegiate Athletic Association"},NDA:{description:"Non-Disclosure Agreement"},NFS:{description:"Network File System"},NHL:{description:"National Hockey League"},NIST:{description:"National Institute of Standards and Technology"},NLP:{description:"Natural Language Processing"},NPS:{description:"Net Promoter Score"},NRA:{description:"National Rifle Association"},NSFW:{description:"Not Safe For Work"},NX:{description:"Nx",display:"Nx"},OCR:{description:"Optical Character Recognition"},OEM:{description:"Original Equipment Manufacturer"},OKR:{description:"Objectives and Key Results"},OLAP:{description:"Online Analytical Processing"},OLTP:{description:"Online Transaction Processing"},OOP:{description:"Object Oriented Programming"},ORM:{description:"Object Relational Mapping"},OS:{description:"Operating System"},OSINT:{description:"Open Source Intelligence"},OSS:{description:"Open Source Software"},OTP:{description:"One-Time Password"},P2P:{description:"Peer to Peer"},PAAS:{description:"Platform as a Service",display:"PaaS"},PCI:{description:"Payment Card Industry"},PDP:{description:"Policy Decision Point / Product Detail Page"},PDT:{description:"Pacific Daylight Time"},PGA:{description:"Professional Golfers' Association"},POTUS:{description:"President of the United States"},PP:{description:"Pages / PayPal / Percentage Points"},PST:{description:"Pacific Standard Time"},PTO:{description:"Paid Time Off / Power Take-Off"},PKI:{description:"Public Key Infrastructure"},PWA:{description:"Progressive Web App"},PX:{description:"Pixel"},QA:{description:"Quality Assurance"},R2:{description:"R2"},RAID:{description:"Redundant Array of Independent Disks"},RAM:{description:"Random Access Memory"},RDS:{description:"Relational Database Service"},REST:{description:"Representational State Transfer"},RHS:{description:"Right Hand Side"},ROI:{description:"Return on Investment"},RPC:{description:"Remote Procedure Call"},RPA:{description:"Robotic Process Automation"},RSC:{description:"React Server Components"},RSS:{description:"Really Simple Syndication"},RUM:{description:"Real User Monitoring"},S3:{description:"Simple Storage Service (S3)"},SAN:{description:"Storage Area Network"},SASE:{description:"Secure Access Service Edge"},SCOTUS:{description:"Supreme Court of the United States"},SDLC:{description:"Software Development Life Cycle"},SDK:{description:"Software Development Kit"},SEC:{description:"Securities and Exchange Commission"},SEO:{description:"Search Engine Optimization"},SFTP:{description:"SSH File Transfer Protocol / Secure File Transfer Protocol"},SIEM:{description:"Security Information and Event Management"},SLA:{description:"Service Level Agreement"},SMB:{description:"Server Message Block / Small and Medium Business"},SMTP:{description:"Simple Mail Transfer Protocol"},SOAP:{description:"Simple Object Access Protocol"},SOA:{description:"Service Oriented Architecture"},SOC:{description:"Security Operations Center / System on Chip"},SPA:{description:"Single Page Application"},SPDY:{description:'Speedy (pronounced "SPeeDY")'},SPF:{description:"Sender Policy Framework"},SQL:{description:"Structured Query Language"},SRV:{description:"Service"},SRE:{description:"Site Reliability Engineering"},SSH:{description:"Secure Shell"},SSDL:{description:"Secure Software Development Lifecycle"},SSG:{description:"Static Site Generation"},SSR:{description:"Server Side Rendering"},SSO:{description:"Single Sign-On"},SSL:{description:"Secure Sockets Layer"},TDD:{description:"Test Driven Development"},TLD:{description:"Top Level Domain"},TLS:{description:"Transport Layer Security"},"TLS1.3":{description:"Transport Layer Security 1.3"},TOR:{description:"The Onion Router"},TOTP:{description:"Time-based One-Time Password"},TRPC:{description:"TypeScript Remote Procedure Call"},TSA:{description:"Transportation Security Administration"},TTL:{description:"Time To Live"},UDP:{description:"User Datagram Protocol"},UI:{description:"User Interface"},UID:{description:"Unique Identifier"},URI:{description:"Uniform Resource Identifier"},URL:{description:"Uniform Resource Locator"},USOPC:{description:"United States Olympic & Paralympic Committee"},USPS:{description:"United States Postal Service"},USTA:{description:"United States Tennis Association"},UTF:{description:"Unicode Transformation Format"},UTC:{description:"Coordinated Universal Time"},UUID:{description:"Universally Unique Identifier"},UX:{description:"User Experience"},VM:{description:"Virtual Machine"},VLAN:{description:"Virtual Local Area Network"},VPN:{description:"Virtual Private Network"},VPPA:{description:"Video Privacy Protection Act"},VR:{description:"Virtual Reality"},WAF:{description:"Web Application Firewall"},WAN:{description:"Wide Area Network"},WNBA:{description:"Women's National Basketball Association"},WLAN:{description:"Wireless Local Area Network"},WPA:{description:"Wi-Fi Protected Access"},WPA2:{description:"Wi-Fi Protected Access II"},WPA3:{description:"Wi-Fi Protected Access III"},WWW:{description:"World Wide Web"},WYSIWYG:{description:"What You See Is What You Get"},XACML:{description:"eXtensible Access Control Markup Language"},XDG:{description:"Cross-Desktop Group"},XML:{description:"eXtensible Markup Language"},XSRF:{description:"Cross-Site Request Forgery"},XSS:{description:"Cross-Site Scripting"},XR:{description:"Extended Reality"},YAML:{description:"YAML Ain't Markup Language"},YMCA:{description:"Young Men's Christian Association"},YWCA:{description:"Young Women's Christian Association"},ZTA:{description:"Zero Trust Architecture"}},ACRONYM_DISPLAY=Object.fromEntries(Object.entries(ACRONYMS).map(([e,i])=>[e,i.display??e])),ACRONYM_DESCRIPTION=Object.fromEntries(Object.entries(ACRONYMS).map(([e,i])=>[e,i.description])),ACRONYM_LIST=Object.keys(ACRONYMS);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ARTICLES: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ARTICLES=["a","an","the"];
|
package/dist/combine.cjs
ADDED
package/dist/combine.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function combine(n,r){return`${n} ${r}`}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CONJUNCTIONS = void 0;
|
|
7
|
+
const CONJUNCTIONS = exports.CONJUNCTIONS = ["and", "that", "but", "or", "as", "if", "when", "than", "because", "while", "where", "after", "so", "though", "since", "until", "whether", "before", "although", "nor", "like", "once", "unless", "now", "except"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CONJUNCTIONS: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const CONJUNCTIONS=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function decamelize(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatSpecialCases = formatSpecialCases;
|
|
7
|
+
var _acronyms = require("./acronyms.cjs");
|
|
8
|
+
var _articles = require("./articles.cjs");
|
|
9
|
+
var _conjunctions = require("./conjunctions.cjs");
|
|
10
|
+
var _prepositions = require("./prepositions.cjs");
|
|
11
|
+
var _specialCases = require("./special-cases.cjs");
|
|
12
|
+
function formatSpecialCases(r, i, n, p) {
|
|
13
|
+
const t = r.toLowerCase(),
|
|
14
|
+
e = r.toUpperCase();
|
|
15
|
+
for (const s of _specialCases.SPECIAL_CASES) if (s.toLowerCase() === t) return s;
|
|
16
|
+
return _acronyms.ACRONYMS[e] ? p?.useDescriptions !== !1 ? _acronyms.ACRONYMS[e].description : _acronyms.ACRONYMS[e].display || e : i === 0 || i === n.length - 1 || r.length >= 4 ? r : _prepositions.PREPOSITIONS.includes(t) || _conjunctions.CONJUNCTIONS.includes(t) || _articles.ARTICLES.includes(t) ? t : r;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface FormatSpecialCasesOptions {
|
|
2
|
+
/**
|
|
3
|
+
* If true, use the descriptions from the acronym list instead of the display names.
|
|
4
|
+
*
|
|
5
|
+
* @defaultValue true
|
|
6
|
+
*/
|
|
7
|
+
useDescriptions?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Handle special words in a title.
|
|
11
|
+
*
|
|
12
|
+
* @see https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case
|
|
13
|
+
*
|
|
14
|
+
* @param value - The word to handle
|
|
15
|
+
* @param index - The index of the word in the title
|
|
16
|
+
* @param words - The full title as an array of words
|
|
17
|
+
* @returns The formatted word
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatSpecialCases(value: string, index: number, words: string[], options?: FormatSpecialCasesOptions): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ACRONYMS as o}from"./acronyms";import{ARTICLES as f}from"./articles";import{CONJUNCTIONS as c}from"./conjunctions";import{PREPOSITIONS as m}from"./prepositions";import{SPECIAL_CASES as a}from"./special-cases";export function formatSpecialCases(r,i,n,p){const t=r.toLowerCase(),e=r.toUpperCase();for(const s of a)if(s.toLowerCase()===t)return s;return o[e]?p?.useDescriptions!==!1?o[e].description:o[e].display||e:i===0||i===n.length-1||r.length>=4?r:m.includes(t)||c.includes(t)||f.includes(t)?t:r}
|
package/dist/index.cjs
CHANGED
|
@@ -14,6 +14,17 @@ Object.keys(_acronyms).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
+
var _articles = require("./articles.cjs");
|
|
18
|
+
Object.keys(_articles).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _articles[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _articles[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
17
28
|
var _camelCase = require("./camel-case.cjs");
|
|
18
29
|
Object.keys(_camelCase).forEach(function (key) {
|
|
19
30
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -25,6 +36,28 @@ Object.keys(_camelCase).forEach(function (key) {
|
|
|
25
36
|
}
|
|
26
37
|
});
|
|
27
38
|
});
|
|
39
|
+
var _combine = require("./combine.cjs");
|
|
40
|
+
Object.keys(_combine).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _combine[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _combine[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _conjunctions = require("./conjunctions.cjs");
|
|
51
|
+
Object.keys(_conjunctions).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _conjunctions[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _conjunctions[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
28
61
|
var _constantCase = require("./constant-case.cjs");
|
|
29
62
|
Object.keys(_constantCase).forEach(function (key) {
|
|
30
63
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -47,6 +80,17 @@ Object.keys(_deburr).forEach(function (key) {
|
|
|
47
80
|
}
|
|
48
81
|
});
|
|
49
82
|
});
|
|
83
|
+
var _decamelize = require("./decamelize.cjs");
|
|
84
|
+
Object.keys(_decamelize).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _decamelize[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _decamelize[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
50
94
|
var _escape = require("./escape.cjs");
|
|
51
95
|
Object.keys(_escape).forEach(function (key) {
|
|
52
96
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -58,6 +102,17 @@ Object.keys(_escape).forEach(function (key) {
|
|
|
58
102
|
}
|
|
59
103
|
});
|
|
60
104
|
});
|
|
105
|
+
var _formatSpecialCases = require("./format-special-cases.cjs");
|
|
106
|
+
Object.keys(_formatSpecialCases).forEach(function (key) {
|
|
107
|
+
if (key === "default" || key === "__esModule") return;
|
|
108
|
+
if (key in exports && exports[key] === _formatSpecialCases[key]) return;
|
|
109
|
+
Object.defineProperty(exports, key, {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () {
|
|
112
|
+
return _formatSpecialCases[key];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
61
116
|
var _getWords = require("./get-words.cjs");
|
|
62
117
|
Object.keys(_getWords).forEach(function (key) {
|
|
63
118
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -146,6 +201,17 @@ Object.keys(_periodSplit).forEach(function (key) {
|
|
|
146
201
|
}
|
|
147
202
|
});
|
|
148
203
|
});
|
|
204
|
+
var _prepositions = require("./prepositions.cjs");
|
|
205
|
+
Object.keys(_prepositions).forEach(function (key) {
|
|
206
|
+
if (key === "default" || key === "__esModule") return;
|
|
207
|
+
if (key in exports && exports[key] === _prepositions[key]) return;
|
|
208
|
+
Object.defineProperty(exports, key, {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () {
|
|
211
|
+
return _prepositions[key];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
149
215
|
var _prettyBytes = require("./pretty-bytes.cjs");
|
|
150
216
|
Object.keys(_prettyBytes).forEach(function (key) {
|
|
151
217
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -168,6 +234,17 @@ Object.keys(_snakeCase).forEach(function (key) {
|
|
|
168
234
|
}
|
|
169
235
|
});
|
|
170
236
|
});
|
|
237
|
+
var _specialCases = require("./special-cases.cjs");
|
|
238
|
+
Object.keys(_specialCases).forEach(function (key) {
|
|
239
|
+
if (key === "default" || key === "__esModule") return;
|
|
240
|
+
if (key in exports && exports[key] === _specialCases[key]) return;
|
|
241
|
+
Object.defineProperty(exports, key, {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () {
|
|
244
|
+
return _specialCases[key];
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
});
|
|
171
248
|
var _startCase = require("./start-case.cjs");
|
|
172
249
|
Object.keys(_startCase).forEach(function (key) {
|
|
173
250
|
if (key === "default" || key === "__esModule") return;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,15 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
export * from "./acronyms";
|
|
10
|
+
export * from "./articles";
|
|
10
11
|
export * from "./camel-case";
|
|
12
|
+
export * from "./combine";
|
|
13
|
+
export * from "./conjunctions";
|
|
11
14
|
export * from "./constant-case";
|
|
12
15
|
export * from "./deburr";
|
|
16
|
+
export * from "./decamelize";
|
|
13
17
|
export * from "./escape";
|
|
18
|
+
export * from "./format-special-cases";
|
|
14
19
|
export * from "./get-words";
|
|
15
20
|
export * from "./kebab-case";
|
|
16
21
|
export * from "./lower-case-first";
|
|
@@ -19,8 +24,10 @@ export * from "./package";
|
|
|
19
24
|
export * from "./pad";
|
|
20
25
|
export * from "./pascal-case";
|
|
21
26
|
export * from "./period-split";
|
|
27
|
+
export * from "./prepositions";
|
|
22
28
|
export * from "./pretty-bytes";
|
|
23
29
|
export * from "./snake-case";
|
|
30
|
+
export * from "./special-cases";
|
|
24
31
|
export * from "./start-case";
|
|
25
32
|
export * from "./strip-indents";
|
|
26
33
|
export * from "./title-case";
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./acronyms";export*from"./camel-case";export*from"./constant-case";export*from"./deburr";export*from"./escape";export*from"./get-words";export*from"./kebab-case";export*from"./lower-case-first";export*from"./normalize-email";export*from"./package";export*from"./pad";export*from"./pascal-case";export*from"./period-split";export*from"./pretty-bytes";export*from"./snake-case";export*from"./start-case";export*from"./strip-indents";export*from"./title-case";export*from"./unescape";export*from"./upper-case-first";
|
|
1
|
+
export*from"./acronyms";export*from"./articles";export*from"./camel-case";export*from"./combine";export*from"./conjunctions";export*from"./constant-case";export*from"./deburr";export*from"./decamelize";export*from"./escape";export*from"./format-special-cases";export*from"./get-words";export*from"./kebab-case";export*from"./lower-case-first";export*from"./normalize-email";export*from"./package";export*from"./pad";export*from"./pascal-case";export*from"./period-split";export*from"./prepositions";export*from"./pretty-bytes";export*from"./snake-case";export*from"./special-cases";export*from"./start-case";export*from"./strip-indents";export*from"./title-case";export*from"./unescape";export*from"./upper-case-first";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PREPOSITIONS = void 0;
|
|
7
|
+
const PREPOSITIONS = exports.PREPOSITIONS = ["about", "above", "across", "after", "against", "along", "among", "around", "at", "because of", "before", "behind", "below", "beneath", "beside", "besides", "between", "beyond", "but", "by", "concerning", "despite", "down", "during", "except", "excepting", "for", "from", "in", "in front of", "inside", "in spite of", "instead of", "into", "like", "near", "of", "off", "on", "onto", "out", "outside", "over", "past", "regarding", "since", "through", "throughout", "to", "toward", "under", "underneath", "until", "up", "upon", "up to", "with", "within", "without", "with regard to", "with respect to"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREPOSITIONS: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PREPOSITIONS=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SPECIAL_CASES = void 0;
|
|
7
|
+
const SPECIAL_CASES = exports.SPECIAL_CASES = ["2FA", "4K", "5K", "8K", "AGI", "BI", "ChatGPT", "CTA", "DateTime", "FMS", "GitHub", "GPT", "HD", "IBMid", "IDs", "iMac", "IMAX", "iOS", "iPad", "iPhone", "iPod", "LDAP", "LinkedIn", "LLM", "macOS", "McDonalds", "MCP", "ML", "MySQL", "NLG", "NLP", "NLU", "OpenAI", "PDFs", "PIM", "PEFT", "pH", "PostgreSQL", "SEO", "TTS", "UHD", "UUID", "XSS", "YouTube", "CSpell", "ESLint"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SPECIAL_CASES: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SPECIAL_CASES=["2FA","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","FMS","GitHub","GPT","HD","IBMid","IDs","iMac","IMAX","iOS","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","macOS","McDonalds","MCP","ML","MySQL","NLG","NLP","NLU","OpenAI","PDFs","PIM","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube","CSpell","ESLint"];
|
package/dist/title-case.cjs
CHANGED
|
@@ -3,29 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.LOWER_CASE_WHEN_NOT_FIRST = exports.FORMAT_MAPPING = void 0;
|
|
7
|
-
exports.isTitleCase = isTitleCase;
|
|
8
6
|
exports.titleCase = titleCase;
|
|
9
|
-
var
|
|
10
|
-
var
|
|
7
|
+
var _combine = require("./combine.cjs");
|
|
8
|
+
var _decamelize = require("./decamelize.cjs");
|
|
9
|
+
var _formatSpecialCases = require("./format-special-cases.cjs");
|
|
11
10
|
var _upperCaseFirst = require("./upper-case-first.cjs");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
display: _acronyms.ACRONYMS[e]?.display || e
|
|
15
|
-
}, s), {
|
|
16
|
-
CSPELL: {
|
|
17
|
-
description: "CSpell",
|
|
18
|
-
display: "CSpell"
|
|
19
|
-
},
|
|
20
|
-
ESLINT: {
|
|
21
|
-
description: "ESLint",
|
|
22
|
-
display: "ESLint"
|
|
23
|
-
}
|
|
24
|
-
}),
|
|
25
|
-
LOWER_CASE_WHEN_NOT_FIRST = exports.LOWER_CASE_WHEN_NOT_FIRST = ["a", "an", "the", "is", "are", "of", "and", "to", "in", "for", "on", "with", "as", "at", "by"];
|
|
26
|
-
function isTitleCase(s) {
|
|
27
|
-
return s ? s.split(/[\s\-_]+/).filter(Boolean).every((i, t) => FORMAT_MAPPING[i.toUpperCase()] || t > 0 && LOWER_CASE_WHEN_NOT_FIRST.includes(i.toLowerCase()) && i === i.toLowerCase() ? !0 : /^[A-Z][a-z0-9]*$/.test(i)) : !1;
|
|
28
|
-
}
|
|
29
|
-
function titleCase(s, e = {}) {
|
|
30
|
-
return isTitleCase(s) || s === void 0 ? s : s.split(/\s+-\s+/).map(i => (0, _getWords.getWords)(i).filter(Boolean).map((t, n) => !e.skipLowerCaseWhenNotFirst && LOWER_CASE_WHEN_NOT_FIRST.includes(t.toLowerCase()) && n > 0 ? t.toLowerCase() : !e.skipFormatMapping && FORMAT_MAPPING[t.toUpperCase()] ? e.useDescriptions !== !1 ? FORMAT_MAPPING[t.toUpperCase()]?.description : FORMAT_MAPPING[t.toUpperCase()]?.display : e.mapping && Object.keys(e.mapping).includes(t.toUpperCase()) ? e.mapping[t.toUpperCase()] : `${(0, _upperCaseFirst.upperCaseFirst)(t)}`).join(" ")).join(" - ");
|
|
11
|
+
function titleCase(e, r) {
|
|
12
|
+
return e?.split(/\s+-\s+/).map(s => (0, _decamelize.decamelize)(s).split(/[\s\-_]/).map(_upperCaseFirst.upperCaseFirst).map((t, i, m) => (0, _formatSpecialCases.formatSpecialCases)(t, i, m, r)).reduce(_combine.combine)).join(" - ");
|
|
31
13
|
}
|
package/dist/title-case.d.ts
CHANGED
|
@@ -1,59 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
description: string;
|
|
3
|
-
display: string;
|
|
4
|
-
}>;
|
|
5
|
-
export declare const LOWER_CASE_WHEN_NOT_FIRST: string[];
|
|
6
|
-
export interface TitleCaseOptions {
|
|
7
|
-
/**
|
|
8
|
-
* If true, skip the format mapping. This will skip the conversion of known acronyms to their upper case form.
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* The current list of word format mappings is stored in {@link FORMAT_MAPPING}.
|
|
12
|
-
*
|
|
13
|
-
* @defaultValue false
|
|
14
|
-
*/
|
|
15
|
-
skipFormatMapping?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* If true, lower case words that are not the first word in the title.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* The current list of words that are lower cased when not first are stored in {@link LOWER_CASE_WHEN_NOT_FIRST}.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @defaultValue false
|
|
24
|
-
*/
|
|
25
|
-
skipLowerCaseWhenNotFirst?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* A custom mapping of words to their formatted versions.
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* This allows you to provide your own mappings for specific words that should be formatted in a certain way.
|
|
31
|
-
*/
|
|
32
|
-
mapping?: Record<string, string>;
|
|
33
|
-
/**
|
|
34
|
-
* If true, use the descriptions from the acronym list instead of the display names.
|
|
35
|
-
*
|
|
36
|
-
* @defaultValue true
|
|
37
|
-
*/
|
|
38
|
-
useDescriptions?: boolean;
|
|
39
|
-
}
|
|
1
|
+
import type { FormatSpecialCasesOptions } from "./format-special-cases";
|
|
40
2
|
/**
|
|
41
|
-
*
|
|
3
|
+
* Convert a string to title case.
|
|
42
4
|
*
|
|
43
|
-
* @
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* @param input - The input string to check.
|
|
47
|
-
* @returns True if the input is in title case, false otherwise.
|
|
48
|
-
*/
|
|
49
|
-
export declare function isTitleCase(input: string | undefined): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Convert the input string to title case.
|
|
52
|
-
*
|
|
53
|
-
* @remarks
|
|
54
|
-
* Title case is defined as a string where each word is separated by spaces, and starts with an uppercase letter followed by lowercase letters - "This Is An Example".
|
|
55
|
-
*
|
|
56
|
-
* @param input - The input string.
|
|
5
|
+
* @param input - The input string to convert.
|
|
6
|
+
* @param options - Options for formatting special cases.
|
|
57
7
|
* @returns The title cased string.
|
|
58
8
|
*/
|
|
59
|
-
export declare function titleCase<T extends string | undefined>(input: T, options?:
|
|
9
|
+
export declare function titleCase<T extends string | undefined>(input: T, options?: FormatSpecialCasesOptions): T;
|
package/dist/title-case.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{combine as o}from"./combine";import{decamelize as p}from"./decamelize";import{formatSpecialCases as a}from"./format-special-cases";import{upperCaseFirst as n}from"./upper-case-first";export function titleCase(e,r){return e?.split(/\s+-\s+/).map(s=>p(s).split(/[\s\-_]/).map(n).map((t,i,m)=>a(t,i,m,r)).reduce(o)).join(" - ")}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/string-format",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing utility functions to transform strings into various formats.",
|
|
6
6
|
"repository": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"private": false,
|
|
12
12
|
"publishConfig": { "access": "public" },
|
|
13
|
-
"dependencies": { "@stryke/helpers": "^0.
|
|
13
|
+
"dependencies": { "@stryke/helpers": "^0.9.2", "@stryke/types": "^0.10.0" },
|
|
14
14
|
"devDependencies": {},
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"files": ["dist/**/*"],
|
|
@@ -125,6 +125,20 @@
|
|
|
125
125
|
"default": "./dist/start-case.mjs"
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
|
+
"./special-cases": {
|
|
129
|
+
"import": {
|
|
130
|
+
"types": "./dist/special-cases.d.ts",
|
|
131
|
+
"default": "./dist/special-cases.mjs"
|
|
132
|
+
},
|
|
133
|
+
"require": {
|
|
134
|
+
"types": "./dist/special-cases.d.ts",
|
|
135
|
+
"default": "./dist/special-cases.cjs"
|
|
136
|
+
},
|
|
137
|
+
"default": {
|
|
138
|
+
"types": "./dist/special-cases.d.ts",
|
|
139
|
+
"default": "./dist/special-cases.mjs"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
128
142
|
"./snake-case": {
|
|
129
143
|
"import": {
|
|
130
144
|
"types": "./dist/snake-case.d.ts",
|
|
@@ -153,6 +167,20 @@
|
|
|
153
167
|
"default": "./dist/pretty-bytes.mjs"
|
|
154
168
|
}
|
|
155
169
|
},
|
|
170
|
+
"./prepositions": {
|
|
171
|
+
"import": {
|
|
172
|
+
"types": "./dist/prepositions.d.ts",
|
|
173
|
+
"default": "./dist/prepositions.mjs"
|
|
174
|
+
},
|
|
175
|
+
"require": {
|
|
176
|
+
"types": "./dist/prepositions.d.ts",
|
|
177
|
+
"default": "./dist/prepositions.cjs"
|
|
178
|
+
},
|
|
179
|
+
"default": {
|
|
180
|
+
"types": "./dist/prepositions.d.ts",
|
|
181
|
+
"default": "./dist/prepositions.mjs"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
156
184
|
"./period-split": {
|
|
157
185
|
"import": {
|
|
158
186
|
"types": "./dist/period-split.d.ts",
|
|
@@ -264,6 +292,20 @@
|
|
|
264
292
|
"default": "./dist/get-words.mjs"
|
|
265
293
|
}
|
|
266
294
|
},
|
|
295
|
+
"./format-special-cases": {
|
|
296
|
+
"import": {
|
|
297
|
+
"types": "./dist/format-special-cases.d.ts",
|
|
298
|
+
"default": "./dist/format-special-cases.mjs"
|
|
299
|
+
},
|
|
300
|
+
"require": {
|
|
301
|
+
"types": "./dist/format-special-cases.d.ts",
|
|
302
|
+
"default": "./dist/format-special-cases.cjs"
|
|
303
|
+
},
|
|
304
|
+
"default": {
|
|
305
|
+
"types": "./dist/format-special-cases.d.ts",
|
|
306
|
+
"default": "./dist/format-special-cases.mjs"
|
|
307
|
+
}
|
|
308
|
+
},
|
|
267
309
|
"./escape": {
|
|
268
310
|
"import": {
|
|
269
311
|
"types": "./dist/escape.d.ts",
|
|
@@ -278,6 +320,20 @@
|
|
|
278
320
|
"default": "./dist/escape.mjs"
|
|
279
321
|
}
|
|
280
322
|
},
|
|
323
|
+
"./decamelize": {
|
|
324
|
+
"import": {
|
|
325
|
+
"types": "./dist/decamelize.d.ts",
|
|
326
|
+
"default": "./dist/decamelize.mjs"
|
|
327
|
+
},
|
|
328
|
+
"require": {
|
|
329
|
+
"types": "./dist/decamelize.d.ts",
|
|
330
|
+
"default": "./dist/decamelize.cjs"
|
|
331
|
+
},
|
|
332
|
+
"default": {
|
|
333
|
+
"types": "./dist/decamelize.d.ts",
|
|
334
|
+
"default": "./dist/decamelize.mjs"
|
|
335
|
+
}
|
|
336
|
+
},
|
|
281
337
|
"./deburr": {
|
|
282
338
|
"import": {
|
|
283
339
|
"types": "./dist/deburr.d.ts",
|
|
@@ -306,6 +362,34 @@
|
|
|
306
362
|
"default": "./dist/constant-case.mjs"
|
|
307
363
|
}
|
|
308
364
|
},
|
|
365
|
+
"./conjunctions": {
|
|
366
|
+
"import": {
|
|
367
|
+
"types": "./dist/conjunctions.d.ts",
|
|
368
|
+
"default": "./dist/conjunctions.mjs"
|
|
369
|
+
},
|
|
370
|
+
"require": {
|
|
371
|
+
"types": "./dist/conjunctions.d.ts",
|
|
372
|
+
"default": "./dist/conjunctions.cjs"
|
|
373
|
+
},
|
|
374
|
+
"default": {
|
|
375
|
+
"types": "./dist/conjunctions.d.ts",
|
|
376
|
+
"default": "./dist/conjunctions.mjs"
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"./combine": {
|
|
380
|
+
"import": {
|
|
381
|
+
"types": "./dist/combine.d.ts",
|
|
382
|
+
"default": "./dist/combine.mjs"
|
|
383
|
+
},
|
|
384
|
+
"require": {
|
|
385
|
+
"types": "./dist/combine.d.ts",
|
|
386
|
+
"default": "./dist/combine.cjs"
|
|
387
|
+
},
|
|
388
|
+
"default": {
|
|
389
|
+
"types": "./dist/combine.d.ts",
|
|
390
|
+
"default": "./dist/combine.mjs"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
309
393
|
"./camel-case": {
|
|
310
394
|
"import": {
|
|
311
395
|
"types": "./dist/camel-case.d.ts",
|
|
@@ -320,6 +404,20 @@
|
|
|
320
404
|
"default": "./dist/camel-case.mjs"
|
|
321
405
|
}
|
|
322
406
|
},
|
|
407
|
+
"./articles": {
|
|
408
|
+
"import": {
|
|
409
|
+
"types": "./dist/articles.d.ts",
|
|
410
|
+
"default": "./dist/articles.mjs"
|
|
411
|
+
},
|
|
412
|
+
"require": {
|
|
413
|
+
"types": "./dist/articles.d.ts",
|
|
414
|
+
"default": "./dist/articles.cjs"
|
|
415
|
+
},
|
|
416
|
+
"default": {
|
|
417
|
+
"types": "./dist/articles.d.ts",
|
|
418
|
+
"default": "./dist/articles.mjs"
|
|
419
|
+
}
|
|
420
|
+
},
|
|
323
421
|
"./acronyms": {
|
|
324
422
|
"import": {
|
|
325
423
|
"types": "./dist/acronyms.d.ts",
|
|
@@ -347,5 +445,5 @@
|
|
|
347
445
|
"main": "./dist/index.cjs",
|
|
348
446
|
"module": "./dist/index.mjs",
|
|
349
447
|
"types": "./dist/index.d.ts",
|
|
350
|
-
"gitHead": "
|
|
448
|
+
"gitHead": "906d6304c09a8964297fa784f96377535fca6769"
|
|
351
449
|
}
|