@stryke/string-format 0.12.24 → 0.12.26
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/CHANGELOG.md +14 -0
- package/dist/acronyms.cjs +1 -1
- package/dist/acronyms.d.cts +17 -2
- package/dist/acronyms.d.cts.map +1 -0
- package/dist/acronyms.d.mts +17 -2
- package/dist/acronyms.d.mts.map +1 -0
- package/dist/acronyms.mjs +2 -1
- package/dist/acronyms.mjs.map +1 -0
- package/dist/articles.cjs +1 -1
- package/dist/articles.d.cts +5 -2
- package/dist/articles.d.cts.map +1 -0
- package/dist/articles.d.mts +5 -2
- package/dist/articles.d.mts.map +1 -0
- package/dist/articles.mjs +2 -1
- package/dist/articles.mjs.map +1 -0
- package/dist/camel-case.cjs +1 -1
- package/dist/camel-case.d.cts +24 -2
- package/dist/camel-case.d.cts.map +1 -0
- package/dist/camel-case.d.mts +24 -2
- package/dist/camel-case.d.mts.map +1 -0
- package/dist/camel-case.mjs +2 -1
- package/dist/camel-case.mjs.map +1 -0
- package/dist/combine.cjs +1 -1
- package/dist/combine.d.cts +12 -2
- package/dist/combine.d.cts.map +1 -0
- package/dist/combine.d.mts +12 -2
- package/dist/combine.d.mts.map +1 -0
- package/dist/combine.mjs +2 -1
- package/dist/combine.mjs.map +1 -0
- package/dist/conjunctions.cjs +1 -1
- package/dist/conjunctions.d.cts +5 -2
- package/dist/conjunctions.d.cts.map +1 -0
- package/dist/conjunctions.d.mts +5 -2
- package/dist/conjunctions.d.mts.map +1 -0
- package/dist/conjunctions.mjs +2 -1
- package/dist/conjunctions.mjs.map +1 -0
- package/dist/constant-case.cjs +1 -1
- package/dist/constant-case.d.cts +24 -2
- package/dist/constant-case.d.cts.map +1 -0
- package/dist/constant-case.d.mts +24 -2
- package/dist/constant-case.d.mts.map +1 -0
- package/dist/constant-case.mjs +2 -1
- package/dist/constant-case.mjs.map +1 -0
- package/dist/deburr.cjs +1 -1
- package/dist/deburr.d.cts +24 -2
- package/dist/deburr.d.cts.map +1 -0
- package/dist/deburr.d.mts +24 -2
- package/dist/deburr.d.mts.map +1 -0
- package/dist/deburr.mjs +2 -1
- package/dist/deburr.mjs.map +1 -0
- package/dist/decamelize.cjs +1 -1
- package/dist/decamelize.d.cts +11 -2
- package/dist/decamelize.d.cts.map +1 -0
- package/dist/decamelize.d.mts +11 -2
- package/dist/decamelize.d.mts.map +1 -0
- package/dist/decamelize.mjs +2 -1
- package/dist/decamelize.mjs.map +1 -0
- package/dist/escape.cjs +1 -1
- package/dist/escape.d.cts +21 -2
- package/dist/escape.d.cts.map +1 -0
- package/dist/escape.d.mts +21 -2
- package/dist/escape.d.mts.map +1 -0
- package/dist/escape.mjs +2 -1
- package/dist/escape.mjs.map +1 -0
- package/dist/format-special-cases.cjs +1 -1
- package/dist/format-special-cases.d.cts +23 -2
- package/dist/format-special-cases.d.cts.map +1 -0
- package/dist/format-special-cases.d.mts +23 -2
- package/dist/format-special-cases.d.mts.map +1 -0
- package/dist/format-special-cases.mjs +2 -1
- package/dist/format-special-cases.mjs.map +1 -0
- package/dist/get-words.cjs +1 -1
- package/dist/get-words.d.cts +47 -2
- package/dist/get-words.d.cts.map +1 -0
- package/dist/get-words.d.mts +47 -2
- package/dist/get-words.d.mts.map +1 -0
- package/dist/get-words.mjs +2 -1
- package/dist/get-words.mjs.map +1 -0
- package/dist/{deburr-Ct9BIF1O.mjs → helpers/src/remove-accents.cjs} +1 -2
- package/dist/{deburr-ulWvJuGq.cjs → helpers/src/remove-accents.mjs} +2 -1
- package/dist/helpers/src/remove-accents.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +27 -27
- package/dist/index.d.mts +27 -27
- package/dist/index.mjs +1 -1
- package/dist/kebab-case.cjs +1 -1
- package/dist/kebab-case.d.cts +24 -2
- package/dist/kebab-case.d.cts.map +1 -0
- package/dist/kebab-case.d.mts +24 -2
- package/dist/kebab-case.d.mts.map +1 -0
- package/dist/kebab-case.mjs +2 -1
- package/dist/kebab-case.mjs.map +1 -0
- package/dist/lower-case-first.cjs +1 -1
- package/dist/lower-case-first.d.cts +14 -2
- package/dist/lower-case-first.d.cts.map +1 -0
- package/dist/lower-case-first.d.mts +14 -2
- package/dist/lower-case-first.d.mts.map +1 -0
- package/dist/lower-case-first.mjs +2 -1
- package/dist/lower-case-first.mjs.map +1 -0
- package/dist/normalize-email.cjs +1 -1
- package/dist/normalize-email.d.cts +20 -2
- package/dist/normalize-email.d.cts.map +1 -0
- package/dist/normalize-email.d.mts +20 -2
- package/dist/normalize-email.d.mts.map +1 -0
- package/dist/normalize-email.mjs +2 -1
- package/dist/normalize-email.mjs.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.d.cts +112 -2
- package/dist/package.d.cts.map +1 -0
- package/dist/package.d.mts +112 -2
- package/dist/package.d.mts.map +1 -0
- package/dist/package.mjs +2 -1
- package/dist/package.mjs.map +1 -0
- package/dist/pad.cjs +1 -1
- package/dist/pad.d.cts +22 -2
- package/dist/pad.d.cts.map +1 -0
- package/dist/pad.d.mts +22 -2
- package/dist/pad.d.mts.map +1 -0
- package/dist/pad.mjs +2 -1
- package/dist/pad.mjs.map +1 -0
- package/dist/pascal-case.cjs +1 -1
- package/dist/pascal-case.d.cts +24 -2
- package/dist/pascal-case.d.cts.map +1 -0
- package/dist/pascal-case.d.mts +24 -2
- package/dist/pascal-case.d.mts.map +1 -0
- package/dist/pascal-case.mjs +2 -1
- package/dist/pascal-case.mjs.map +1 -0
- package/dist/period-split.cjs +1 -1
- package/dist/period-split.d.cts +24 -2
- package/dist/period-split.d.cts.map +1 -0
- package/dist/period-split.d.mts +24 -2
- package/dist/period-split.d.mts.map +1 -0
- package/dist/period-split.mjs +2 -1
- package/dist/period-split.mjs.map +1 -0
- package/dist/prepositions.cjs +1 -1
- package/dist/prepositions.d.cts +5 -2
- package/dist/prepositions.d.cts.map +1 -0
- package/dist/prepositions.d.mts +5 -2
- package/dist/prepositions.d.mts.map +1 -0
- package/dist/prepositions.mjs +2 -1
- package/dist/prepositions.mjs.map +1 -0
- package/dist/pretty-bytes.cjs +1 -1
- package/dist/pretty-bytes.d.cts +152 -2
- package/dist/pretty-bytes.d.cts.map +1 -0
- package/dist/pretty-bytes.d.mts +152 -2
- package/dist/pretty-bytes.d.mts.map +1 -0
- package/dist/pretty-bytes.mjs +2 -1
- package/dist/pretty-bytes.mjs.map +1 -0
- package/dist/snake-case.cjs +1 -1
- package/dist/snake-case.d.cts +28 -2
- package/dist/snake-case.d.cts.map +1 -0
- package/dist/snake-case.d.mts +28 -2
- package/dist/snake-case.d.mts.map +1 -0
- package/dist/snake-case.mjs +2 -1
- package/dist/snake-case.mjs.map +1 -0
- package/dist/special-cases.cjs +1 -1
- package/dist/special-cases.d.cts +5 -2
- package/dist/special-cases.d.cts.map +1 -0
- package/dist/special-cases.d.mts +5 -2
- package/dist/special-cases.d.mts.map +1 -0
- package/dist/special-cases.mjs +2 -1
- package/dist/special-cases.mjs.map +1 -0
- package/dist/start-case.cjs +1 -1
- package/dist/start-case.d.cts +32 -2
- package/dist/start-case.d.cts.map +1 -0
- package/dist/start-case.d.mts +32 -2
- package/dist/start-case.d.mts.map +1 -0
- package/dist/start-case.mjs +2 -1
- package/dist/start-case.mjs.map +1 -0
- package/dist/strip-indents.cjs +3 -1
- package/dist/strip-indents.d.cts +21 -2
- package/dist/strip-indents.d.cts.map +1 -0
- package/dist/strip-indents.d.mts +21 -2
- package/dist/strip-indents.d.mts.map +1 -0
- package/dist/strip-indents.mjs +4 -1
- package/dist/strip-indents.mjs.map +1 -0
- package/dist/title-case.cjs +1 -1
- package/dist/title-case.d.cts +15 -2
- package/dist/title-case.d.cts.map +1 -0
- package/dist/title-case.d.mts +15 -2
- package/dist/title-case.d.mts.map +1 -0
- package/dist/title-case.mjs +2 -1
- package/dist/title-case.mjs.map +1 -0
- package/dist/types/src/base.cjs +1 -0
- package/dist/types/src/base.mjs +2 -0
- package/dist/types/src/base.mjs.map +1 -0
- package/dist/unescape.cjs +1 -1
- package/dist/unescape.d.cts +20 -2
- package/dist/unescape.d.cts.map +1 -0
- package/dist/unescape.d.mts +20 -2
- package/dist/unescape.d.mts.map +1 -0
- package/dist/unescape.mjs +2 -1
- package/dist/unescape.mjs.map +1 -0
- package/dist/upper-case-first.cjs +1 -1
- package/dist/upper-case-first.d.cts +14 -2
- package/dist/upper-case-first.d.cts.map +1 -0
- package/dist/upper-case-first.d.mts +14 -2
- package/dist/upper-case-first.d.mts.map +1 -0
- package/dist/upper-case-first.mjs +2 -1
- package/dist/upper-case-first.mjs.map +1 -0
- package/package.json +3 -3
- package/dist/acronyms-Clf_sxuQ.d.mts +0 -17
- package/dist/acronyms-Clf_sxuQ.d.mts.map +0 -1
- package/dist/acronyms-CqHURYjd.mjs +0 -2
- package/dist/acronyms-CqHURYjd.mjs.map +0 -1
- package/dist/acronyms-D4QIJv0a.d.cts +0 -17
- package/dist/acronyms-D4QIJv0a.d.cts.map +0 -1
- package/dist/acronyms-DiyHB1FK.cjs +0 -1
- package/dist/articles-Cla7DH2n.d.mts +0 -5
- package/dist/articles-Cla7DH2n.d.mts.map +0 -1
- package/dist/articles-D9xvmhoM.cjs +0 -1
- package/dist/articles-DzjpMs-D.d.cts +0 -5
- package/dist/articles-DzjpMs-D.d.cts.map +0 -1
- package/dist/articles-Dzsbtfwj.mjs +0 -2
- package/dist/articles-Dzsbtfwj.mjs.map +0 -1
- package/dist/base-BHbehXQX.mjs +0 -2
- package/dist/base-BHbehXQX.mjs.map +0 -1
- package/dist/base-DdjslzIj.cjs +0 -1
- package/dist/camel-case-BjbgGrxH.d.mts +0 -24
- package/dist/camel-case-BjbgGrxH.d.mts.map +0 -1
- package/dist/camel-case-C05avVyv.cjs +0 -1
- package/dist/camel-case-CZhC2BRe.d.cts +0 -24
- package/dist/camel-case-CZhC2BRe.d.cts.map +0 -1
- package/dist/camel-case-GuOpCLmz.mjs +0 -2
- package/dist/camel-case-GuOpCLmz.mjs.map +0 -1
- package/dist/combine-CAxhmyey.mjs +0 -2
- package/dist/combine-CAxhmyey.mjs.map +0 -1
- package/dist/combine-DZZlBlm_.d.cts +0 -12
- package/dist/combine-DZZlBlm_.d.cts.map +0 -1
- package/dist/combine-PAQYt88F.cjs +0 -1
- package/dist/combine-g1cpXeuj.d.mts +0 -12
- package/dist/combine-g1cpXeuj.d.mts.map +0 -1
- package/dist/conjunctions-B7prVj02.d.mts +0 -5
- package/dist/conjunctions-B7prVj02.d.mts.map +0 -1
- package/dist/conjunctions-CWyOkdmq.mjs +0 -2
- package/dist/conjunctions-CWyOkdmq.mjs.map +0 -1
- package/dist/conjunctions-CaM47PDl.cjs +0 -1
- package/dist/conjunctions-Chb943kG.d.cts +0 -5
- package/dist/conjunctions-Chb943kG.d.cts.map +0 -1
- package/dist/constant-case-B0oTEBjC.cjs +0 -1
- package/dist/constant-case-Cn0OS_D5.mjs +0 -2
- package/dist/constant-case-Cn0OS_D5.mjs.map +0 -1
- package/dist/constant-case-m6XLIpEZ.d.mts +0 -24
- package/dist/constant-case-m6XLIpEZ.d.mts.map +0 -1
- package/dist/constant-case-w4mBqXc4.d.cts +0 -24
- package/dist/constant-case-w4mBqXc4.d.cts.map +0 -1
- package/dist/deburr-Bc41oTWI.d.mts +0 -24
- package/dist/deburr-Bc41oTWI.d.mts.map +0 -1
- package/dist/deburr-Brmq0CIE.d.cts +0 -24
- package/dist/deburr-Brmq0CIE.d.cts.map +0 -1
- package/dist/deburr-Ct9BIF1O.mjs.map +0 -1
- package/dist/decamelize-CO4-wIwF.cjs +0 -1
- package/dist/decamelize-CXxqH9_o.d.mts +0 -11
- package/dist/decamelize-CXxqH9_o.d.mts.map +0 -1
- package/dist/decamelize-CuI8547m.mjs +0 -2
- package/dist/decamelize-CuI8547m.mjs.map +0 -1
- package/dist/decamelize-esVsRIRg.d.cts +0 -11
- package/dist/decamelize-esVsRIRg.d.cts.map +0 -1
- package/dist/escape-C1LTGJQ1.d.cts +0 -21
- package/dist/escape-C1LTGJQ1.d.cts.map +0 -1
- package/dist/escape-C44shywT.d.mts +0 -21
- package/dist/escape-C44shywT.d.mts.map +0 -1
- package/dist/escape-CRoXgV4v.cjs +0 -1
- package/dist/escape-CydJ1P9x.mjs +0 -2
- package/dist/escape-CydJ1P9x.mjs.map +0 -1
- package/dist/format-special-cases-CuctZ76T.cjs +0 -1
- package/dist/format-special-cases-DLTiwMAS.d.mts +0 -23
- package/dist/format-special-cases-DLTiwMAS.d.mts.map +0 -1
- package/dist/format-special-cases-Db69zjlV.d.cts +0 -23
- package/dist/format-special-cases-Db69zjlV.d.cts.map +0 -1
- package/dist/format-special-cases-F9O32YcB.mjs +0 -2
- package/dist/format-special-cases-F9O32YcB.mjs.map +0 -1
- package/dist/get-words-Cdgu0ngS.d.cts +0 -47
- package/dist/get-words-Cdgu0ngS.d.cts.map +0 -1
- package/dist/get-words-De8YIU0J.d.mts +0 -47
- package/dist/get-words-De8YIU0J.d.mts.map +0 -1
- package/dist/get-words-IF97Rpfr.cjs +0 -1
- package/dist/get-words-vlruPM_Q.mjs +0 -2
- package/dist/get-words-vlruPM_Q.mjs.map +0 -1
- package/dist/kebab-case-CT-vTX1k.mjs +0 -2
- package/dist/kebab-case-CT-vTX1k.mjs.map +0 -1
- package/dist/kebab-case-P86ZRHrn.cjs +0 -1
- package/dist/kebab-case-j61N8v5l.d.cts +0 -24
- package/dist/kebab-case-j61N8v5l.d.cts.map +0 -1
- package/dist/kebab-case-pl--iN9P.d.mts +0 -24
- package/dist/kebab-case-pl--iN9P.d.mts.map +0 -1
- package/dist/lower-case-first-BSnwPTwZ.d.cts +0 -14
- package/dist/lower-case-first-BSnwPTwZ.d.cts.map +0 -1
- package/dist/lower-case-first-CES45S2D.cjs +0 -1
- package/dist/lower-case-first-CVRU3SQT.mjs +0 -2
- package/dist/lower-case-first-CVRU3SQT.mjs.map +0 -1
- package/dist/lower-case-first-_dvT-gH7.d.mts +0 -14
- package/dist/lower-case-first-_dvT-gH7.d.mts.map +0 -1
- package/dist/normalize-email-BGivsxZI.d.cts +0 -20
- package/dist/normalize-email-BGivsxZI.d.cts.map +0 -1
- package/dist/normalize-email-DRezSgOV.cjs +0 -1
- package/dist/normalize-email-bfhnC3KA.d.mts +0 -20
- package/dist/normalize-email-bfhnC3KA.d.mts.map +0 -1
- package/dist/normalize-email-us4o_m-8.mjs +0 -2
- package/dist/normalize-email-us4o_m-8.mjs.map +0 -1
- package/dist/package-BSidq8g2.mjs +0 -2
- package/dist/package-BSidq8g2.mjs.map +0 -1
- package/dist/package-Cw2gkIBD.cjs +0 -1
- package/dist/package-dwE_olpo.d.mts +0 -112
- package/dist/package-dwE_olpo.d.mts.map +0 -1
- package/dist/package-o2QJauB-.d.cts +0 -112
- package/dist/package-o2QJauB-.d.cts.map +0 -1
- package/dist/pad-7O_mbugy.cjs +0 -1
- package/dist/pad-B___Grg_.mjs +0 -2
- package/dist/pad-B___Grg_.mjs.map +0 -1
- package/dist/pad-C-Y_3U-y.d.cts +0 -22
- package/dist/pad-C-Y_3U-y.d.cts.map +0 -1
- package/dist/pad-mujSKqwW.d.mts +0 -22
- package/dist/pad-mujSKqwW.d.mts.map +0 -1
- package/dist/pascal-case-BNtNlP7E.mjs +0 -2
- package/dist/pascal-case-BNtNlP7E.mjs.map +0 -1
- package/dist/pascal-case-BQIXhOgM.cjs +0 -1
- package/dist/pascal-case-DpwdMyIR.d.mts +0 -24
- package/dist/pascal-case-DpwdMyIR.d.mts.map +0 -1
- package/dist/pascal-case-KPXemzHF.d.cts +0 -24
- package/dist/pascal-case-KPXemzHF.d.cts.map +0 -1
- package/dist/period-split-BN6zXi_S.cjs +0 -1
- package/dist/period-split-C2v7R4SQ.d.cts +0 -24
- package/dist/period-split-C2v7R4SQ.d.cts.map +0 -1
- package/dist/period-split-CBVGYrUw.d.mts +0 -24
- package/dist/period-split-CBVGYrUw.d.mts.map +0 -1
- package/dist/period-split-PMoklYb7.mjs +0 -2
- package/dist/period-split-PMoklYb7.mjs.map +0 -1
- package/dist/prepositions-BOeFQ28J.mjs +0 -2
- package/dist/prepositions-BOeFQ28J.mjs.map +0 -1
- package/dist/prepositions-Bp1VMgpn.cjs +0 -1
- package/dist/prepositions-By1zoaRG.d.cts +0 -5
- package/dist/prepositions-By1zoaRG.d.cts.map +0 -1
- package/dist/prepositions-DHokBFOW.d.mts +0 -5
- package/dist/prepositions-DHokBFOW.d.mts.map +0 -1
- package/dist/pretty-bytes-Dam2n54B.d.mts +0 -152
- package/dist/pretty-bytes-Dam2n54B.d.mts.map +0 -1
- package/dist/pretty-bytes-DmvsumO5.mjs +0 -2
- package/dist/pretty-bytes-DmvsumO5.mjs.map +0 -1
- package/dist/pretty-bytes-Dv8t5D6N.d.cts +0 -152
- package/dist/pretty-bytes-Dv8t5D6N.d.cts.map +0 -1
- package/dist/pretty-bytes-aHFwwFbw.cjs +0 -1
- package/dist/snake-case-C5v7aTGP.d.cts +0 -28
- package/dist/snake-case-C5v7aTGP.d.cts.map +0 -1
- package/dist/snake-case-CKf8oDuS.d.mts +0 -28
- package/dist/snake-case-CKf8oDuS.d.mts.map +0 -1
- package/dist/special-cases-Ab3-SD5v.d.cts +0 -5
- package/dist/special-cases-Ab3-SD5v.d.cts.map +0 -1
- package/dist/special-cases-CfBSDTk8.cjs +0 -1
- package/dist/special-cases-D7iFXvkR.d.mts +0 -5
- package/dist/special-cases-D7iFXvkR.d.mts.map +0 -1
- package/dist/special-cases-gNNOSEbK.mjs +0 -2
- package/dist/special-cases-gNNOSEbK.mjs.map +0 -1
- package/dist/start-case-B9JLArn_.d.mts +0 -32
- package/dist/start-case-B9JLArn_.d.mts.map +0 -1
- package/dist/start-case-CbdCqiBN.mjs +0 -2
- package/dist/start-case-CbdCqiBN.mjs.map +0 -1
- package/dist/start-case-ChU_5Pyw.cjs +0 -1
- package/dist/start-case-CsYY3Ed4.d.cts +0 -32
- package/dist/start-case-CsYY3Ed4.d.cts.map +0 -1
- package/dist/strip-indents-CPW83oCs.cjs +0 -3
- package/dist/strip-indents-D2-u4Zmx.mjs +0 -4
- package/dist/strip-indents-D2-u4Zmx.mjs.map +0 -1
- package/dist/strip-indents-DBLDecNL.d.cts +0 -21
- package/dist/strip-indents-DBLDecNL.d.cts.map +0 -1
- package/dist/strip-indents-Dtn3rr-P.d.mts +0 -21
- package/dist/strip-indents-Dtn3rr-P.d.mts.map +0 -1
- package/dist/title-case-B_fyCnko.cjs +0 -1
- package/dist/title-case-Cx3FA_Rw.d.mts +0 -15
- package/dist/title-case-Cx3FA_Rw.d.mts.map +0 -1
- package/dist/title-case-DHhN2pBE.mjs +0 -2
- package/dist/title-case-DHhN2pBE.mjs.map +0 -1
- package/dist/title-case-mvtRcmDU.d.cts +0 -15
- package/dist/title-case-mvtRcmDU.d.cts.map +0 -1
- package/dist/unescape-5MrwINOf.d.cts +0 -20
- package/dist/unescape-5MrwINOf.d.cts.map +0 -1
- package/dist/unescape-9cS7rNT5.d.mts +0 -20
- package/dist/unescape-9cS7rNT5.d.mts.map +0 -1
- package/dist/unescape-CKwnSwBD.mjs +0 -2
- package/dist/unescape-CKwnSwBD.mjs.map +0 -1
- package/dist/unescape-Ck5lwccz.cjs +0 -1
- package/dist/upper-case-first-Bwfq-lAe.d.mts +0 -14
- package/dist/upper-case-first-Bwfq-lAe.d.mts.map +0 -1
- package/dist/upper-case-first-Ca89zvpr.mjs +0 -2
- package/dist/upper-case-first-Ca89zvpr.mjs.map +0 -1
- package/dist/upper-case-first-IJMSoKjS.cjs +0 -1
- package/dist/upper-case-first-uHFwRCJ8.d.cts +0 -14
- package/dist/upper-case-first-uHFwRCJ8.d.cts.map +0 -1
package/dist/kebab-case.d.cts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/kebab-case.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if the input string is in kebab case.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
|
|
7
|
+
*
|
|
8
|
+
* @param input - The input string to check.
|
|
9
|
+
* @returns True if the input is in kebab case, false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
declare function isKebabCase(input: string | undefined): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Convert the input string to kebab case.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
|
|
17
|
+
*
|
|
18
|
+
* @param input - The input string.
|
|
19
|
+
* @returns The kebab-cased string.
|
|
20
|
+
*/
|
|
21
|
+
declare function kebabCase<T extends string | undefined>(input: T): T;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { isKebabCase, kebabCase };
|
|
24
|
+
//# sourceMappingURL=kebab-case.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kebab-case.d.cts","names":[],"sources":["../src/kebab-case.ts"],"sourcesContent":[],"mappings":";;AA6BA;AAaA;;;;;;;iBAbgB,WAAA;;;;;;;;;;iBAaA,+CAA+C,IAAI"}
|
package/dist/kebab-case.d.mts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/kebab-case.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if the input string is in kebab case.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
|
|
7
|
+
*
|
|
8
|
+
* @param input - The input string to check.
|
|
9
|
+
* @returns True if the input is in kebab case, false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
declare function isKebabCase(input: string | undefined): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Convert the input string to kebab case.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Kebab case is defined as all lowercase letters with hyphens separating words - "this-is-an-example".
|
|
17
|
+
*
|
|
18
|
+
* @param input - The input string.
|
|
19
|
+
* @returns The kebab-cased string.
|
|
20
|
+
*/
|
|
21
|
+
declare function kebabCase<T extends string | undefined>(input: T): T;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { isKebabCase, kebabCase };
|
|
24
|
+
//# sourceMappingURL=kebab-case.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kebab-case.d.mts","names":[],"sources":["../src/kebab-case.ts"],"sourcesContent":[],"mappings":";;AA6BA;AAaA;;;;;;;iBAbgB,WAAA;;;;;;;;;;iBAaA,+CAA+C,IAAI"}
|
package/dist/kebab-case.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getWords as e}from"./get-words.mjs";function t(e){return e?/^[a-z]+(?:-[a-z0-9]+)*$/.test(e):!1}function n(n){if(t(n)||n===void 0)return n;let r=n?e(n):[];return r.length===0?``:r.join(`-`).toLowerCase()}export{t as isKebabCase,n as kebabCase};
|
|
2
|
+
//# sourceMappingURL=kebab-case.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kebab-case.mjs","names":[],"sources":["../src/kebab-case.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getWords } from \"./get-words\";\n\n/**\n * Check if the input string is in kebab case.\n *\n * @remarks\n * Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n *\n * @param input - The input string to check.\n * @returns True if the input is in kebab case, false otherwise.\n */\nexport function isKebabCase(input: string | undefined): boolean {\n return input ? /^[a-z]+(?:-[a-z0-9]+)*$/.test(input) : false;\n}\n\n/**\n * Convert the input string to kebab case.\n *\n * @remarks\n * Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n *\n * @param input - The input string.\n * @returns The kebab-cased string.\n */\nexport function kebabCase<T extends string | undefined>(input: T): T {\n if (isKebabCase(input) || input === undefined) {\n return input;\n }\n\n const parts = input ? getWords(input) : [];\n if (parts.length === 0) {\n return \"\" as T;\n }\n\n return parts.join(\"-\").toLowerCase() as T;\n}\n"],"mappings":"2CA6BA,SAAgB,EAAY,EAAoC,CAC9D,OAAO,EAAQ,0BAA0B,KAAK,EAAM,CAAG,GAYzD,SAAgB,EAAwC,EAAa,CACnE,GAAI,EAAY,EAAM,EAAI,IAAU,IAAA,GAClC,OAAO,EAGT,IAAM,EAAQ,EAAQ,EAAS,EAAM,CAAG,EAAE,CAK1C,OAJI,EAAM,SAAW,EACZ,GAGF,EAAM,KAAK,IAAI,CAAC,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function e(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}exports.lowerCaseFirst=e;
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/lower-case-first.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Lower case the first character of an input string.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* "tHISISANEXAMPLE"
|
|
7
|
+
*
|
|
8
|
+
* @param input - The input string.
|
|
9
|
+
* @returns The lower-cased string.
|
|
10
|
+
*/
|
|
11
|
+
declare function lowerCaseFirst<T extends string | undefined>(input?: T): T;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { lowerCaseFirst };
|
|
14
|
+
//# sourceMappingURL=lower-case-first.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lower-case-first.d.cts","names":[],"sources":["../src/lower-case-first.ts"],"sourcesContent":[],"mappings":";;AA2BA;;;;;;;;iBAAgB,qDAAqD,IAAI"}
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/lower-case-first.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Lower case the first character of an input string.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* "tHISISANEXAMPLE"
|
|
7
|
+
*
|
|
8
|
+
* @param input - The input string.
|
|
9
|
+
* @returns The lower-cased string.
|
|
10
|
+
*/
|
|
11
|
+
declare function lowerCaseFirst<T extends string | undefined>(input?: T): T;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { lowerCaseFirst };
|
|
14
|
+
//# sourceMappingURL=lower-case-first.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lower-case-first.d.mts","names":[],"sources":["../src/lower-case-first.ts"],"sourcesContent":[],"mappings":";;AA2BA;;;;;;;;iBAAgB,qDAAqD,IAAI"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function e(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}export{e as lowerCaseFirst};
|
|
2
|
+
//# sourceMappingURL=lower-case-first.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lower-case-first.mjs","names":[],"sources":["../src/lower-case-first.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Lower case the first character of an input string.\n *\n * @remarks\n * \"tHISISANEXAMPLE\"\n *\n * @param input - The input string.\n * @returns The lower-cased string.\n */\nexport function lowerCaseFirst<T extends string | undefined>(input?: T): T {\n return (input ? input.charAt(0).toLowerCase() + input.slice(1) : input) as T;\n}\n"],"mappings":"AA2BA,SAAgB,EAA6C,EAAc,CACzE,OAAQ,GAAQ,EAAM,OAAO,EAAE,CAAC,aAAa,CAAG,EAAM,MAAM,EAAE"}
|
package/dist/normalize-email.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=
|
|
1
|
+
const e=/\./g,t=t=>{if(!t.includes(`@`)&&!t.includes(`+`))throw Error(`invalid_email_format`);let n=t.split(`@`).filter(Boolean);if(n.length>1)throw Error(`invalid_email_format`);let[r,i]=n,[a]=r.split(`+`);if(!a)throw Error(`invalid_email_format`);return a=a.replace(e,``),`${a.toLowerCase()}@${i.toLowerCase()}`};exports.normalizeEmail=t;
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/normalize-email.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* 1. Lower-cases whole email.
|
|
4
|
+
* 2. Removes dots ".".
|
|
5
|
+
* 3. Remotes name part after "+".
|
|
6
|
+
* 4. Throws if cannot parse the email.
|
|
7
|
+
*
|
|
8
|
+
* For example, this email
|
|
9
|
+
*
|
|
10
|
+
* Mike.Johnson+twitter\@Gmail.com
|
|
11
|
+
*
|
|
12
|
+
* will be normalized to
|
|
13
|
+
*
|
|
14
|
+
* mikejohnson\@gmail.com
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
declare const normalizeEmail: (email: string) => string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { normalizeEmail };
|
|
20
|
+
//# sourceMappingURL=normalize-email.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-email.d.cts","names":[],"sources":["../src/normalize-email.ts"],"sourcesContent":[],"mappings":";;AAmCA;;;;;;;;;;;;;;cAAa"}
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/normalize-email.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* 1. Lower-cases whole email.
|
|
4
|
+
* 2. Removes dots ".".
|
|
5
|
+
* 3. Remotes name part after "+".
|
|
6
|
+
* 4. Throws if cannot parse the email.
|
|
7
|
+
*
|
|
8
|
+
* For example, this email
|
|
9
|
+
*
|
|
10
|
+
* Mike.Johnson+twitter\@Gmail.com
|
|
11
|
+
*
|
|
12
|
+
* will be normalized to
|
|
13
|
+
*
|
|
14
|
+
* mikejohnson\@gmail.com
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
declare const normalizeEmail: (email: string) => string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { normalizeEmail };
|
|
20
|
+
//# sourceMappingURL=normalize-email.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-email.d.mts","names":[],"sources":["../src/normalize-email.ts"],"sourcesContent":[],"mappings":";;AAmCA;;;;;;;;;;;;;;cAAa"}
|
package/dist/normalize-email.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=/\./g,t=t=>{if(!t.includes(`@`)&&!t.includes(`+`))throw Error(`invalid_email_format`);let n=t.split(`@`).filter(Boolean);if(n.length>1)throw Error(`invalid_email_format`);let[r,i]=n,[a]=r.split(`+`);if(!a)throw Error(`invalid_email_format`);return a=a.replace(e,``),`${a.toLowerCase()}@${i.toLowerCase()}`};export{t as normalizeEmail};
|
|
2
|
+
//# sourceMappingURL=normalize-email.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-email.mjs","names":[],"sources":["../src/normalize-email.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nconst DOT_REG = /\\./g;\n\n/**\n * 1. Lower-cases whole email.\n * 2. Removes dots \".\".\n * 3. Remotes name part after \"+\".\n * 4. Throws if cannot parse the email.\n *\n * For example, this email\n *\n * Mike.Johnson+twitter\\@Gmail.com\n *\n * will be normalized to\n *\n * mikejohnson\\@gmail.com\n *\n */\nexport const normalizeEmail = (email: string) => {\n if (!email.includes(\"@\") && !email.includes(\"+\")) {\n throw new Error(\"invalid_email_format\");\n }\n\n const split = email.split(\"@\").filter(Boolean);\n if (split.length > 1) {\n throw new Error(\"invalid_email_format\");\n }\n\n const [name, host] = split;\n\n let [beforePlus] = name!.split(\"+\");\n if (!beforePlus) {\n throw new Error(\"invalid_email_format\");\n }\n\n beforePlus = beforePlus.replace(DOT_REG, \"\");\n const result = `${beforePlus.toLowerCase()}@${host!.toLowerCase()}`;\n Number(result);\n\n return result;\n};\n"],"mappings":"AAkBA,MAAM,EAAU,MAiBH,EAAkB,GAAkB,CAC/C,GAAI,CAAC,EAAM,SAAS,IAAI,EAAI,CAAC,EAAM,SAAS,IAAI,CAC9C,MAAU,MAAM,uBAAuB,CAGzC,IAAM,EAAQ,EAAM,MAAM,IAAI,CAAC,OAAO,QAAQ,CAC9C,GAAI,EAAM,OAAS,EACjB,MAAU,MAAM,uBAAuB,CAGzC,GAAM,CAAC,EAAM,GAAQ,EAEjB,CAAC,GAAc,EAAM,MAAM,IAAI,CACnC,GAAI,CAAC,EACH,MAAU,MAAM,uBAAuB,CAOzC,MAJA,GAAa,EAAW,QAAQ,EAAS,GAAG,CAC7B,GAAG,EAAW,aAAa,CAAC,GAAG,EAAM,aAAa"}
|
package/dist/package.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function e(e){return/^.[^\n\r@\u2028\u2029]*@.*$/.test(e)}function t(t){return e(t)?t.substring(0,t.lastIndexOf(`@`)):t}function n(e){return/^[^\n\r/\u2028\u2029]*\/.[^\n\r/\u2028\u2029]*\/.*$/.test(e)?e.substring(0,e.lastIndexOf(`/`)):t(e)}function r(t){return e(t)?t.replace(/^.+@/,``):void 0}exports.getPackageName=n,exports.getPackageVersion=r,exports.hasPackageVersion=e,exports.removePackageVersion=t;
|
package/dist/package.d.cts
CHANGED
|
@@ -1,2 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/package.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if a package name has a version
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* hasPackageVersion("lodash@4.17.21");
|
|
8
|
+
* // => true
|
|
9
|
+
* hasPackageVersion("@stryke/core@4.17.21");
|
|
10
|
+
* // => true
|
|
11
|
+
* hasPackageVersion("lodash");
|
|
12
|
+
* // => false
|
|
13
|
+
* hasPackageVersion("@stryke/core");
|
|
14
|
+
* // => false
|
|
15
|
+
* hasPackageVersion("lodash/module");
|
|
16
|
+
* // => false
|
|
17
|
+
* hasPackageVersion("@stryke/core/module");
|
|
18
|
+
* // => false
|
|
19
|
+
* hasPackageVersion("lodash/module@4.17.21");
|
|
20
|
+
* // => true
|
|
21
|
+
* hasPackageVersion("@stryke/core/module@4.17.21");
|
|
22
|
+
* // => true
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @param value - The package name with version
|
|
26
|
+
* @returns Whether the package name has a version
|
|
27
|
+
*/
|
|
28
|
+
declare function hasPackageVersion(value: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Remove the version from a package name (if it exists)
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* removePackageVersion("lodash@4.17.21");
|
|
35
|
+
* // => "lodash"
|
|
36
|
+
* removePackageVersion("@stryke/core@4.17.21");
|
|
37
|
+
* // => "@stryke/core"
|
|
38
|
+
* removePackageVersion("lodash");
|
|
39
|
+
* // => "lodash"
|
|
40
|
+
* removePackageVersion("@stryke/core");
|
|
41
|
+
* // => "@stryke/core"
|
|
42
|
+
* getPackageName("lodash/module");
|
|
43
|
+
* // => "lodash/module"
|
|
44
|
+
* getPackageName("@stryke/core/module");
|
|
45
|
+
* // => "@stryke/core/module"
|
|
46
|
+
* getPackageName("lodash/module@4.17.21");
|
|
47
|
+
* // => "lodash/module"
|
|
48
|
+
* getPackageName("@stryke/core/module@4.17.21");
|
|
49
|
+
* // => "@stryke/core/module"
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @param value - The package name with version
|
|
53
|
+
* @returns The package name without version
|
|
54
|
+
*/
|
|
55
|
+
declare function removePackageVersion(value: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Get the package name from a scoped package string
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* getPackageName("lodash@4.17.21");
|
|
62
|
+
* // => "lodash"
|
|
63
|
+
* getPackageName("@stryke/core@4.17.21");
|
|
64
|
+
* // => "@stryke/core"
|
|
65
|
+
* getPackageName("lodash");
|
|
66
|
+
* // => "lodash"
|
|
67
|
+
* getPackageName("@stryke/core");
|
|
68
|
+
* // => "@stryke/core"
|
|
69
|
+
* getPackageName("lodash/module");
|
|
70
|
+
* // => "lodash"
|
|
71
|
+
* getPackageName("@stryke/core/module");
|
|
72
|
+
* // => "@stryke/core"
|
|
73
|
+
* getPackageName("lodash/module@4.17.21");
|
|
74
|
+
* // => "lodash"
|
|
75
|
+
* getPackageName("@stryke/core/module@4.17.21");
|
|
76
|
+
* // => "@stryke/core"
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @param value - The scoped package string
|
|
80
|
+
* @returns The package name without the scope
|
|
81
|
+
*/
|
|
82
|
+
declare function getPackageName(value: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* Get the package version from a scoped package string
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* getPackageName("lodash@4.17.21");
|
|
89
|
+
* // => "4.17.21"
|
|
90
|
+
* getPackageName("@stryke/core@4.17.21");
|
|
91
|
+
* // => "4.17.21"
|
|
92
|
+
* getPackageName("lodash");
|
|
93
|
+
* // => undefined
|
|
94
|
+
* getPackageName("@stryke/core");
|
|
95
|
+
* // => undefined
|
|
96
|
+
* getPackageName("lodash/module");
|
|
97
|
+
* // => undefined
|
|
98
|
+
* getPackageName("@stryke/core/module");
|
|
99
|
+
* // => undefined
|
|
100
|
+
* getPackageName("lodash/module@4.17.21");
|
|
101
|
+
* // => "4.17.21"
|
|
102
|
+
* getPackageName("@stryke/core/module@4.17.21");
|
|
103
|
+
* // => "4.17.21"
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @param value - The scoped package string
|
|
107
|
+
* @returns The package version without the package name if it exists. If not, returns undefined.
|
|
108
|
+
*/
|
|
109
|
+
declare function getPackageVersion(value: string): string | undefined;
|
|
110
|
+
//#endregion
|
|
111
|
+
export { getPackageName, getPackageVersion, hasPackageVersion, removePackageVersion };
|
|
112
|
+
//# sourceMappingURL=package.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.d.cts","names":[],"sources":["../src/package.ts"],"sourcesContent":[],"mappings":";;AA4CA;AA8BA;AAgCA;AAgCA;;;;;;;;;;;;;;;;;;;;;;iBA9FgB,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BA,oBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCA,iBAAA"}
|
package/dist/package.d.mts
CHANGED
|
@@ -1,2 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/package.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if a package name has a version
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* hasPackageVersion("lodash@4.17.21");
|
|
8
|
+
* // => true
|
|
9
|
+
* hasPackageVersion("@stryke/core@4.17.21");
|
|
10
|
+
* // => true
|
|
11
|
+
* hasPackageVersion("lodash");
|
|
12
|
+
* // => false
|
|
13
|
+
* hasPackageVersion("@stryke/core");
|
|
14
|
+
* // => false
|
|
15
|
+
* hasPackageVersion("lodash/module");
|
|
16
|
+
* // => false
|
|
17
|
+
* hasPackageVersion("@stryke/core/module");
|
|
18
|
+
* // => false
|
|
19
|
+
* hasPackageVersion("lodash/module@4.17.21");
|
|
20
|
+
* // => true
|
|
21
|
+
* hasPackageVersion("@stryke/core/module@4.17.21");
|
|
22
|
+
* // => true
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @param value - The package name with version
|
|
26
|
+
* @returns Whether the package name has a version
|
|
27
|
+
*/
|
|
28
|
+
declare function hasPackageVersion(value: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Remove the version from a package name (if it exists)
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* removePackageVersion("lodash@4.17.21");
|
|
35
|
+
* // => "lodash"
|
|
36
|
+
* removePackageVersion("@stryke/core@4.17.21");
|
|
37
|
+
* // => "@stryke/core"
|
|
38
|
+
* removePackageVersion("lodash");
|
|
39
|
+
* // => "lodash"
|
|
40
|
+
* removePackageVersion("@stryke/core");
|
|
41
|
+
* // => "@stryke/core"
|
|
42
|
+
* getPackageName("lodash/module");
|
|
43
|
+
* // => "lodash/module"
|
|
44
|
+
* getPackageName("@stryke/core/module");
|
|
45
|
+
* // => "@stryke/core/module"
|
|
46
|
+
* getPackageName("lodash/module@4.17.21");
|
|
47
|
+
* // => "lodash/module"
|
|
48
|
+
* getPackageName("@stryke/core/module@4.17.21");
|
|
49
|
+
* // => "@stryke/core/module"
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @param value - The package name with version
|
|
53
|
+
* @returns The package name without version
|
|
54
|
+
*/
|
|
55
|
+
declare function removePackageVersion(value: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Get the package name from a scoped package string
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* getPackageName("lodash@4.17.21");
|
|
62
|
+
* // => "lodash"
|
|
63
|
+
* getPackageName("@stryke/core@4.17.21");
|
|
64
|
+
* // => "@stryke/core"
|
|
65
|
+
* getPackageName("lodash");
|
|
66
|
+
* // => "lodash"
|
|
67
|
+
* getPackageName("@stryke/core");
|
|
68
|
+
* // => "@stryke/core"
|
|
69
|
+
* getPackageName("lodash/module");
|
|
70
|
+
* // => "lodash"
|
|
71
|
+
* getPackageName("@stryke/core/module");
|
|
72
|
+
* // => "@stryke/core"
|
|
73
|
+
* getPackageName("lodash/module@4.17.21");
|
|
74
|
+
* // => "lodash"
|
|
75
|
+
* getPackageName("@stryke/core/module@4.17.21");
|
|
76
|
+
* // => "@stryke/core"
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @param value - The scoped package string
|
|
80
|
+
* @returns The package name without the scope
|
|
81
|
+
*/
|
|
82
|
+
declare function getPackageName(value: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* Get the package version from a scoped package string
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* getPackageName("lodash@4.17.21");
|
|
89
|
+
* // => "4.17.21"
|
|
90
|
+
* getPackageName("@stryke/core@4.17.21");
|
|
91
|
+
* // => "4.17.21"
|
|
92
|
+
* getPackageName("lodash");
|
|
93
|
+
* // => undefined
|
|
94
|
+
* getPackageName("@stryke/core");
|
|
95
|
+
* // => undefined
|
|
96
|
+
* getPackageName("lodash/module");
|
|
97
|
+
* // => undefined
|
|
98
|
+
* getPackageName("@stryke/core/module");
|
|
99
|
+
* // => undefined
|
|
100
|
+
* getPackageName("lodash/module@4.17.21");
|
|
101
|
+
* // => "4.17.21"
|
|
102
|
+
* getPackageName("@stryke/core/module@4.17.21");
|
|
103
|
+
* // => "4.17.21"
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @param value - The scoped package string
|
|
107
|
+
* @returns The package version without the package name if it exists. If not, returns undefined.
|
|
108
|
+
*/
|
|
109
|
+
declare function getPackageVersion(value: string): string | undefined;
|
|
110
|
+
//#endregion
|
|
111
|
+
export { getPackageName, getPackageVersion, hasPackageVersion, removePackageVersion };
|
|
112
|
+
//# sourceMappingURL=package.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.d.mts","names":[],"sources":["../src/package.ts"],"sourcesContent":[],"mappings":";;AA4CA;AA8BA;AAgCA;AAgCA;;;;;;;;;;;;;;;;;;;;;;iBA9FgB,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BA,oBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCA,iBAAA"}
|
package/dist/package.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function e(e){return/^.[^\n\r@\u2028\u2029]*@.*$/.test(e)}function t(t){return e(t)?t.substring(0,t.lastIndexOf(`@`)):t}function n(e){return/^[^\n\r/\u2028\u2029]*\/.[^\n\r/\u2028\u2029]*\/.*$/.test(e)?e.substring(0,e.lastIndexOf(`/`)):t(e)}function r(t){return e(t)?t.replace(/^.+@/,``):void 0}export{n as getPackageName,r as getPackageVersion,e as hasPackageVersion,t as removePackageVersion};
|
|
2
|
+
//# sourceMappingURL=package.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.mjs","names":[],"sources":["../src/package.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Check if a package name has a version\n *\n * @example\n * ```typescript\n * hasPackageVersion(\"lodash@4.17.21\");\n * // => true\n * hasPackageVersion(\"@stryke/core@4.17.21\");\n * // => true\n * hasPackageVersion(\"lodash\");\n * // => false\n * hasPackageVersion(\"@stryke/core\");\n * // => false\n * hasPackageVersion(\"lodash/module\");\n * // => false\n * hasPackageVersion(\"@stryke/core/module\");\n * // => false\n * hasPackageVersion(\"lodash/module@4.17.21\");\n * // => true\n * hasPackageVersion(\"@stryke/core/module@4.17.21\");\n * // => true\n * ```\n *\n * @param value - The package name with version\n * @returns Whether the package name has a version\n */\nexport function hasPackageVersion(value: string): boolean {\n return /^.[^\\n\\r@\\u2028\\u2029]*@.*$/.test(value);\n}\n\n/**\n * Remove the version from a package name (if it exists)\n *\n * @example\n * ```typescript\n * removePackageVersion(\"lodash@4.17.21\");\n * // => \"lodash\"\n * removePackageVersion(\"@stryke/core@4.17.21\");\n * // => \"@stryke/core\"\n * removePackageVersion(\"lodash\");\n * // => \"lodash\"\n * removePackageVersion(\"@stryke/core\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash/module\");\n * // => \"lodash/module\"\n * getPackageName(\"@stryke/core/module\");\n * // => \"@stryke/core/module\"\n * getPackageName(\"lodash/module@4.17.21\");\n * // => \"lodash/module\"\n * getPackageName(\"@stryke/core/module@4.17.21\");\n * // => \"@stryke/core/module\"\n * ```\n *\n * @param value - The package name with version\n * @returns The package name without version\n */\nexport function removePackageVersion(value: string) {\n return hasPackageVersion(value)\n ? value.substring(0, value.lastIndexOf(\"@\"))\n : value;\n}\n\n/**\n * Get the package name from a scoped package string\n *\n * @example\n * ```typescript\n * getPackageName(\"lodash@4.17.21\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core@4.17.21\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash/module\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core/module\");\n * // => \"@stryke/core\"\n * getPackageName(\"lodash/module@4.17.21\");\n * // => \"lodash\"\n * getPackageName(\"@stryke/core/module@4.17.21\");\n * // => \"@stryke/core\"\n * ```\n *\n * @param value - The scoped package string\n * @returns The package name without the scope\n */\nexport function getPackageName(value: string) {\n return /^[^\\n\\r/\\u2028\\u2029]*\\/.[^\\n\\r/\\u2028\\u2029]*\\/.*$/.test(value)\n ? value.substring(0, value.lastIndexOf(\"/\"))\n : removePackageVersion(value);\n}\n\n/**\n * Get the package version from a scoped package string\n *\n * @example\n * ```typescript\n * getPackageName(\"lodash@4.17.21\");\n * // => \"4.17.21\"\n * getPackageName(\"@stryke/core@4.17.21\");\n * // => \"4.17.21\"\n * getPackageName(\"lodash\");\n * // => undefined\n * getPackageName(\"@stryke/core\");\n * // => undefined\n * getPackageName(\"lodash/module\");\n * // => undefined\n * getPackageName(\"@stryke/core/module\");\n * // => undefined\n * getPackageName(\"lodash/module@4.17.21\");\n * // => \"4.17.21\"\n * getPackageName(\"@stryke/core/module@4.17.21\");\n * // => \"4.17.21\"\n * ```\n *\n * @param value - The scoped package string\n * @returns The package version without the package name if it exists. If not, returns undefined.\n */\nexport function getPackageVersion(value: string): string | undefined {\n return hasPackageVersion(value) ? value.replace(/^.+@/, \"\") : undefined;\n}\n"],"mappings":"AA4CA,SAAgB,EAAkB,EAAwB,CACxD,MAAO,8BAA8B,KAAK,EAAM,CA6BlD,SAAgB,EAAqB,EAAe,CAClD,OAAO,EAAkB,EAAM,CAC3B,EAAM,UAAU,EAAG,EAAM,YAAY,IAAI,CAAC,CAC1C,EA6BN,SAAgB,EAAe,EAAe,CAC5C,MAAO,sDAAsD,KAAK,EAAM,CACpE,EAAM,UAAU,EAAG,EAAM,YAAY,IAAI,CAAC,CAC1C,EAAqB,EAAM,CA6BjC,SAAgB,EAAkB,EAAmC,CACnE,OAAO,EAAkB,EAAM,CAAG,EAAM,QAAQ,OAAQ,GAAG,CAAG,IAAA"}
|
package/dist/pad.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function e(e,t,n=` `){return e.padStart(Math.floor((t-e.length)/2)+e.length,n).padEnd(t,n)}exports.pad=e;
|
package/dist/pad.d.cts
CHANGED
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/pad.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pads string on the left and right sides if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length.
|
|
4
|
+
* If the length is less than or equal to the original string's length, or if the padding character is an empty string, the original string is returned unchanged.
|
|
5
|
+
*
|
|
6
|
+
* @param str - The string to pad.
|
|
7
|
+
* @param length - The length of the resulting string once padded.
|
|
8
|
+
* @param chars - The character(s) to use for padding.
|
|
9
|
+
* @returns The padded string, or the original string if padding is not required.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const result1 = pad('abc', 8); // result will be ' abc '
|
|
14
|
+
* const result2 = pad('abc', 8, '_-'); // result will be '_-abc_-_'
|
|
15
|
+
* const result3 = pad('abc', 3); // result will be 'abc'
|
|
16
|
+
* const result4 = pad('abc', 2); // result will be 'abc'
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function pad(str: string, length: number, chars?: string): string;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { pad };
|
|
22
|
+
//# sourceMappingURL=pad.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pad.d.cts","names":[],"sources":["../src/pad.ts"],"sourcesContent":[],"mappings":";;AAmCA;;;;;;;;;;;;;;;;iBAAgB,GAAA"}
|
package/dist/pad.d.mts
CHANGED
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/pad.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pads string on the left and right sides if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length.
|
|
4
|
+
* If the length is less than or equal to the original string's length, or if the padding character is an empty string, the original string is returned unchanged.
|
|
5
|
+
*
|
|
6
|
+
* @param str - The string to pad.
|
|
7
|
+
* @param length - The length of the resulting string once padded.
|
|
8
|
+
* @param chars - The character(s) to use for padding.
|
|
9
|
+
* @returns The padded string, or the original string if padding is not required.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const result1 = pad('abc', 8); // result will be ' abc '
|
|
14
|
+
* const result2 = pad('abc', 8, '_-'); // result will be '_-abc_-_'
|
|
15
|
+
* const result3 = pad('abc', 3); // result will be 'abc'
|
|
16
|
+
* const result4 = pad('abc', 2); // result will be 'abc'
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function pad(str: string, length: number, chars?: string): string;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { pad };
|
|
22
|
+
//# sourceMappingURL=pad.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pad.d.mts","names":[],"sources":["../src/pad.ts"],"sourcesContent":[],"mappings":";;AAmCA;;;;;;;;;;;;;;;;iBAAgB,GAAA"}
|
package/dist/pad.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function e(e,t,n=` `){return e.padStart(Math.floor((t-e.length)/2)+e.length,n).padEnd(t,n)}export{e as pad};
|
|
2
|
+
//# sourceMappingURL=pad.mjs.map
|
package/dist/pad.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pad.mjs","names":[],"sources":["../src/pad.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Pads string on the left and right sides if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length.\n * If the length is less than or equal to the original string's length, or if the padding character is an empty string, the original string is returned unchanged.\n *\n * @param str - The string to pad.\n * @param length - The length of the resulting string once padded.\n * @param chars - The character(s) to use for padding.\n * @returns The padded string, or the original string if padding is not required.\n *\n * @example\n * ```ts\n * const result1 = pad('abc', 8); // result will be ' abc '\n * const result2 = pad('abc', 8, '_-'); // result will be '_-abc_-_'\n * const result3 = pad('abc', 3); // result will be 'abc'\n * const result4 = pad('abc', 2); // result will be 'abc'\n * ```\n */\nexport function pad(str: string, length: number, chars = \" \"): string {\n return str\n .padStart(Math.floor((length - str.length) / 2) + str.length, chars)\n .padEnd(length, chars);\n}\n"],"mappings":"AAmCA,SAAgB,EAAI,EAAa,EAAgB,EAAQ,IAAa,CACpE,OAAO,EACJ,SAAS,KAAK,OAAO,EAAS,EAAI,QAAU,EAAE,CAAG,EAAI,OAAQ,EAAM,CACnE,OAAO,EAAQ,EAAM"}
|
package/dist/pascal-case.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./acronyms
|
|
1
|
+
const e=require(`./acronyms.cjs`),t=require(`./get-words.cjs`);function n(t){return t?/^[A-Z][A-Z0-9]*$/.test(t)&&e.ACRONYM_LIST.includes(t.trim().toUpperCase())||/^(?:[A-Z][A-Z0-9]*[a-z]+)*$/.test(t):!1}function r(r){return n(r)||r===void 0?r:t.getWords(r).map(t=>e.ACRONYM_LIST.includes(t.trim().toUpperCase())?e.ACRONYMS[t.trim().toUpperCase()]?.display||t.trim().toUpperCase():t.trim().charAt(0).toUpperCase()+t.trim().slice(1).toLowerCase()).join(``)}exports.isPascalCase=n,exports.pascalCase=r;
|
package/dist/pascal-case.d.cts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/pascal-case.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if the input string is in pascal case.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Pascal case is defined as an uppercase first letter followed by any number of lowercase letters and digits - "ThisIsAnExample".
|
|
7
|
+
*
|
|
8
|
+
* @param input - The input string to check.
|
|
9
|
+
* @returns True if the input is in pascal case, false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
declare function isPascalCase(input: string | undefined): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Convert the input string to pascal case.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Pascal case is defined as an uppercase first letter followed by any number of lowercase letters and digits - "ThisIsAnExample".
|
|
17
|
+
*
|
|
18
|
+
* @param input - The input string.
|
|
19
|
+
* @returns The pascal-cased string.
|
|
20
|
+
*/
|
|
21
|
+
declare function pascalCase<T extends string | undefined>(input?: T): T;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { isPascalCase, pascalCase };
|
|
24
|
+
//# sourceMappingURL=pascal-case.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pascal-case.d.cts","names":[],"sources":["../src/pascal-case.ts"],"sourcesContent":[],"mappings":";;AA8BA;AAiBA;;;;;;;iBAjBgB,YAAA;;;;;;;;;;iBAiBA,iDAAiD,IAAI"}
|
package/dist/pascal-case.d.mts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/pascal-case.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if the input string is in pascal case.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Pascal case is defined as an uppercase first letter followed by any number of lowercase letters and digits - "ThisIsAnExample".
|
|
7
|
+
*
|
|
8
|
+
* @param input - The input string to check.
|
|
9
|
+
* @returns True if the input is in pascal case, false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
declare function isPascalCase(input: string | undefined): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Convert the input string to pascal case.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Pascal case is defined as an uppercase first letter followed by any number of lowercase letters and digits - "ThisIsAnExample".
|
|
17
|
+
*
|
|
18
|
+
* @param input - The input string.
|
|
19
|
+
* @returns The pascal-cased string.
|
|
20
|
+
*/
|
|
21
|
+
declare function pascalCase<T extends string | undefined>(input?: T): T;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { isPascalCase, pascalCase };
|
|
24
|
+
//# sourceMappingURL=pascal-case.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pascal-case.d.mts","names":[],"sources":["../src/pascal-case.ts"],"sourcesContent":[],"mappings":";;AA8BA;AAiBA;;;;;;;iBAjBgB,YAAA;;;;;;;;;;iBAiBA,iDAAiD,IAAI"}
|
package/dist/pascal-case.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import"./acronyms
|
|
1
|
+
import{ACRONYMS as e,ACRONYM_LIST as t}from"./acronyms.mjs";import{getWords as n}from"./get-words.mjs";function r(e){return e?/^[A-Z][A-Z0-9]*$/.test(e)&&t.includes(e.trim().toUpperCase())||/^(?:[A-Z][A-Z0-9]*[a-z]+)*$/.test(e):!1}function i(i){return r(i)||i===void 0?i:n(i).map(n=>t.includes(n.trim().toUpperCase())?e[n.trim().toUpperCase()]?.display||n.trim().toUpperCase():n.trim().charAt(0).toUpperCase()+n.trim().slice(1).toLowerCase()).join(``)}export{r as isPascalCase,i as pascalCase};
|
|
2
|
+
//# sourceMappingURL=pascal-case.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pascal-case.mjs","names":[],"sources":["../src/pascal-case.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ACRONYM_LIST, ACRONYMS } from \"./acronyms\";\nimport { getWords } from \"./get-words\";\n\n/**\n * Check if the input string is in pascal case.\n *\n * @remarks\n * Pascal case is defined as an uppercase first letter followed by any number of lowercase letters and digits - \"ThisIsAnExample\".\n *\n * @param input - The input string to check.\n * @returns True if the input is in pascal case, false otherwise.\n */\nexport function isPascalCase(input: string | undefined): boolean {\n return input\n ? (/^[A-Z][A-Z0-9]*$/.test(input) &&\n ACRONYM_LIST.includes(input.trim().toUpperCase())) ||\n /^(?:[A-Z][A-Z0-9]*[a-z]+)*$/.test(input)\n : false;\n}\n\n/**\n * Convert the input string to pascal case.\n *\n * @remarks\n * Pascal case is defined as an uppercase first letter followed by any number of lowercase letters and digits - \"ThisIsAnExample\".\n *\n * @param input - The input string.\n * @returns The pascal-cased string.\n */\nexport function pascalCase<T extends string | undefined>(input?: T): T {\n return (\n isPascalCase(input) || input === undefined\n ? input\n : getWords(input)\n .map(word =>\n ACRONYM_LIST.includes(word.trim().toUpperCase())\n ? ACRONYMS[word.trim().toUpperCase()]?.display ||\n word.trim().toUpperCase()\n : word.trim().charAt(0).toUpperCase() +\n word.trim().slice(1).toLowerCase()\n )\n .join(\"\")\n ) as T;\n}\n"],"mappings":"uGA8BA,SAAgB,EAAa,EAAoC,CAC/D,OAAO,EACF,mBAAmB,KAAK,EAAM,EAC7B,EAAa,SAAS,EAAM,MAAM,CAAC,aAAa,CAAC,EACjD,8BAA8B,KAAK,EAAM,CAC3C,GAYN,SAAgB,EAAyC,EAAc,CACrE,OACE,EAAa,EAAM,EAAI,IAAU,IAAA,GAC7B,EACA,EAAS,EAAM,CACZ,IAAI,GACH,EAAa,SAAS,EAAK,MAAM,CAAC,aAAa,CAAC,CAC5C,EAAS,EAAK,MAAM,CAAC,aAAa,GAAG,SACrC,EAAK,MAAM,CAAC,aAAa,CACzB,EAAK,MAAM,CAAC,OAAO,EAAE,CAAC,aAAa,CACnC,EAAK,MAAM,CAAC,MAAM,EAAE,CAAC,aAAa,CACvC,CACA,KAAK,GAAG"}
|