@directus/format-title
Advanced tools
Comparing version 9.1.2 to 9.2.0
@@ -209,5 +209,5 @@ var prepositions = [ | ||
const uppercaseStr = str.toUpperCase(); | ||
for (let i = 0; i < specialCase.length; i += 1) { | ||
if (specialCase[i].toLowerCase() === lowercaseStr) | ||
return specialCase[i]; | ||
for (const special of specialCase) { | ||
if (special.toLowerCase() === lowercaseStr) | ||
return special; | ||
} | ||
@@ -214,0 +214,0 @@ if (acronyms.includes(uppercaseStr)) |
@@ -211,5 +211,5 @@ 'use strict'; | ||
const uppercaseStr = str.toUpperCase(); | ||
for (let i = 0; i < specialCase.length; i += 1) { | ||
if (specialCase[i].toLowerCase() === lowercaseStr) | ||
return specialCase[i]; | ||
for (const special of specialCase) { | ||
if (special.toLowerCase() === lowercaseStr) | ||
return special; | ||
} | ||
@@ -216,0 +216,0 @@ if (acronyms.includes(uppercaseStr)) |
@@ -1,2 +0,2 @@ | ||
var e=["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"],t=["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"],o=["2D","3D","4WD","API","BASIC","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],n=["2FA","3D","DateTime","GitHub","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","macOS","M2M","M2O","McDonalds","MySQL","O2M","PDFs","pH","PostgreSQL","YouTube","UUID","SEO","CTA","4K","HD","UHD","5K","8K"];function r(r,i,a){const u=r.toLowerCase(),s=r.toUpperCase();for(let e=0;e<n.length;e+=1)if(n[e].toLowerCase()===u)return n[e];return o.includes(s)?s:0===i||i===a.length-1?r:e.includes(u)||t.includes(u)?u:r}function i(e,t){return`${e} ${t}`}function a(e){return e.charAt(0).toUpperCase()+e.substring(1)}function u(e,t){return t||(t=new RegExp("/s|-|_| ","g")),(o=e,o.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()).split(t).map(a).map(r).reduce(i);var o}export{u as default}; | ||
var e=["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"],t=["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"],o=["2D","3D","4WD","API","BASIC","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],n=["2FA","3D","DateTime","GitHub","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","macOS","M2M","M2O","McDonalds","MySQL","O2M","PDFs","pH","PostgreSQL","YouTube","UUID","SEO","CTA","4K","HD","UHD","5K","8K"];function r(r,i,a){const s=r.toLowerCase(),u=r.toUpperCase();for(const e of n)if(e.toLowerCase()===s)return e;return o.includes(u)?u:0===i||i===a.length-1?r:e.includes(s)||t.includes(s)?s:r}function i(e,t){return`${e} ${t}`}function a(e){return e.charAt(0).toUpperCase()+e.substring(1)}function s(e,t){return t||(t=new RegExp("/s|-|_| ","g")),(o=e,o.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()).split(t).map(a).map(r).reduce(i);var o}export{s as default}; | ||
//# sourceMappingURL=format-title.esm.min.js.map |
@@ -1,2 +0,2 @@ | ||
var formatTitle=function(){"use strict";var e=["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"],t=["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"],n=["2D","3D","4WD","API","BASIC","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],o=["2FA","3D","DateTime","GitHub","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","macOS","M2M","M2O","McDonalds","MySQL","O2M","PDFs","pH","PostgreSQL","YouTube","UUID","SEO","CTA","4K","HD","UHD","5K","8K"];function r(r,i,a){for(var u=r.toLowerCase(),s=r.toUpperCase(),c=0;c<o.length;c+=1)if(o[c].toLowerCase()===u)return o[c];return n.includes(s)?s:0===i||i===a.length-1?r:e.includes(u)||t.includes(u)?u:r}function i(e,t){return"".concat(e," ").concat(t)}function a(e){return e.charAt(0).toUpperCase()+e.substring(1)}return function(e,t){return t||(t=new RegExp("/s|-|_| ","g")),(n=e,n.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()).split(t).map(a).map(r).reduce(i);var n}}(); | ||
var formatTitle=function(){"use strict";var e=["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"],t=["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"],n=["2D","3D","4WD","API","BASIC","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],o=["2FA","3D","DateTime","GitHub","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","macOS","M2M","M2O","McDonalds","MySQL","O2M","PDFs","pH","PostgreSQL","YouTube","UUID","SEO","CTA","4K","HD","UHD","5K","8K"];function r(r,i,a){for(var u=r.toLowerCase(),s=r.toUpperCase(),c=0,S=o;c<S.length;c++){var h=S[c];if(h.toLowerCase()===u)return h}return n.includes(s)?s:0===i||i===a.length-1?r:e.includes(u)||t.includes(u)?u:r}function i(e,t){return"".concat(e," ").concat(t)}function a(e){return e.charAt(0).toUpperCase()+e.substring(1)}return function(e,t){return t||(t=new RegExp("/s|-|_| ","g")),(n=e,n.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()).split(t).map(a).map(r).reduce(i);var n}}(); | ||
//# sourceMappingURL=format-title.global.min.js.map |
{ | ||
"name": "@directus/format-title", | ||
"version": "9.1.2", | ||
"version": "9.2.0", | ||
"description": "Custom string formatter that converts any string into [Title Case](http://www.grammar-monster.com/lessons/capital_letters_title_case.htm)", | ||
@@ -19,3 +19,6 @@ "keywords": [ | ||
".": { | ||
"import": "./dist/format-title.bundler.js", | ||
"import": { | ||
"node": "./index.mjs", | ||
"default": "./dist/format-title.bundler.js" | ||
}, | ||
"require": "./dist/format-title.cjs.js" | ||
@@ -26,9 +29,13 @@ }, | ||
"module": "dist/format-title.bundler.js", | ||
"unpkg": "dist/format-title.global.min.js", | ||
"types": "dist/types/index.d.ts", | ||
"unpkg": "dist/format-title.esm.min.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"index.mjs" | ||
], | ||
"author": "rijkvanzanten <rijkvanzanten@me.com>", | ||
"repository": "directus/format-title", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/directus/directus.git" | ||
}, | ||
"license": "MIT", | ||
@@ -40,4 +47,4 @@ "engines": { | ||
"prebuild": "rimraf dist", | ||
"build": "rollup -c rollup.config.js", | ||
"start": "rollup -c rollup.config.js -w" | ||
"build": "rollup -c", | ||
"dev": "rollup -c -w" | ||
}, | ||
@@ -50,2 +57,3 @@ "devDependencies": { | ||
"rollup": "2.60.1", | ||
"rollup-plugin-dts": "4.0.1", | ||
"rollup-plugin-sourcemaps": "0.6.3", | ||
@@ -56,3 +64,3 @@ "rollup-plugin-terser": "7.0.2", | ||
}, | ||
"gitHead": "9bf033c18dd5bdf6fe4058d915083fd5ca393b05" | ||
"gitHead": "776c105aacfda559a1ebf49cb2220599652f6c48" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
0
17883
10
13
509