@rzl-zone/utils-js 3.0.2-beta.2 → 3.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assertions/index.cjs +1 -1
- package/dist/assertions/index.d.ts +96 -116
- package/dist/assertions/index.js +1 -1
- package/dist/chunk-25G6B35W.js +1 -0
- package/dist/chunk-2AUUPGMN.js +1 -0
- package/dist/chunk-2JQQQ625.js +1 -0
- package/dist/chunk-445TAVT4.cjs +1 -0
- package/dist/chunk-467VEMJH.js +1 -0
- package/dist/chunk-6Q4I2RPC.cjs +1 -0
- package/dist/chunk-6SMJMZ7G.cjs +1 -0
- package/dist/chunk-BLCANGFS.js +1 -0
- package/dist/chunk-CK3BZGEU.js +1 -0
- package/dist/{chunk-JWHM3WZQ.cjs → chunk-D43GV6EF.cjs} +1 -1
- package/dist/chunk-DFSTVQFI.cjs +1 -0
- package/dist/chunk-DYRDBYPF.cjs +1 -0
- package/dist/chunk-EXXLUO7L.cjs +1 -0
- package/dist/chunk-G72VSVGO.js +1 -0
- package/dist/chunk-GAJTFCUA.js +1 -0
- package/dist/chunk-GOJNH55O.cjs +1 -0
- package/dist/chunk-HXST7RJB.js +1 -0
- package/dist/{chunk-BYZAD3XN.cjs → chunk-HXTACM3O.cjs} +1 -1
- package/dist/chunk-IJTZWWRJ.cjs +1 -0
- package/dist/chunk-ISJ33O2J.cjs +1 -0
- package/dist/chunk-JISH2VGG.js +1 -0
- package/dist/{chunk-FF76ISQ2.js → chunk-JQZUWBIX.js} +1 -1
- package/dist/{chunk-XH6MCRLP.js → chunk-K4PLGD7C.js} +1 -1
- package/dist/chunk-KZQB7H4E.cjs +1 -0
- package/dist/chunk-LUVV5KSD.cjs +2 -0
- package/dist/chunk-LVUSFXQS.cjs +1 -0
- package/dist/chunk-ME5OV5HN.js +1 -0
- package/dist/chunk-MF5Y5K4N.cjs +1 -0
- package/dist/chunk-MJAW5RAK.js +1 -0
- package/dist/chunk-MWLEM7ED.js +1 -0
- package/dist/chunk-NSVLG7NY.js +4 -0
- package/dist/chunk-NUHOOAUN.cjs +1 -0
- package/dist/chunk-NUVGETPD.js +2 -0
- package/dist/chunk-O5VXBNUQ.cjs +4 -0
- package/dist/chunk-O7SJR4CY.cjs +1 -0
- package/dist/chunk-OX6RLS2F.cjs +1 -0
- package/dist/chunk-PFLNHD4B.cjs +1 -0
- package/dist/chunk-PSWITZK5.js +1 -0
- package/dist/chunk-PYUVKHUF.cjs +1 -0
- package/dist/chunk-REFMEB4A.js +1 -0
- package/dist/chunk-RHE3M2NJ.cjs +1 -0
- package/dist/chunk-RHIBYOFQ.js +1 -0
- package/dist/chunk-S7GMG4TB.js +1 -0
- package/dist/chunk-TQMZ2LPI.js +1 -0
- package/dist/{chunk-RN3TP3S3.js → chunk-U4TZO7WV.js} +1 -1
- package/dist/chunk-UUMKL74S.js +1 -0
- package/dist/{chunk-EXZ47NOW.js → chunk-VQLAPEL3.js} +1 -1
- package/dist/chunk-VTR75UID.cjs +1 -0
- package/dist/chunk-XFCJDSB2.cjs +1 -0
- package/dist/chunk-XOYX4PLZ.cjs +1 -0
- package/dist/chunk-Z6FLCEN6.js +1 -0
- package/dist/chunk-ZO5364A6.cjs +1 -0
- package/dist/conversions/index.cjs +1 -1
- package/dist/conversions/index.d.ts +396 -593
- package/dist/conversions/index.js +1 -1
- package/dist/env/index.d.ts +5 -8
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.ts +80 -77
- package/dist/events/index.js +1 -1
- package/dist/{array-CIZRbqTF.d.ts → extends-Bk_SBGdT.d.ts} +145 -1
- package/dist/formatting/index.cjs +1 -1
- package/dist/formatting/index.d.ts +478 -440
- package/dist/formatting/index.js +1 -1
- package/dist/generator/index.cjs +1 -1
- package/dist/generator/index.d.ts +135 -112
- package/dist/generator/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{is-array-Ckm_47hw.d.ts → is-array--YjXV-Wx.d.ts} +2 -352
- package/dist/{isPlainObject-BKYaI6a8.d.ts → isPlainObject-BVhBAPHX.d.ts} +49 -62
- package/dist/next/index.cjs +6 -6
- package/dist/next/index.d.ts +125 -105
- package/dist/next/index.js +5 -5
- package/dist/next/server/index.cjs +1 -1
- package/dist/next/server/index.d.ts +8 -22
- package/dist/next/server/index.js +1 -1
- package/dist/operations/index.cjs +1 -1
- package/dist/operations/index.d.ts +72 -127
- package/dist/operations/index.js +1 -1
- package/dist/parsers/index.cjs +1 -1
- package/dist/parsers/index.d.ts +26 -27
- package/dist/parsers/index.js +1 -1
- package/dist/predicates/index.cjs +1 -1
- package/dist/predicates/index.d.ts +686 -660
- package/dist/predicates/index.js +1 -1
- package/dist/promise/index.cjs +1 -1
- package/dist/promise/index.d.ts +14 -23
- package/dist/promise/index.js +1 -1
- package/dist/rzl-utils.global.js +3 -3
- package/dist/string-XA-til3C.d.ts +351 -0
- package/dist/strings/index.cjs +1 -1
- package/dist/strings/index.d.ts +301 -376
- package/dist/strings/index.js +1 -1
- package/dist/stylings/index.cjs +1 -1
- package/dist/stylings/index.d.ts +15 -23
- package/dist/stylings/index.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/urls/index.cjs +1 -1
- package/dist/urls/index.d.ts +276 -301
- package/dist/urls/index.js +1 -1
- package/package.json +53 -11
- package/dist/chunk-2TRAPBZ7.cjs +0 -1
- package/dist/chunk-3D74QO5D.cjs +0 -1
- package/dist/chunk-4DK3RCC4.js +0 -2
- package/dist/chunk-4JOQ45HL.js +0 -1
- package/dist/chunk-55CZALRS.js +0 -1
- package/dist/chunk-5JFV3GDE.cjs +0 -4
- package/dist/chunk-62HX5Z45.cjs +0 -1
- package/dist/chunk-7NA6DUHR.cjs +0 -2
- package/dist/chunk-BVPMMWDL.cjs +0 -1
- package/dist/chunk-CEFYHEM4.cjs +0 -1
- package/dist/chunk-CN53M4QZ.cjs +0 -1
- package/dist/chunk-D47MHBSD.cjs +0 -1
- package/dist/chunk-DGH75GJD.js +0 -1
- package/dist/chunk-E5NUI7PN.js +0 -1
- package/dist/chunk-FDITZ5C6.cjs +0 -1
- package/dist/chunk-FSSV24W7.cjs +0 -1
- package/dist/chunk-GCGU2WB7.js +0 -1
- package/dist/chunk-GECI2YBP.js +0 -1
- package/dist/chunk-GQE4OVHC.cjs +0 -1
- package/dist/chunk-GRVZXQXL.cjs +0 -1
- package/dist/chunk-I4AVNHPA.cjs +0 -1
- package/dist/chunk-JFRL7NKU.js +0 -4
- package/dist/chunk-KCQDDZJE.cjs +0 -1
- package/dist/chunk-L54ZPSYJ.js +0 -1
- package/dist/chunk-LVKAYEZ4.js +0 -1
- package/dist/chunk-MBDWTK54.cjs +0 -1
- package/dist/chunk-MNGGDB2G.js +0 -1
- package/dist/chunk-MY7BA4GI.cjs +0 -1
- package/dist/chunk-N2IJPIND.cjs +0 -1
- package/dist/chunk-NIMNTEGV.js +0 -1
- package/dist/chunk-PVJF2JHM.js +0 -1
- package/dist/chunk-QCFXEUKL.js +0 -1
- package/dist/chunk-QFCGBBSY.js +0 -1
- package/dist/chunk-QQYAUPSK.cjs +0 -1
- package/dist/chunk-TC4VBE4Y.cjs +0 -1
- package/dist/chunk-TUXDINHF.cjs +0 -1
- package/dist/chunk-U5Y2FXMN.cjs +0 -1
- package/dist/chunk-UUPQI6ND.cjs +0 -1
- package/dist/chunk-VYCGZ2S6.js +0 -1
- package/dist/chunk-W5EDKJK3.js +0 -1
- package/dist/chunk-WHAVUFEU.js +0 -1
- package/dist/chunk-XCFIOTCV.js +0 -1
- package/dist/chunk-XE27XPJR.js +0 -1
- package/dist/chunk-XVB3ZZEB.js +0 -1
- package/dist/chunk-ZBSIGJFO.cjs +0 -1
- package/dist/chunk-ZYAML74V.js +0 -1
- package/dist/extends-Mp81Hq9-.d.ts +0 -145
package/dist/chunk-ZBSIGJFO.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkJWHM3WZQ_cjs=require('./chunk-JWHM3WZQ.cjs'),chunkFDITZ5C6_cjs=require('./chunk-FDITZ5C6.cjs'),chunkN2IJPIND_cjs=require('./chunk-N2IJPIND.cjs'),chunk2TRAPBZ7_cjs=require('./chunk-2TRAPBZ7.cjs'),chunkBVPMMWDL_cjs=require('./chunk-BVPMMWDL.cjs'),chunkPUQXRLZH_cjs=require('./chunk-PUQXRLZH.cjs'),chunkU5Y2FXMN_cjs=require('./chunk-U5Y2FXMN.cjs'),chunkCN53M4QZ_cjs=require('./chunk-CN53M4QZ.cjs'),locale=require('date-fns/locale'),dateFns=require('date-fns');var le=(r,e={})=>{if(!chunkCN53M4QZ_cjs.h(r)&&!chunkFDITZ5C6_cjs.a(r))throw new TypeError(`First parameter (\`value\`) must be of type \`string\` or \`primitive-number\`, but received: \`${chunkCN53M4QZ_cjs.E(r)}\`, with value: ${chunkU5Y2FXMN_cjs.c(r)}.`);chunkCN53M4QZ_cjs.m(e,{message:({currentType:a,validType:S})=>`Second parameter (\`options\`) must be of type \`${S}\`, but received: \`${a}\`.`});let t=chunkCN53M4QZ_cjs.o(e,"decimal")?e.decimal:false,o=chunkCN53M4QZ_cjs.o(e,"totalDecimal")?e.totalDecimal:2,i=chunkCN53M4QZ_cjs.o(e,"endDecimal")?e.endDecimal:true,d=chunkCN53M4QZ_cjs.o(e,"indianFormat")?e.indianFormat:false,p=chunkCN53M4QZ_cjs.o(e,"suffixCurrency")?e.suffixCurrency:"",f=chunkCN53M4QZ_cjs.o(e,"suffixDecimal")?e.suffixDecimal:"",m=chunkCN53M4QZ_cjs.o(e,"roundedDecimal")?e.roundedDecimal:"round",n=chunkCN53M4QZ_cjs.o(e,"negativeFormat")?e.negativeFormat:"dash",u=chunkCN53M4QZ_cjs.o(e,"separatorDecimals")?e.separatorDecimals:",",y=chunkCN53M4QZ_cjs.o(e,"separator")?e.separator:".";if(!chunkCN53M4QZ_cjs.h(y)||!chunkCN53M4QZ_cjs.h(u)||!chunkCN53M4QZ_cjs.h(p)||!chunkCN53M4QZ_cjs.h(f))throw new TypeError(`Parameter \`separator\`, \`separatorDecimals\`, \`suffixCurrency\` and \`suffixDecimal\` property of the \`options\` (second parameter) must be of type \`string\`, but received: ['separator': \`${chunkCN53M4QZ_cjs.E(y)}\`, 'separatorDecimals': \`${chunkCN53M4QZ_cjs.E(u)}\`, 'suffixCurrency': \`${chunkCN53M4QZ_cjs.E(p)}\`, 'suffixDecimal': \`${chunkCN53M4QZ_cjs.E(f)}\`].`);if(!chunkCN53M4QZ_cjs.a(t)||!chunkCN53M4QZ_cjs.a(i)||!chunkCN53M4QZ_cjs.a(d))throw new TypeError(`Parameter \`decimal\`, \`endDecimal\` and \`indianFormat\` property of the \`options\` (second parameter) must be of type \`boolean\`, but received: ['decimal': \`${chunkCN53M4QZ_cjs.E(t)}\`, 'endDecimal': \`${chunkCN53M4QZ_cjs.E(i)}\`, 'indianFormat': \`${chunkCN53M4QZ_cjs.E(d)}\`].`);if(!chunkPUQXRLZH_cjs.a(o))throw new TypeError(`Parameter \`totalDecimal\` property of the \`options\` (second parameter) must be of type \`integer-number\`, but received: \`${chunkCN53M4QZ_cjs.E(o)}\`, with value: \`${chunkU5Y2FXMN_cjs.c(length)}\`.`);if(!(m===false||m==="round"||m==="ceil"||m==="floor"))throw new TypeError(`Parameter \`roundedDecimal\` property of the \`options\` (second parameter) must be of type \`false\` or \`string\` must be one of "round" | "ceil" | "floor", but received: \`${chunkCN53M4QZ_cjs.E(m)}\`, with value: ${chunkU5Y2FXMN_cjs.c(m)}.`);if(!(n==="abs"||n==="brackets"||n==="dash"||chunkCN53M4QZ_cjs.f(n)))throw new TypeError(`Parameter \`negativeFormat\` property of the \`options\` (second parameter) must be of type \`string\` must be one of "abs" | "brackets" | "dash" or \`plain-object\` type, but received: \`${chunkCN53M4QZ_cjs.E(n)}\`, with value: ${chunkU5Y2FXMN_cjs.c(n)}.`);let P=chunkCN53M4QZ_cjs.h(r)?chunkJWHM3WZQ_cjs.a(r):r;if(chunkCN53M4QZ_cjs.n(P))throw new TypeError("First parameter (`value`) could not be parsed into a valid `number`.");let h=Math.abs(P),w=Math.pow(10,o);if(m){let a=h*w;switch(m){case "round":h=Math.round(a)/w;break;case "ceil":h=Math.ceil(a)/w;break;case "floor":h=Math.floor(a)/w;break}}let g="",b="";if(m){let a=h*w;switch(m){case "round":h=Math.round(a)/w;break;case "ceil":h=Math.ceil(a)/w;break;case "floor":h=Math.floor(a)/w;break}}if(m)[g,b]=h.toFixed(o).split("."),b=b??"".padEnd(o,"0");else {let a=String(h).split(".");g=a[0],b=(a[1]||"").slice(0,o).padEnd(o,"0");}let $,x=(a,S)=>{let O=a.slice(-3),C=a.slice(0,-3);return C?C.replace(/\B(?=(\d{2})+(?!\d))/g,S)+S+O:O};if(d?(y=",",u=".",$=(p.trim().length?p:"")+x(g,y)):$=(p.trim().length?p:"")+g.replace(/\B(?=(\d{3})+(?!\d))/g,y),t&&!chunkCN53M4QZ_cjs.k(b)&&o>0){let a=u+b;i&&(a+=f),$+=a;}if(P<0){if(n==="dash")$="-"+$;else if(n==="brackets")$="("+$+")";else if(n!=="abs"){if(chunkCN53M4QZ_cjs.f(n))if(chunkCN53M4QZ_cjs.o(n,"custom")){let a=n.custom;if(!chunkCN53M4QZ_cjs.b(a))throw new TypeError(`Parameter \`negativeFormat.custom\` property of the \`options\` (second parameter) must be of type function: \`(formatted: string) => string\`, but received: \`${chunkCN53M4QZ_cjs.E(a)}\`.`);let S=a($);chunkBVPMMWDL_cjs.a(S,{message:({currentType:O,validType:C})=>`Parameter \`negativeFormat.custom\` property of the \`options\` (second parameter) expected return a \`${C}\` type value, but received: \`${O}\`.`}),$=S;}else {let a=n.style||"dash",S=chunkCN53M4QZ_cjs.a(n.space)?n.space:false;if(chunkCN53M4QZ_cjs.G(S,{message:({currentType:O,validType:C})=>`Parameter \`negativeFormat.space\` property of the \`options\` (second parameter) must be of type \`${C}\`, but received: \`${O}\`.`}),!(a==="abs"||a==="brackets"||a==="dash"))throw new TypeError(`Parameter \`negativeFormat.style\` property of the \`options\` (second parameter) must be of type \`string\` must be of type "abs" | "brackets" | "dash", but received: \`${chunkCN53M4QZ_cjs.E(a)}\`, with value: ${chunkU5Y2FXMN_cjs.c(a)}.`);switch(a){case "dash":$="-"+(S?" ":"")+$;break;case "brackets":$=S?`( ${$} )`:`(${$})`;break;}}}}return $};var de=(r,e=",")=>{if(!chunkCN53M4QZ_cjs.h(r)&&!chunkFDITZ5C6_cjs.a(r))throw new TypeError(`First parameter (\`value\`) must be of type \`string\` or \`primitive number\`, but received: \`${chunkCN53M4QZ_cjs.E(r)}\`.`);if(!chunkCN53M4QZ_cjs.h(e))throw new TypeError(`Second parameter (\`separator\`) must be of type \`string\` or empty as \`undefined\`, but received: \`${chunkCN53M4QZ_cjs.E(e)}\`.`);e=chunkCN53M4QZ_cjs.h(e)?e:",";let t=e==="."?",":".",o=r.toString().trim(),i=o.lastIndexOf("."),d=o.lastIndexOf(","),p="";i>d?p=".":d>i&&(p=",");let f=o,m="";if(p){let u=o.split(p);f=u.slice(0,-1).join(p),m=u.slice(-1)[0];}f=f.replace(/[^\d]/g,"");let n=f.replace(/\B(?=(\d{3})+(?!\d))/g,e);return m?`${n}${t}${m}`:n};function De(r,e={}){if(chunkCN53M4QZ_cjs.c(r))return "";if(!chunkCN53M4QZ_cjs.h(r)&&!chunkCN53M4QZ_cjs.i(r))throw new TypeError(`First parameter (\`value\`) must be of type \`string\`, \`number\`, \`null\` or \`undefined\`, but received: \`${chunkCN53M4QZ_cjs.E(r)}\`.`);chunkCN53M4QZ_cjs.m(e,{message:({currentType:x,validType:a})=>`Second parameter (\`options\`) must be of type \`${a}\`, but received: \`${x}\`.`});let t=chunkCN53M4QZ_cjs.o(e,"separator")?e.separator:" ",o=chunkCN53M4QZ_cjs.o(e,"takeNumberOnly")?e.takeNumberOnly:false,i=chunkCN53M4QZ_cjs.o(e,"checkValidOnly")?e.checkValidOnly:false,d=chunkCN53M4QZ_cjs.o(e,"plusNumberCountry")?e.plusNumberCountry:"",p=chunkCN53M4QZ_cjs.o(e,"openingNumberCountry")?e.openingNumberCountry:"",f=chunkCN53M4QZ_cjs.o(e,"closingNumberCountry")?e.closingNumberCountry:"";if(!chunkCN53M4QZ_cjs.a(o)||!chunkCN53M4QZ_cjs.a(i))throw new TypeError(`Parameter \`takeNumberOnly\` and \`checkValidOnly\` property of the \`options\` (second parameter) must be of type \`boolean\` or unset as \`undefined\` value, but received: ['takeNumberOnly': \`${chunkCN53M4QZ_cjs.E(o)}\`, 'checkValidOnly': \`${chunkCN53M4QZ_cjs.E(i)}\`].`);if(!chunkCN53M4QZ_cjs.h(t)||!chunkCN53M4QZ_cjs.h(d)||!chunkCN53M4QZ_cjs.h(p)||!chunkCN53M4QZ_cjs.h(f))throw new TypeError(`Parameter \`separator\`, \`plusNumberCountry\`, \`openingNumberCountry\` and \`closingNumberCountry\` property of the \`options\` (second parameter) must be of type \`string\` or unset as \`undefined\` value, but received: ['separator': \`${chunkCN53M4QZ_cjs.E(t)}\`, 'plusNumberCountry': \`${chunkCN53M4QZ_cjs.E(d)}\`, 'openingNumberCountry': \`${chunkCN53M4QZ_cjs.E(p)}\`, 'closingNumberCountry': \`${chunkCN53M4QZ_cjs.E(f)}\`].`);if(chunkCN53M4QZ_cjs.h(r)||(r=String(r)),o)return r.replace(/\D/g,"");if(i)return /^(\+)?[0-9\s().-]+$/.test(r)&&r.replace(/\D/g,"").length<24;r=r.replace(/\D/g,"");let m=d.trim().replace(/\s+/g,"").replace(/[^\d+]/g,"");/^\+/.test(m)&&(m="+"+m.replace(/^\++/,""));let n="",u="",y={7:"Russia, Kazakhstan",27:"South Africa",31:"Netherlands",32:"Belgium",33:"France",34:"Spain",36:"Hungary",39:"Italy, San Marino, Vatican",44:"United Kingdom",46:"Sweden",47:"Norway",48:"Poland",49:"Germany",52:"Mexico",54:"Argentina",55:"Brazil",56:"Chile",61:"Australia",62:"Indonesia",64:"New Zealand",81:"Japan",82:"South Korea",86:"China",90:"Turkey",91:"India",92:"Pakistan",351:"Portugal",352:"Luxembourg",971:"UAE"},P=m.replace(/^\+/,"").replace(/[^\d]/g,"");y[P]&&r.startsWith("0")?(n=r.slice(1,4),u=r.slice(4)):(n=r.slice(0,4),u=r.slice(4));let h=m.trim(),w=p.trim(),g=f.trim(),b="";h?w&&g?b=`${w}${h}${g} ${n}`:w&&!g?b=`${w}${h} ${n}`:!w&&g?b=`${h}${g} ${n}`:b=`${h} ${n}`:b=`${n}`;let $={0:t,4:t,8:t,12:t,16:t,20:t,24:t};for(let x=0;x<u.length;x++){let a=x+n.length;b+=($[a]||"")+u[x];}return b}var Ie=(r,e="YYYY-MM-DD hh:mm:ss")=>{if(!chunkCN53M4QZ_cjs.h(e)||!r||!(dateFns.isDate(r)||chunkCN53M4QZ_cjs.h(r)))return null;try{let t=new Date(r);if(chunkCN53M4QZ_cjs.n(t.getTime()))return null;let o=p=>p.toString().padStart(2,"0"),i={YYYY:t.getFullYear().toString(),MM:o(t.getMonth()+1),DD:o(t.getDate()),hh:o(t.getHours()),mm:o(t.getMinutes()),ss:o(t.getSeconds())},d=Object.entries(i).reduce((p,[f,m])=>p.split(f).join(m),e);return d.includes("NaN")?null:d}catch{return null}},Me=(r,e)=>{if(!r||!(dateFns.isDate(r)||chunkCN53M4QZ_cjs.h(r)))return null;let t=new Date(r);if(chunkCN53M4QZ_cjs.n(t.getTime()))return null;chunkCN53M4QZ_cjs.f(e)||(e={});let{locale:o="en-US",...i}=e;try{return new Intl.DateTimeFormat(o?.toString()?.trim()?.length?o:"en-US",i).format(t)}catch{return null}},Le=(r,e)=>{if(!r||!(dateFns.isDate(r)||chunkCN53M4QZ_cjs.h(r)))return null;chunkCN53M4QZ_cjs.f(e)||(e={});let{inputFormat:t,locale:o,inputLocale:i,...d}=e,p=chunkCN53M4QZ_cjs.o(e,"format")&&chunkCN53M4QZ_cjs.p(e.format)?e.format:"dd MMM yyyy - HH:mm:ss",f;try{if(chunkCN53M4QZ_cjs.h(r)&&t&&i){let n=chunkCN53M4QZ_cjs.h(i)?i==="id"?locale.id:locale.enUS:i;f=dateFns.parse(r,t,new Date,{locale:n});}else f=new Date(r);if(chunkCN53M4QZ_cjs.n(f.getTime()))return null;let m=chunkCN53M4QZ_cjs.h(o)?o==="id"?locale.id:locale.enUS:o;return dateFns.format(f,p,{...d,locale:m})}catch{return null}},Ae=r=>{try{if(!r||chunkCN53M4QZ_cjs.h(r)&&chunk2TRAPBZ7_cjs.a(r))r=new Date;else if(!(dateFns.isDate(r)||chunkCN53M4QZ_cjs.h(r)))return "0";let e=new Date(r);if(chunkCN53M4QZ_cjs.n(e.getTime()))return "0";let t=d=>d.toString().padStart(2,"0"),o=e.getTimezoneOffset(),i=o<0?"+":"-";return o=Math.abs(o),`${i}${t(Math.floor(o/60))}${t(o%60)}`}catch{return "0"}};var Ge=(r,e={})=>{if(!chunkCN53M4QZ_cjs.p(r))return "";chunkCN53M4QZ_cjs.m(e,{message:({currentType:g,validType:b})=>`Second parameter (\`options\`) must be of type \`${b}\`, but received: \`${g}\`.`});let t=chunkCN53M4QZ_cjs.o(e,"mode")?e.mode:"fixed";if(t!=="random"&&t!=="fixed")throw new TypeError(`Parameter \`mode\` property of the \`options\` (second parameter) must be one of "fixed" or "random", but received: \`${chunkCN53M4QZ_cjs.E(t)}\`, with value: ${chunkU5Y2FXMN_cjs.c(t)}.`);if(!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(r))return "";let[i,d]=r.split("@"),p=d.split(".");if(p.length<2)return "";let[f,...m]=p,n=m.join("."),u=t==="fixed"?(()=>{let g=0;for(let b=0;b<r.length;b++)g=(g<<5)-g+r.charCodeAt(b),g|=0;return Math.abs(g)})():void 0,y=(g,b,$)=>{if(g.length<=b)return "*".repeat(g.length);let x=g.split(""),a=Math.max(b,Math.ceil(g.length*$)),S=new Set,O=0;for(;S.size<a;){let C=chunkCN53M4QZ_cjs.k(u)?Math.floor(Math.random()*g.length):(u+g.length+O*31)%g.length;S.add(C),O++;}for(let C of S)x[C]="*";return x.join("")},P=y(i,i.length<4?1:2,.6),h=y(f,f.length<4?1:2,.5),w=n.length<=2?n:y(n,1,.4);return `${P}@${h}.${w}`};function tr(r,e,t={}){if(chunkCN53M4QZ_cjs.c(r)||e<=0)return r;if(chunkBVPMMWDL_cjs.a(r,{message:({currentType:n,validType:u})=>`First parameter (\`subject\`) must be of type \`${u}\`, but received: \`${n}\`.`}),!chunkPUQXRLZH_cjs.a(e))throw new TypeError(`Second parameter (\`limiter\`) must be of type \`integer-number\`, but received: \`${chunkCN53M4QZ_cjs.E(e)}\`, with value: \`${chunkU5Y2FXMN_cjs.c(e)}\`.`);chunkCN53M4QZ_cjs.m(t,{message:({currentType:n,validType:u})=>`Third parameter (\`options\`) must be of type \`${u}\`, but received: \`${n}\`.`});let o=chunkCN53M4QZ_cjs.o(t,"separator")?t.separator:" ",i=chunkCN53M4QZ_cjs.o(t,"reCountAfterSpace")?t.reCountAfterSpace:false;if(!(chunkCN53M4QZ_cjs.h(o)&&chunkCN53M4QZ_cjs.a(i)))throw new TypeError(`Invalid properties type \`options\` (third parameter), \`separator\` must be of type \`string\`, and \`reCountAfterSpace\` must be of type \`boolean\`, but received: ['separator': \`${chunkCN53M4QZ_cjs.E(o)}\`, 'reCountAfterSpace': \`${chunkCN53M4QZ_cjs.E(i)}\`].`);if(r=chunkN2IJPIND_cjs.a(r),!i){let n="",u=0;for(let y=0;y<r.length;y++){let P=r[y];u===e&&(n+=o,u=0),n+=P,u++;}return n}let d=r.split(" "),p=[],f=[],m=0;for(let n=0;n<d.length;n++){let u=d[n],y="",P=0;for(let h=0;h<u.length;h++)y+=u[h],P++,P===e&&h<u.length-1&&(y+=o,P=0);f.push(y),m++,(m===e||n===d.length-1)&&(p.push(f.join(o)),f=[],m=0);}return p.join(" ")}var ur=(r,e={})=>{if(!chunkCN53M4QZ_cjs.p(r))return "";chunkCN53M4QZ_cjs.m(e,{message:({currentType:n,validType:u})=>`Seconds parameter (\`options\`) must be of type \`${u}\`, but received: \`${n}\`.`});let t=chunkCN53M4QZ_cjs.o(e,"length")?e.length:10,o=chunkCN53M4QZ_cjs.o(e,"trim")?e.trim:true,i=chunkCN53M4QZ_cjs.o(e,"ending")?e.ending:"...";if(!chunkPUQXRLZH_cjs.a(t))throw new TypeError(`Invalid \`options\` (third parameter) properties: \`length\` must be of type \`integer number\`, but received: \`${chunkCN53M4QZ_cjs.E(t)}\`, with value: \`${chunkU5Y2FXMN_cjs.c(t)}\`.`);if(t<1)return "";if(!(chunkCN53M4QZ_cjs.h(i)&&chunkCN53M4QZ_cjs.a(o)))throw new TypeError(`Invalid \`options\` (third parameter) properties: \`ending\` must be a string, and \`trim\` must be a boolean. Received types: ['ending': \`${chunkCN53M4QZ_cjs.E(i)}\`, 'trim': \`${chunkCN53M4QZ_cjs.E(o)}\`].`);chunk2TRAPBZ7_cjs.a(i)?i="...":i=i.trim();let d=o?r.trim():r;if(d.length<=t)return d;let f=d.slice(0,t);return (o?f:f.trimEnd())+i};exports.a=le;exports.b=de;exports.c=De;exports.d=Ie;exports.e=Me;exports.f=Le;exports.g=Ae;exports.h=Ge;exports.i=tr;exports.j=ur;
|
package/dist/chunk-ZYAML74V.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {e,f as f$1}from'./chunk-W5EDKJK3.js';import {a}from'./chunk-NIMNTEGV.js';import {f,c,n,h,d,e as e$1,o}from'./chunk-XCFIOTCV.js';var g=(r,m={})=>{if(f(m)||(m={}),c(r)||r===false||n(r))return true;if(h(r))return a(r);if(d(r))return e(r);if(e$1(r)){let b=o(m,"checkSymbols")?m.checkSymbols:false;return f$1(r,{checkSymbols:b})}return false};export{g as a};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import{I as IsEmptyArray}from'./array-CIZRbqTF.js';import{I as If}from'./if-CvT4R7Kh.js';
|
|
2
|
-
/** -------------------------------------------------------
|
|
3
|
-
* * ***Not.***
|
|
4
|
-
* -------------------------------------------------------
|
|
5
|
-
* Accepts a boolean type `T` and returns its negation.
|
|
6
|
-
*
|
|
7
|
-
* @template T - Boolean type to negate.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* type A = Not<true>; // ➔ false
|
|
12
|
-
* type B = Not<false>; // ➔ true
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
type Not<T extends boolean>=T extends true?false:true;
|
|
16
|
-
/** -------------------------------------------------------
|
|
17
|
-
* * ***PopOptions.***
|
|
18
|
-
* -------------------------------------------------------
|
|
19
|
-
*
|
|
20
|
-
* Configuration options for the {@link Pop} type utility.
|
|
21
|
-
*/
|
|
22
|
-
type PopOptions={
|
|
23
|
-
/**
|
|
24
|
-
* If `true`, {@link Pop} will return a tuple `[Rest, Removed]`
|
|
25
|
-
* instead of just the remaining array.
|
|
26
|
-
*
|
|
27
|
-
* Default: `false`.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* type Options = { includeRemoved: true };
|
|
32
|
-
* type Result = Pop<[1, 2, 3], Options>; // ➔ [[1, 2], 3]
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
includeRemoved:boolean;};
|
|
36
|
-
/** -------------------------------------------------------
|
|
37
|
-
* * ***Pop.***
|
|
38
|
-
* -------------------------------------------------------
|
|
39
|
-
*
|
|
40
|
-
* Removes the last element from a tuple/array type.
|
|
41
|
-
*
|
|
42
|
-
* If the `includeRemoved` option is `true`, it returns a tuple `[Rest, Removed]`
|
|
43
|
-
* where `Rest` is the array without the last element, and `Removed` is the last element.
|
|
44
|
-
*
|
|
45
|
-
* @template T - The tuple or array to pop from.
|
|
46
|
-
* @template Options - Configuration object. Default `{ includeRemoved: false }`.
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```ts
|
|
50
|
-
* // Removes last element
|
|
51
|
-
* type Case1 = Pop<[1, 2, 3]>
|
|
52
|
-
* // ➔ [1, 2]
|
|
53
|
-
*
|
|
54
|
-
* // Removes last element and includes the removed value
|
|
55
|
-
* type Case2 = Pop<[1, 2, 3], { includeRemoved: true }>
|
|
56
|
-
* // ➔ [[1, 2], 3]
|
|
57
|
-
*
|
|
58
|
-
* // Edge case: empty array
|
|
59
|
-
* type Case3 = Pop<[]>
|
|
60
|
-
* // ➔ never
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
type Pop<T extends readonly unknown[],Options extends PopOptions={includeRemoved:false;}>=IsEmptyArray<T>extends true?never:T extends readonly [...infer Rest extends readonly unknown[],infer Removed]?If<Options["includeRemoved"],[Rest,Removed],Rest>:never;
|
|
64
|
-
/** -------------------------------------------------------
|
|
65
|
-
* * ***Extends.***
|
|
66
|
-
* -------------------------------------------------------
|
|
67
|
-
* Returns a boolean indicating whether the first argument ***extends*** the second argument.
|
|
68
|
-
*
|
|
69
|
-
* @template T - The type to check.
|
|
70
|
-
* @template Base - The type to compare against.
|
|
71
|
-
* @example
|
|
72
|
-
* ```ts
|
|
73
|
-
* type A = Extends<1, number>; // ➔ true
|
|
74
|
-
* type B = Extends<number, 1>; // ➔ false
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
type Extends<T,Base>=[T] extends [Base]?true:false;
|
|
78
|
-
/** -------------------------------------------------------
|
|
79
|
-
* * ***NotExtends.***
|
|
80
|
-
* -------------------------------------------------------
|
|
81
|
-
* Returns a boolean indicating whether the first argument does ***not extend*** the second argument.
|
|
82
|
-
*
|
|
83
|
-
* @template T - The type to check.
|
|
84
|
-
* @template Base - The type to compare against.
|
|
85
|
-
* @example
|
|
86
|
-
* ```ts
|
|
87
|
-
* type A = NotExtends<1, number>; // ➔ false
|
|
88
|
-
* type B = NotExtends<number, 1>; // ➔ true
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
type NotExtends<T,Base>=Not<Extends<T,Base>>;
|
|
92
|
-
/** -------------------------------------------------------
|
|
93
|
-
* * ***IfExtends.***
|
|
94
|
-
* -------------------------------------------------------
|
|
95
|
-
* Conditional: returns the third argument if the first argument ***extends*** the second argument, otherwise returns the fourth argument.
|
|
96
|
-
* - Defaults: `IfTrue = true`, `IfFalse = false`.
|
|
97
|
-
*
|
|
98
|
-
* @template T - The type to check.
|
|
99
|
-
* @template Base - The type to compare against.
|
|
100
|
-
* @template IfTrue - The branch type if condition is met. (default: `true`)
|
|
101
|
-
* @template IfFalse - The branch type if condition is not met. (default: `false`)
|
|
102
|
-
* @example
|
|
103
|
-
* ```ts
|
|
104
|
-
* type A = IfExtends<1, number, "valid">;
|
|
105
|
-
* // ➔ "valid"
|
|
106
|
-
* type B = IfExtends<1, string, "valid", "invalid">;
|
|
107
|
-
* // ➔ "invalid"
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
type IfExtends<T,Base,IfTrue=true,IfFalse=false>=If<Extends<T,Base>,IfTrue,IfFalse>;
|
|
111
|
-
/** -------------------------------------------------------
|
|
112
|
-
* * ***IfNotExtends.***
|
|
113
|
-
* -------------------------------------------------------
|
|
114
|
-
* Conditional: returns the third argument if the first argument does ***not extend*** the second argument, otherwise returns the fourth argument.
|
|
115
|
-
* - Defaults: `IfTrue = true`, `IfFalse = false`.
|
|
116
|
-
*
|
|
117
|
-
* @template T - The type to check.
|
|
118
|
-
* @template Base - The type to compare against.
|
|
119
|
-
* @template IfTrue - The branch type if condition is met. (default: `true`)
|
|
120
|
-
* @template IfFalse - The branch type if condition is not met. (default: `false`)
|
|
121
|
-
* @example
|
|
122
|
-
* ```ts
|
|
123
|
-
* type A = IfNotExtends<1, string, "valid">;
|
|
124
|
-
* // ➔ "valid"
|
|
125
|
-
* type B = IfNotExtends<1, number, "valid", "invalid">;
|
|
126
|
-
* // ➔ "invalid"
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
type IfNotExtends<T,Base,IfTrue=true,IfFalse=false>=If<NotExtends<T,Base>,IfTrue,IfFalse>;
|
|
130
|
-
/** -------------------------------------------------------
|
|
131
|
-
* * ***ExtendsArr.***
|
|
132
|
-
* -------------------------------------------------------
|
|
133
|
-
* Returns a boolean indicating whether every element of the first array argument ***extends*** the second argument.
|
|
134
|
-
*
|
|
135
|
-
* @template T - The array to check.
|
|
136
|
-
* @template Base - The type to compare each element against.
|
|
137
|
-
* @example
|
|
138
|
-
* ```ts
|
|
139
|
-
* type A = ExtendsArr<[1, 2, 3], number>;
|
|
140
|
-
* // ➔ true
|
|
141
|
-
* type B = ExtendsArr<[1, "2", 3], number>;
|
|
142
|
-
* // ➔ false
|
|
143
|
-
* ```
|
|
144
|
-
*/
|
|
145
|
-
type ExtendsArr<T extends readonly unknown[],Base>=IsEmptyArray<T>extends true?true:Pop<T,{includeRemoved:true;}>extends readonly [infer Rest extends readonly unknown[],infer Removed]?Extends<Removed,Base>extends true?ExtendsArr<Rest,Base>:false:false;export type{Extends as E,IfExtends as I,Not as N,Pop as P,NotExtends as a,ExtendsArr as b,IfNotExtends as c,PopOptions as d};
|