Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bellajs

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bellajs - npm Package Compare versions

Comparing version 10.0.2 to 11.0.0-rc1

build.js

4

dist/bella.min.js

@@ -1,2 +0,2 @@

// bellajs@10.0.2, by @ndaidong - built on Thu, 02 Dec 2021 14:08:28 GMT - published under MIT license
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bella={})}(this,(function(e){const t=e=>({}.toString.call(e)),r=e=>Array.isArray(e),n=e=>String(e)===e,o=e=>Number(e)===e,a=e=>"[object Null]"===t(e),i=e=>"[object Undefined]"===t(e),l=e=>i(e)||a(e),s=e=>"[object Object]"===t(e)&&!r(e),c=e=>e instanceof Date&&!isNaN(e.valueOf()),u=e=>!e||l(e)||n(e)&&""===e||r(e)&&0===e.length||s(e)&&0===Object.keys(e).length,g=(e,t)=>!(!e||!t)&&Object.prototype.hasOwnProperty.call(e,t),f=(e,t)=>{if(u(e)&&u(t))return!0;if(c(e)&&c(t))return e.getTime()===t.getTime();if(r(e)&&r(t)){if(e.length!==t.length)return!1;let r=!0;for(let n=0;n<e.length;n++)if(!f(e[n],t[n])){r=!1;break}return r}if(s(e)&&s(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;let r=!0;for(const n in e)if(!g(t,n)||!f(e[n],t[n])){r=!1;break}return r}return e===t},p=Number.MAX_SAFE_INTEGER,h=(e,t)=>{if((!e||e<0)&&(e=0),t||(t=p),e===t)return t;e>t&&(e=Math.min(e,t),t=Math.max(e,t));const r=e,n=t-e+1;return Math.floor(Math.random()*n)+r},d=e=>{const t=o(e)?String(e):e;if(!n(t))throw new Error("InvalidInput: String required.");return t},m=e=>{const t=d(e).toLowerCase();return t.length>1?t.charAt(0).toUpperCase()+t.slice(1):t.toUpperCase()},b=(e,t,a)=>{let i=d(e);if(o(t)&&(t=String(t)),o(a)&&(a=String(a)),n(t)&&n(a)){const e=i.split(t);i=e.join(a)}else if(r(t)&&n(a))t.forEach((e=>{i=b(i,e,a)}));else if(r(t)&&r(a)&&t.length===a.length){const e=t.length;if(e>0)for(let r=0;r<e;r++){const e=t[r],n=a[r];i=b(i,e,n)}}return i},y=e=>{let t=d(e);const r={a:"á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ|ä",A:"Á|À|Ả|Ã|Ạ|Ă|Ắ|Ặ|Ằ|Ẳ|Ẵ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ|Ä",c:"ç",C:"Ç",d:"đ",D:"Đ",e:"é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ|ë",E:"É|È|Ẻ|Ẽ|Ẹ|Ê|Ế|Ề|Ể|Ễ|Ệ|Ë",i:"í|ì|ỉ|ĩ|ị|ï|î",I:"Í|Ì|Ỉ|Ĩ|Ị|Ï|Î",o:"ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ|ö",O:"Ó|Ò|Ỏ|Õ|Ọ|Ô|Ố|Ồ|Ổ|Ô|Ộ|Ơ|Ớ|Ờ|Ở|Ỡ|Ợ|Ö",u:"ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự|û",U:"Ú|Ù|Ủ|Ũ|Ụ|Ư|Ứ|Ừ|Ử|Ữ|Ự|Û",y:"ý|ỳ|ỷ|ỹ|ỵ",Y:"Ý|Ỳ|Ỷ|Ỹ|Ỵ"},n=(e,r)=>{t=b(t,e,r)};for(const e in r)if(g(r,e)){r[e].split("|").forEach((t=>n(t,e)))}return t},w=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],M=["January","February","March","April","May","June","July","August","September","October","November","December"],j=()=>new Date,D=()=>Date.now(),S=j().getTimezoneOffset(),N=(()=>{const e=Math.abs(S/60);return["GMT",S<0?"+":"-",String(e).padStart(4,"0")].join("")})(),O=e=>String(e<10?"0"+e:e),A=(e,t="D, M d, Y h:i:s A")=>{const r=c(e)?e:new Date(e);if(!c(r))throw new Error("InvalidInput: Number or Date required.");const n=t.includes("a")||t.includes("A"),o=w,a=M,i={Y:()=>r.getFullYear(),y:()=>(i.Y()+"").slice(-2),F:()=>a[i.n()-1],M:()=>(i.F()+"").slice(0,3),m:()=>O(i.n()),n:()=>r.getMonth()+1,S:()=>(e=>{let t=e+" ";const r=t.charAt(t.length-2);return t="1"===r?"st":"2"===r?"nd":"3"===r?"rd":"th",t})(i.j()),j:()=>r.getDate(),d:()=>O(i.j()),t:()=>new Date(i.Y(),i.n(),0).getDate(),w:()=>r.getDay(),l:()=>o[i.w()],D:()=>(i.l()+"").slice(0,3),G:()=>r.getHours(),g:()=>i.G()%12||12,h:()=>O(n?i.g():i.G()),i:()=>O(r.getMinutes()),s:()=>O(r.getSeconds()),a:()=>i.G()>11?"pm":"am",A:()=>i.a().toUpperCase(),O:()=>N};return t.replace(/\.*\\?([a-z])/gi,((e,t)=>i[e]?i[e]():t))};const I=(e,t,r,n={})=>{const{writable:o=!1,configurable:a=!1,enumerable:i=!1}=n;Object.defineProperty(e,t,{value:r,writable:o,configurable:a,enumerable:i})},v=e=>{const t=e,r=()=>null==t,n=Object.create({});return I(n,"__value__",t,{enumerable:!0}),I(n,"__type__","Maybe",{enumerable:!0}),I(n,"isNil",r),I(n,"value",(()=>t)),I(n,"map",(e=>v(r()?null:e(t)))),I(n,"if",(e=>v(!0===e(t)?t:null))),I(n,"else",(e=>v(t||e()))),n},T=(e,t=null)=>{const n=t||new Set;if(n.has(e))return e;if(n.add(e),c(e))return new Date(e.valueOf());const o=e=>{const t=Object.create({});for(const r in e)g(e,r)&&(t[r]=T(e[r],n));return t},a=e=>[...e].map((e=>r(e)?a(e):s(e)?o(e):T(e,n)));return r(e)?a(e):s(e)?o(e):e},E=(e,t,n=!1,o=[])=>{for(const a in e)if(!(o.length>0&&o.includes(a))&&(!n||n&&g(t,a))){const i=e[a],l=t[a];s(l)&&s(i)||r(l)&&r(i)?t[a]=E(i,t[a],n,o):t[a]=T(i)}return t},_=(e,t)=>e>t?1:e<t?-1:0,q=(e=[],t=null)=>{const r=[...e],n=t||_;return r.sort(n),r},C=(e=[])=>{const t=[...e],r=[];let n=t.length;for(;n>0;){const e=Math.floor(Math.random()*n);r.push(t.splice(e,1)[0]),n--}return r};e.clone=T,e.compose=(...e)=>e.reduce(((e,t)=>r=>e(t(r)))),e.copies=E,e.curry=e=>{const t=e.length,r=(t,n)=>t>0?(...e)=>r(t-e.length,[...n,...e]):e(...n);return r(t,[])},e.equals=f,e.escapeHTML=e=>d(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),e.genid=(e,t="")=>{const r="abcdefghijklmnopqrstuvwxyz",n=r.toUpperCase(),o=[r,n,"0123456789"].join("").split("").sort((()=>Math.random()>.5)).join(""),a=o.length,i=Math.max(e||32,t.length);let l=t;for(;l.length<i;){const e=h(0,a);l+=o.charAt(e)||""}return l},e.hasProperty=g,e.isArray=r,e.isBoolean=e=>Boolean(e)===e,e.isDate=c,e.isElement=e=>null!==t(e).match(/^\[object HTML\w*Element]$/),e.isEmail=e=>n(e)&&/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(e),e.isEmpty=u,e.isFunction=e=>"[object Function]"===t(e),e.isInteger=e=>Number.isInteger(e),e.isLetter=e=>n(e)&&/^[a-z]+$/i.test(e),e.isNil=l,e.isNull=a,e.isNumber=o,e.isObject=s,e.isString=n,e.isUndefined=i,e.maybe=v,e.md5=e=>{for(var t=[],r=0;r<64;)t[r]=0|4294967296*Math.abs(Math.sin(++r));for(var n,o,a,i,l=[],s=decodeURIComponent(encodeURI(e)),c=s.length,u=[n=1732584193,o=-271733879,~n,~o],g=0;g<=c;)l[g>>2]|=(s.charCodeAt(g)||128)<<g++%4*8;for(l[e=16*(c+8>>6)+14]=8*c,g=0;g<e;g+=16){for(c=u,i=0;i<64;)c=[a=c[3],(n=0|c[1])+((a=c[0]+[n&(o=c[2])|~n&a,a&n|~a&o,n^o^a,o^(n|~a)][c=i>>4]+(t[i]+(0|l[[i,5*i+1,3*i+5,7*i][c]%16+g])))<<(c=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*c+i++%4])|a>>>32-c),n,o];for(i=4;i;)u[--i]=u[i]+c[i]}for(e="";i<32;)e+=(u[i>>3]>>4*(1^7&i++)&15).toString(16);return e},e.now=j,e.pick=(e=[],t=1)=>{const r=C(e),n=Math.max(1,t),o=Math.min(n,r.length-1);return r.splice(0,o)},e.pipe=(...e)=>e.reduce(((e,t)=>r=>t(e(r)))),e.randint=h,e.replaceAll=b,e.shuffle=C,e.slugify=(e,t="-")=>y(e).trim().toLowerCase().replace(/\W+/g," ").replace(/\s+/g," ").replace(/\s/g,t),e.sort=q,e.sortBy=(e=[],t=1,r="")=>n(r)&&g(e[0],r)?q(e,((e,n)=>e[r]>n[r]?t:e[r]<n[r]?-1*t:0)):e,e.stripAccent=y,e.stripTags=e=>d(e).replace(/<.*?>/gi," ").replace(/\s\s+/g," ").trim(),e.time=D,e.toDateString=A,e.toLocalDateString=(e=D())=>{const t=c(e)?e:new Date(e);if(!c(t))throw new Error("InvalidInput: Number or Date required.");return A(t,"D, j M Y h:i:s O")},e.toRelativeTime=(e=D())=>{const t=c(e)?e:new Date(e);if(!c(t))throw new Error("InvalidInput: Number or Date required.");let r=j()-t,n=parseInt(t,10);if(isNaN(n)&&(n=0),r<=n)return"Just now";let o=null;const a={millisecond:1,second:1e3,minute:60,hour:60,day:24,month:30,year:12};for(const e in a){if(r<a[e])break;o=e,r/=a[e]}return r=Math.floor(r),1!==r&&(o+="s"),[r,o].join(" ")+" ago"},e.toUTCDateString=(e=D())=>{const t=c(e)?e:new Date(e);if(!c(t))throw new Error("InvalidInput: Number or Date required.");const r=t.getMinutes(),n=new Date(t);return n.setMinutes(r+S),`${A(n,"D, j M Y h:i:s")} GMT+0000`},e.truncate=(e,t)=>{const r=d(e),n=t||140;if(r.length<=n)return r;let o=r.substring(0,n);const a=o.split(" ");let i="";return a.length>1?(a.pop(),i+=a.join(" "),i.length<r.length&&(i+="...")):(o=o.substring(0,n-3),i=o+"..."),i},e.ucfirst=m,e.ucwords=e=>d(e).split(" ").map((e=>m(e))).join(" "),e.unescapeHTML=e=>d(e).replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"),e.unique=(e=[])=>[...new Set(e)],Object.defineProperty(e,"__esModule",{value:!0})}));
// bellajs@11.0.0rc1, by @ndaidong - built with esbuild at 2022-01-02T10:31:26.719Z - published under MIT license
var bella=(()=>{var E=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var B=t=>E(t,"__esModule",{value:!0});var J=(t,e)=>{for(var r in e)E(t,r,{get:e[r],enumerable:!0})},$=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of R(e))!H.call(t,o)&&(r||o!=="default")&&E(t,o,{get:()=>e[o],enumerable:!(n=L(e,o))||n.enumerable});return t};var W=(t=>(e,r)=>t&&t.get(e)||(r=$(B({}),e,1),t&&t.set(e,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var St={};J(St,{clone:()=>N,compose:()=>yt,copies:()=>Y,curry:()=>xt,equals:()=>O,escapeHTML:()=>nt,genid:()=>ct,hasProperty:()=>h,isArray:()=>l,isBoolean:()=>K,isDate:()=>a,isElement:()=>V,isEmail:()=>v,isEmpty:()=>j,isFunction:()=>Q,isInteger:()=>X,isLetter:()=>Z,isNil:()=>q,isNull:()=>C,isNumber:()=>M,isObject:()=>g,isString:()=>f,isUndefined:()=>U,maybe:()=>A,md5:()=>mt,now:()=>I,pick:()=>Dt,pipe:()=>wt,randint:()=>T,replaceAll:()=>D,shuffle:()=>G,slugify:()=>it,sort:()=>F,sortBy:()=>jt,stripAccent:()=>P,stripTags:()=>rt,time:()=>S,toDateString:()=>k,toLocalDateString:()=>dt,toRelativeTime:()=>gt,toUTCDateString:()=>ht,truncate:()=>et,ucfirst:()=>z,ucwords:()=>st,unescapeHTML:()=>ot,unique:()=>Mt});var w=t=>({}).toString.call(t),X=t=>Number.isInteger(t),l=t=>Array.isArray(t),f=t=>String(t)===t,M=t=>Number(t)===t,K=t=>Boolean(t)===t,C=t=>w(t)==="[object Null]",U=t=>w(t)==="[object Undefined]",q=t=>U(t)||C(t),Q=t=>w(t)==="[object Function]",g=t=>w(t)==="[object Object]"&&!l(t),a=t=>t instanceof Date&&!isNaN(t.valueOf()),V=t=>w(t).match(/^\[object HTML\w*Element]$/)!==null,Z=t=>{let e=/^[a-z]+$/i;return f(t)&&e.test(t)},v=t=>{let e=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return f(t)&&e.test(t)},j=t=>!t||q(t)||f(t)&&t===""||l(t)&&t.length===0||g(t)&&Object.keys(t).length===0,h=(t,e)=>!t||!e?!1:Object.prototype.hasOwnProperty.call(t,e);var O=(t,e)=>{if(j(t)&&j(e))return!0;if(a(t)&&a(e))return t.getTime()===e.getTime();if(l(t)&&l(e)){if(t.length!==e.length)return!1;let r=!0;for(let n=0;n<t.length;n++)if(!O(t[n],e[n])){r=!1;break}return r}if(g(t)&&g(e)){if(Object.keys(t).length!==Object.keys(e).length)return!1;let r=!0;for(let n in t)if(!h(e,n)||!O(t[n],e[n])){r=!1;break}return r}return t===e};var tt=Number.MAX_SAFE_INTEGER,T=(t,e)=>{if((!t||t<0)&&(t=0),e||(e=tt),t===e)return e;t>e&&(t=Math.min(t,e),e=Math.max(t,e));let r=t,n=e-t+1;return Math.floor(Math.random()*n)+r};var m=t=>{let e=M(t)?String(t):t;if(!f(e))throw new Error("InvalidInput: String required.");return e},et=(t,e)=>{let r=m(t),n=e||140;if(r.length<=n)return r;let o=r.substring(0,n),s=o.split(" "),c=s.length,i="";return c>1?(s.pop(),i+=s.join(" "),i.length<r.length&&(i+="...")):(o=o.substring(0,n-3),i=o+"..."),i},rt=t=>m(t).replace(/<.*?>/gi," ").replace(/\s\s+/g," ").trim(),nt=t=>m(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),ot=t=>m(t).replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"),z=t=>{let e=m(t).toLowerCase();return e.length>1?e.charAt(0).toUpperCase()+e.slice(1):e.toUpperCase()},st=t=>m(t).split(" ").map(e=>z(e)).join(" "),D=(t,e,r)=>{let n=m(t);if(M(e)&&(e=String(e)),M(r)&&(r=String(r)),f(e)&&f(r))n=n.split(e).join(r);else if(l(e)&&f(r))e.forEach(o=>{n=D(n,o,r)});else if(l(e)&&l(r)&&e.length===r.length){let o=e.length;if(o>0)for(let s=0;s<o;s++){let c=e[s],i=r[s];n=D(n,c,i)}}return n},P=t=>{let e=m(t),r={a:"á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ|ä",A:"Á|À|Ả|Ã|Ạ|Ă|Ắ|Ặ|Ằ|Ẳ|Ẵ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ|Ä",c:"ç",C:"Ç",d:"đ",D:"Đ",e:"é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ|ë",E:"É|È|Ẻ|Ẽ|Ẹ|Ê|Ế|Ề|Ể|Ễ|Ệ|Ë",i:"í|ì|ỉ|ĩ|ị|ï|î",I:"Í|Ì|Ỉ|Ĩ|Ị|Ï|Î",o:"ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ|ö",O:"Ó|Ò|Ỏ|Õ|Ọ|Ô|Ố|Ồ|Ổ|Ô|Ộ|Ơ|Ớ|Ờ|Ở|Ỡ|Ợ|Ö",u:"ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự|û",U:"Ú|Ù|Ủ|Ũ|Ụ|Ư|Ứ|Ừ|Ử|Ữ|Ự|Û",y:"ý|ỳ|ỷ|ỹ|ỵ",Y:"Ý|Ỳ|Ỷ|Ỹ|Ỵ"},n=(o,s)=>{e=D(e,o,s)};for(let o in r)h(r,o)&&r[o].split("|").forEach(c=>n(c,o));return e},ct=(t,e="")=>{let r="abcdefghijklmnopqrstuvwxyz",n=r.toUpperCase(),s=[r,n,"0123456789"].join("").split("").sort(()=>Math.random()>.5).join(""),c=s.length,i=Math.max(t||32,e.length),p=e;for(;p.length<i;){let u=T(0,c);p+=s.charAt(u)||""}return p},it=(t,e="-")=>P(t).trim().toLowerCase().replace(/\W+/g," ").replace(/\s+/g," ").replace(/\s/g,e);var ut="D, M d, Y h:i:s A",lt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],at=["January","February","March","April","May","June","July","August","September","October","November","December"],I=()=>new Date,S=()=>Date.now(),_=I().getTimezoneOffset(),pt=(()=>{let t=Math.abs(_/60),e=_<0?"+":"-";return["GMT",e,String(t).padStart(4,"0")].join("")})(),b=t=>String(t<10?"0"+t:t),ft=t=>{let e=t+" ",r=e.charAt(e.length-2);return r==="1"?e="st":r==="2"?e="nd":r==="3"?e="rd":e="th",e},k=(t,e=ut)=>{let r=a(t)?t:new Date(t);if(!a(r))throw new Error("InvalidInput: Number or Date required.");let n=/\.*\\?([a-z])/gi,o=e.includes("a")||e.includes("A"),s=lt,c=at,i={Y(){return r.getFullYear()},y(){return(i.Y()+"").slice(-2)},F(){return c[i.n()-1]},M(){return(i.F()+"").slice(0,3)},m(){return b(i.n())},n(){return r.getMonth()+1},S(){return ft(i.j())},j(){return r.getDate()},d(){return b(i.j())},t(){return new Date(i.Y(),i.n(),0).getDate()},w(){return r.getDay()},l(){return s[i.w()]},D(){return(i.l()+"").slice(0,3)},G(){return r.getHours()},g(){return i.G()%12||12},h(){return b(o?i.g():i.G())},i(){return b(r.getMinutes())},s(){return b(r.getSeconds())},a(){return i.G()>11?"pm":"am"},A(){return i.a().toUpperCase()},O(){return pt}},p=(u,y)=>i[u]?i[u]():y;return e.replace(n,p)},gt=(t=S())=>{let e=a(t)?t:new Date(t);if(!a(e))throw new Error("InvalidInput: Number or Date required.");let r=I()-e,n=parseInt(e,10);if(isNaN(n)&&(n=0),r<=n)return"Just now";let o=null,s={millisecond:1,second:1e3,minute:60,hour:60,day:24,month:30,year:12};for(let c in s){if(r<s[c])break;o=c,r/=s[c]}return r=Math.floor(r),r!==1&&(o+="s"),[r,o].join(" ")+" ago"},ht=(t=S())=>{let e=a(t)?t:new Date(t);if(!a(e))throw new Error("InvalidInput: Number or Date required.");let r=e.getMinutes(),n=new Date(e);return n.setMinutes(r+_),`${k(n,"D, j M Y h:i:s")} GMT+0000`},dt=(t=S())=>{let e=a(t)?t:new Date(t);if(!a(e))throw new Error("InvalidInput: Number or Date required.");return k(e,"D, j M Y h:i:s O")};var mt=t=>{for(var e=[],r=0;r<64;)e[r]=0|Math.abs(Math.sin(++r))*4294967296;for(var n,o,s,c,i=[],p=decodeURIComponent(encodeURI(t)),u=p.length,y=[n=1732584193,o=-271733879,~n,~o],d=0;d<=u;)i[d>>2]|=(p.charCodeAt(d)||128)<<8*(d++%4);for(i[t=(u+8>>6)*16+14]=u*8,d=0;d<t;d+=16){for(u=y,c=0;c<64;)u=[s=u[3],(n=u[1]|0)+((s=u[0]+[n&(o=u[2])|~n&s,s&n|~s&o,n^o^s,o^(n|~s)][u=c>>4]+(e[c]+(i[[c,5*c+1,3*c+5,7*c][u]%16+d]|0)))<<(u=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*u+c++%4])|s>>>32-u),n,o];for(c=4;c;)y[--c]=y[c]+u[c]}for(t="";c<32;)t+=(y[c>>3]>>(1^c++&7)*4&15).toString(16);return t};var xt=t=>{let e=t.length,r=(n,o)=>n>0?(...s)=>r(n-s.length,[...o,...s]):t(...o);return r(e,[])};var yt=(...t)=>t.reduce((e,r)=>n=>e(r(n)));var wt=(...t)=>t.reduce((e,r)=>n=>r(e(n)));var x=(t,e,r,n={})=>{let{writable:o=!1,configurable:s=!1,enumerable:c=!1}=n;Object.defineProperty(t,e,{value:r,writable:o,configurable:s,enumerable:c})};var A=t=>{let e=t,r=()=>e==null,n=()=>e,o=p=>A(e||p()),s=p=>A(p(e)===!0?e:null),c=p=>A(r()?null:p(e)),i=Object.create({});return x(i,"__value__",e,{enumerable:!0}),x(i,"__type__","Maybe",{enumerable:!0}),x(i,"isNil",r),x(i,"value",n),x(i,"map",c),x(i,"if",s),x(i,"else",o),i};var N=(t,e=null)=>{let r=e||new Set;if(r.has(t))return t;if(r.add(t),a(t))return new Date(t.valueOf());let n=s=>{let c=Object.create({});for(let i in s)h(s,i)&&(c[i]=N(s[i],r));return c},o=s=>[...s].map(c=>l(c)?o(c):g(c)?n(c):N(c,r));return l(t)?o(t):g(t)?n(t):t},Y=(t,e,r=!1,n=[])=>{for(let o in t)if(!(n.length>0&&n.includes(o))&&(!r||r&&h(e,o))){let s=t[o],c=e[o];g(c)&&g(s)||l(c)&&l(s)?e[o]=Y(s,e[o],r,n):e[o]=N(s)}return e},Mt=(t=[])=>[...new Set(t)],bt=(t,e)=>t>e?1:t<e?-1:0,F=(t=[],e=null)=>{let r=[...t],n=e||bt;return r.sort(n),r},jt=(t=[],e=1,r="")=>!f(r)||!h(t[0],r)?t:F(t,(n,o)=>n[r]>o[r]?e:n[r]<o[r]?-1*e:0),G=(t=[])=>{let e=[...t],r=[],n=e.length;for(;n>0;){let o=Math.floor(Math.random()*n);r.push(e.splice(o,1)[0]),n--}return r},Dt=(t=[],e=1)=>{let r=G(t),n=Math.max(1,e),o=Math.min(n,r.length-1);return r.splice(0,o)};return W(St);})();
{
"version": "10.0.2",
"version": "11.0.0rc1",
"name": "bellajs",

@@ -12,6 +12,7 @@ "description": "A useful helper for any javascript program",

"main": "./dist/bella.js",
"module": "./src/main",
"module": "./src/main.js",
"browser": "./dist/bella.min.js",
"type": "module",
"engines": {
"node": ">= 10.14.2"
"node": ">= 14"
},

@@ -22,10 +23,5 @@ "scripts": {

"test": "NODE_ENV=test jest --verbose --coverage=true --unhandled-rejections=strict --detectOpenHandles --env=jsdom",
"build": "gccmin -e src/main.js -n bella -o dist -p package.json",
"build": "node build.js src/main.js",
"reset": "node reset"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.16.0",
"gcc-min": "^7.3.0",
"jest": "^27.3.1"
},
"babel": {

@@ -40,5 +36,10 @@ "env": {

},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.16.7",
"esbuild": "^0.14.10",
"jest": "^27.3.1"
},
"standard": {
"ignore": [
"dist"
"./dist"
]

@@ -45,0 +46,0 @@ },

@@ -49,4 +49,10 @@ BellaJS

```
```bash
npm i bellajs
# pnpm
pnpm i bellajs
# yarn
yarn add bellajs
```

@@ -56,30 +62,49 @@

- [bella.js](https://unpkg.com/bellajs/dist/bella.js)
- [bella.min.js](https://unpkg.com/bellajs/dist/bella.min.js)
- [bella.min.map](https://unpkg.com/bellajs/dist/bella.min.map)
- ES6 Module: [bella.esm.js](https://unpkg.com/bellajs/dist/bella.esm.js)
- CommonJS: [bella.js](https://unpkg.com/bellajs/dist/cjs/bella.js)
- For old browsers: [bella.min.js](https://unpkg.com/bellajs/dist/bella.min.js)
- Load with ESM, CommonJS, AMD or UMD style
## Usage
### Usage
### Node.js:
Sync v14, ECMAScript modules [have became the official standard format](https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_modules_ecmascript_modules).
Just [enable](https://nodejs.org/api/packages.html#determining-module-system) and enjoy with ES6 import/export syntax.
```js
const bella = require('bellajs');
import { genid } from 'bellajs'
console.log(genid())
```
// few methods only:
const {
isArray,
isString,
} = require('bellajs');
For regular CommonJS environment, `require` can be used as below:
// es6 syntax:
import bella from 'bellajs';
```js
const bella = require('bellajs/dist/cjs/bella.js')
console.log(bella.genid())
```
// or
import {
isArray,
isString,
} from 'bellajs';
### Browsers:
Currently ECMAScript modules work fine on almost browsers:
```html
<script type="module">
import { genid } from 'https://unpkg.com/bellajs/dist/bella.esm.js'
console.log(genid())
</script>
```
With outdated browsers, we can use traditional way:
```html
<script type="text/javascript" src="https://unpkg.com/bellajs/dist/bella.min.js"></script>
<script>
console.log(window.bella.genid())
</script>
```
## APIs

@@ -86,0 +111,0 @@

@@ -1,9 +0,12 @@

#!/usr/bin/env node
/**
* reset.js
* @ndaidong
**/
const {
import {
existsSync,
unlinkSync
} = require('fs')
} from 'fs'
const { execSync } = require('child_process')
import { execSync } from 'child_process'

@@ -10,0 +13,0 @@ const dirs = [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc