Comparing version 11.1.1 to 11.1.2
@@ -1,2 +0,2 @@ | ||
// bellajs@11.1.1 https://github.com/ndaidong/bellajs - built with esbuild at 2022-10-12T10:45:38.055Z | ||
// bellajs@11.1.2 https://github.com/ndaidong/bellajs - built with esbuild at 2023-02-28T14:05:52.752Z | ||
var g=t=>({}).toString.call(t),U=t=>Number.isInteger(t),p=t=>Array.isArray(t),l=t=>String(t)===t,h=t=>Number(t)===t,k=t=>Boolean(t)===t,S=t=>g(t)==="[object Null]",M=t=>g(t)==="[object Undefined]",O=t=>M(t)||S(t),F=t=>g(t)==="[object Function]",a=t=>g(t)==="[object Object]"&&!p(t),w=t=>t instanceof Date&&!isNaN(t.valueOf()),q=t=>g(t).match(/^\[object HTML\w*Element]$/)!==null,z=t=>{let e=/^[a-z]+$/i;return l(t)&&e.test(t)},B=t=>{let e=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return l(t)&&e.test(t)},H=t=>!t||O(t)||l(t)&&t===""||p(t)&&t.length===0||a(t)&&Object.keys(t).length===0,x=(t,e)=>!t||!e?!1:Object.prototype.hasOwnProperty.call(t,e);var f=t=>{let e=h(t)?String(t):t;if(!l(e))throw new Error("InvalidInput: String required.");return e},R=(t,e=140)=>{let r=f(t);if(r.length<=e)return r;let n=r.substring(0,e).trim(),s=n.split(" ");return s.length>1?(s.pop(),s.map(i=>i.trim()).join(" ")+"..."):n.substring(0,e-3)+"..."},V=t=>f(t).replace(/(<([^>]+)>)/ig,"").trim(),W=t=>f(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),G=t=>f(t).replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"),A=t=>{let e=f(t).toLowerCase();return e.length>1?e.charAt(0).toUpperCase()+e.slice(1):e.toUpperCase()},J=t=>f(t).split(" ").map(e=>A(e)).join(" "),b=(t,e,r)=>{let o=f(t),n=h(e)?String(e):e,s=h(r)?String(r):r;if(l(n)&&l(s))o=o.split(n).join(s);else if(p(n)&&l(s))n.forEach(c=>{o=b(o,c,s)});else if(p(n)&&p(s)&&n.length===s.length){let c=n.length;if(c>0)for(let i=0;i<c;i++){let u=n[i],j=s[i];o=b(o,u,j)}}return o},N=()=>{let t={a:"á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ|ä|æ",c:"ç",d:"đ|ð",e:"é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ|ë",i:"í|ì|ỉ|ĩ|ị|ï|î",n:"ñ",o:"ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ|ö|ø",s:"ß",u:"ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự|û",y:"ý|ỳ|ỷ|ỹ|ỵ|ÿ"},e={...t};return Object.keys(t).forEach(r=>{let o=r.toUpperCase();e[o]=t[r].toUpperCase()}),e},D=t=>{let e=f(t),r=(n,s)=>{e=b(e,n,s)},o=N();for(let n in o)x(o,n)&&o[n].split("|").forEach(c=>r(c,n));return e},Q=(t,e="-")=>D(t).trim().toLowerCase().replace(/\W+/g," ").replace(/\s+/g," ").replace(/\s/g,e);var Y=(t=0,e=1e6)=>Math.floor(Math.random()*(e-t+1))+t,Z=(t=32,e="")=>{let r=e;for(let o=0;o<t;o++){let n=Math.random(),s=Math.floor(n*36),c=s.toString(36);r+=s>9&&n>.3&&n<.7?c.toUpperCase():c}return r.substring(0,t)};var L=()=>({dateStyle:"medium",timeStyle:"long"}),_=()=>({second:1e3,minute:60,hour:60,day:24,week:7,month:4,year:12}),C=t=>{try{return new Intl.Locale(t).language!==""}catch{return!1}},et=(...t)=>{let e=t[0],r=C(t[1])?t[1]:"en",o=L(),n=t.length>=3?t[2]:t.length===1?o:a(t[1])?t[1]:o;return new Intl.DateTimeFormat(r,n).format(new Date(e))},rt=(t,e="en",r="just now")=>{let o=new Date(t),n=Date.now()-o,s=_();if(n<=s.second)return r;let c="second";for(let u in s){if(n<s[u])break;c=u,n/=s[u]}return n=Math.floor(n),new Intl.RelativeTimeFormat(e).format(-n,c)};var ot=t=>{let e=t.length,r=(o,n)=>o>0?(...s)=>r(o-s.length,[...n,...s]):t(...n);return r(e,[])};var ct=(...t)=>t.reduce((e,r)=>o=>e(r(o)));var ut=(...t)=>t.reduce((e,r)=>o=>r(e(o)));var m=(t,e,r,o={})=>{let{writable:n=!1,configurable:s=!1,enumerable:c=!1}=o;Object.defineProperty(t,e,{value:r,writable:n,configurable:s,enumerable:c})};var d=t=>{let e=t,r=()=>e==null,o=()=>e,n=u=>d(e||u()),s=u=>d(u(e)===!0?e:null),c=u=>d(r()?null:u(e)),i=Object.create({});return m(i,"__value__",e,{enumerable:!0}),m(i,"__type__","Maybe",{enumerable:!0}),m(i,"isNil",r),m(i,"value",o),m(i,"map",c),m(i,"if",s),m(i,"else",n),i};var y=(t,e=null)=>{let r=e||new Set;if(r.has(t))return t;if(r.add(t),w(t))return new Date(t.valueOf());let o=s=>{let c=Object.create({});for(let i in s)x(s,i)&&(c[i]=y(s[i],r));return c},n=s=>[...s].map(c=>p(c)?n(c):a(c)?o(c):y(c,r));return p(t)?n(t):a(t)?o(t):t},E=(t,e,r=!1,o=[])=>{for(let n in t)if(!(o.length>0&&o.includes(n))&&(!r||r&&x(e,n))){let s=t[n],c=e[n];a(c)&&a(s)||p(c)&&p(s)?e[n]=E(s,e[n],r,o):e[n]=y(s)}return e},xt=(t=[])=>[...new Set(t)],T=(t,e)=>t>e?1:t<e?-1:0,I=(t=[],e=null)=>{let r=[...t],o=e||T;return r.sort(o),r},gt=(t=[],e=1,r="")=>!l(r)||!x(t[0],r)?t:I(t,(o,n)=>o[r]>n[r]?e:o[r]<n[r]?-1*e:0),P=(t=[])=>{let e=[...t],r=[],o=e.length;for(;o>0;){let n=Math.floor(Math.random()*o);r.push(e.splice(n,1)[0]),o--}return r},ht=(t=[],e=1)=>{let r=P(t),o=Math.max(1,e),n=Math.min(o,r.length-1);return r.splice(0,n)};export{y as clone,ct as compose,E as copies,ot as curry,W as escapeHTML,et as formatDateString,rt as formatTimeAgo,Z as genid,x as hasProperty,p as isArray,k as isBoolean,w as isDate,q as isElement,B as isEmail,H as isEmpty,F as isFunction,U as isInteger,z as isLetter,O as isNil,S as isNull,h as isNumber,a as isObject,l as isString,M as isUndefined,d as maybe,ht as pick,ut as pipe,Y as randint,b as replaceAll,P as shuffle,Q as slugify,I as sort,gt as sortBy,D as stripAccent,V as stripTags,R as truncate,A as ucfirst,J as ucwords,G as unescapeHTML,xt as unique}; |
@@ -1,2 +0,2 @@ | ||
// bellajs@11.1.1 https://github.com/ndaidong/bellajs - built with esbuild at 2022-10-12T10:45:38.055Z | ||
// bellajs@11.1.2 https://github.com/ndaidong/bellajs - built with esbuild at 2023-02-28T14:05:52.752Z | ||
var w=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var r in e)w(t,r,{get:e[r],enumerable:!0})},U=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of T(e))!I.call(t,n)&&n!==r&&w(t,n,{get:()=>e[n],enumerable:!(o=E(e,n))||o.enumerable});return t};var k=t=>U(w({},"__esModule",{value:!0}),t);var at={};P(at,{clone:()=>y,compose:()=>st,copies:()=>D,curry:()=>ot,escapeHTML:()=>W,formatDateString:()=>rt,formatTimeAgo:()=>nt,genid:()=>Z,hasProperty:()=>x,isArray:()=>u,isBoolean:()=>q,isDate:()=>j,isElement:()=>B,isEmail:()=>$,isEmpty:()=>K,isFunction:()=>z,isInteger:()=>F,isLetter:()=>H,isNil:()=>O,isNull:()=>S,isNumber:()=>h,isObject:()=>a,isString:()=>l,isUndefined:()=>M,maybe:()=>d,pick:()=>lt,pipe:()=>ct,randint:()=>Y,replaceAll:()=>b,shuffle:()=>_,slugify:()=>X,sort:()=>L,sortBy:()=>pt,stripAccent:()=>N,stripTags:()=>V,truncate:()=>R,ucfirst:()=>A,ucwords:()=>J,unescapeHTML:()=>G,unique:()=>it});module.exports=k(at);var g=t=>({}).toString.call(t),F=t=>Number.isInteger(t),u=t=>Array.isArray(t),l=t=>String(t)===t,h=t=>Number(t)===t,q=t=>Boolean(t)===t,S=t=>g(t)==="[object Null]",M=t=>g(t)==="[object Undefined]",O=t=>M(t)||S(t),z=t=>g(t)==="[object Function]",a=t=>g(t)==="[object Object]"&&!u(t),j=t=>t instanceof Date&&!isNaN(t.valueOf()),B=t=>g(t).match(/^\[object HTML\w*Element]$/)!==null,H=t=>{let e=/^[a-z]+$/i;return l(t)&&e.test(t)},$=t=>{let e=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return l(t)&&e.test(t)},K=t=>!t||O(t)||l(t)&&t===""||u(t)&&t.length===0||a(t)&&Object.keys(t).length===0,x=(t,e)=>!t||!e?!1:Object.prototype.hasOwnProperty.call(t,e);var f=t=>{let e=h(t)?String(t):t;if(!l(e))throw new Error("InvalidInput: String required.");return e},R=(t,e=140)=>{let r=f(t);if(r.length<=e)return r;let n=r.substring(0,e).trim(),s=n.split(" ");return s.length>1?(s.pop(),s.map(i=>i.trim()).join(" ")+"..."):n.substring(0,e-3)+"..."},V=t=>f(t).replace(/(<([^>]+)>)/ig,"").trim(),W=t=>f(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),G=t=>f(t).replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"),A=t=>{let e=f(t).toLowerCase();return e.length>1?e.charAt(0).toUpperCase()+e.slice(1):e.toUpperCase()},J=t=>f(t).split(" ").map(e=>A(e)).join(" "),b=(t,e,r)=>{let o=f(t),n=h(e)?String(e):e,s=h(r)?String(r):r;if(l(n)&&l(s))o=o.split(n).join(s);else if(u(n)&&l(s))n.forEach(c=>{o=b(o,c,s)});else if(u(n)&&u(s)&&n.length===s.length){let c=n.length;if(c>0)for(let i=0;i<c;i++){let p=n[i],C=s[i];o=b(o,p,C)}}return o},Q=()=>{let t={a:"á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ|ä|æ",c:"ç",d:"đ|ð",e:"é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ|ë",i:"í|ì|ỉ|ĩ|ị|ï|î",n:"ñ",o:"ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ|ö|ø",s:"ß",u:"ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự|û",y:"ý|ỳ|ỷ|ỹ|ỵ|ÿ"},e={...t};return Object.keys(t).forEach(r=>{let o=r.toUpperCase();e[o]=t[r].toUpperCase()}),e},N=t=>{let e=f(t),r=(n,s)=>{e=b(e,n,s)},o=Q();for(let n in o)x(o,n)&&o[n].split("|").forEach(c=>r(c,n));return e},X=(t,e="-")=>N(t).trim().toLowerCase().replace(/\W+/g," ").replace(/\s+/g," ").replace(/\s/g,e);var Y=(t=0,e=1e6)=>Math.floor(Math.random()*(e-t+1))+t,Z=(t=32,e="")=>{let r=e;for(let o=0;o<t;o++){let n=Math.random(),s=Math.floor(n*36),c=s.toString(36);r+=s>9&&n>.3&&n<.7?c.toUpperCase():c}return r.substring(0,t)};var v=()=>({dateStyle:"medium",timeStyle:"long"}),tt=()=>({second:1e3,minute:60,hour:60,day:24,week:7,month:4,year:12}),et=t=>{try{return new Intl.Locale(t).language!==""}catch{return!1}},rt=(...t)=>{let e=t[0],r=et(t[1])?t[1]:"en",o=v(),n=t.length>=3?t[2]:t.length===1?o:a(t[1])?t[1]:o;return new Intl.DateTimeFormat(r,n).format(new Date(e))},nt=(t,e="en",r="just now")=>{let o=new Date(t),n=Date.now()-o,s=tt();if(n<=s.second)return r;let c="second";for(let p in s){if(n<s[p])break;c=p,n/=s[p]}return n=Math.floor(n),new Intl.RelativeTimeFormat(e).format(-n,c)};var ot=t=>{let e=t.length,r=(o,n)=>o>0?(...s)=>r(o-s.length,[...n,...s]):t(...n);return r(e,[])};var st=(...t)=>t.reduce((e,r)=>o=>e(r(o)));var ct=(...t)=>t.reduce((e,r)=>o=>r(e(o)));var m=(t,e,r,o={})=>{let{writable:n=!1,configurable:s=!1,enumerable:c=!1}=o;Object.defineProperty(t,e,{value:r,writable:n,configurable:s,enumerable:c})};var d=t=>{let e=t,r=()=>e==null,o=()=>e,n=p=>d(e||p()),s=p=>d(p(e)===!0?e:null),c=p=>d(r()?null:p(e)),i=Object.create({});return m(i,"__value__",e,{enumerable:!0}),m(i,"__type__","Maybe",{enumerable:!0}),m(i,"isNil",r),m(i,"value",o),m(i,"map",c),m(i,"if",s),m(i,"else",n),i};var y=(t,e=null)=>{let r=e||new Set;if(r.has(t))return t;if(r.add(t),j(t))return new Date(t.valueOf());let o=s=>{let c=Object.create({});for(let i in s)x(s,i)&&(c[i]=y(s[i],r));return c},n=s=>[...s].map(c=>u(c)?n(c):a(c)?o(c):y(c,r));return u(t)?n(t):a(t)?o(t):t},D=(t,e,r=!1,o=[])=>{for(let n in t)if(!(o.length>0&&o.includes(n))&&(!r||r&&x(e,n))){let s=t[n],c=e[n];a(c)&&a(s)||u(c)&&u(s)?e[n]=D(s,e[n],r,o):e[n]=y(s)}return e},it=(t=[])=>[...new Set(t)],ut=(t,e)=>t>e?1:t<e?-1:0,L=(t=[],e=null)=>{let r=[...t],o=e||ut;return r.sort(o),r},pt=(t=[],e=1,r="")=>!l(r)||!x(t[0],r)?t:L(t,(o,n)=>o[r]>n[r]?e:o[r]<n[r]?-1*e:0),_=(t=[])=>{let e=[...t],r=[],o=e.length;for(;o>0;){let n=Math.floor(Math.random()*o);r.push(e.splice(n,1)[0]),o--}return r},lt=(t=[],e=1)=>{let r=_(t),o=Math.max(1,e),n=Math.min(o,r.length-1);return r.splice(0,n)};0&&(module.exports={clone,compose,copies,curry,escapeHTML,formatDateString,formatTimeAgo,genid,hasProperty,isArray,isBoolean,isDate,isElement,isEmail,isEmpty,isFunction,isInteger,isLetter,isNil,isNull,isNumber,isObject,isString,isUndefined,maybe,pick,pipe,randint,replaceAll,shuffle,slugify,sort,sortBy,stripAccent,stripTags,truncate,ucfirst,ucwords,unescapeHTML,unique}); |
{ | ||
"version": "11.1.1", | ||
"version": "11.1.2", | ||
"name": "bellajs", | ||
@@ -21,4 +21,4 @@ "description": "A useful helper for any javascript program", | ||
"scripts": { | ||
"lint": "standard .", | ||
"lint:fix": "standard --fix", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint --fix .", | ||
"pretest": "npm run lint", | ||
@@ -30,12 +30,7 @@ "test": "NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --verbose --coverage=true --env=jsdom", | ||
"devDependencies": { | ||
"esbuild": "^0.15.10", | ||
"jest": "^29.1.2", | ||
"jest-environment-jsdom": "^29.1.2", | ||
"standard": "^17.0.0" | ||
"esbuild": "^0.17.10", | ||
"eslint": "^8.35.0", | ||
"jest": "^29.4.3", | ||
"jest-environment-jsdom": "^29.4.3" | ||
}, | ||
"standard": { | ||
"ignore": [ | ||
"/dist" | ||
] | ||
}, | ||
"keywords": [ | ||
@@ -42,0 +37,0 @@ "detection", |
@@ -10,6 +10,4 @@ BellaJS | ||
![CodeQL](https://github.com/ndaidong/bellajs/workflows/CodeQL/badge.svg) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
[![CodeFactor](https://www.codefactor.io/repository/github/ndaidong/bellajs/badge)](https://www.codefactor.io/repository/github/ndaidong/bellajs) | ||
You may be interested in [BellaPy](https://github.com/ndaidong/bellapy) too. | ||
# Contents | ||
@@ -83,3 +81,2 @@ | ||
### String manipulation | ||
@@ -86,0 +83,0 @@ |
@@ -1,3 +0,1 @@ | ||
/* global crypto */ | ||
export default crypto |
@@ -22,3 +22,3 @@ // main.test | ||
name: 'Alice', | ||
age: 27 | ||
age: 27, | ||
}, | ||
@@ -28,3 +28,3 @@ birthday: new Date(), | ||
clone: false, | ||
reg: /^\w+@\s([a-z])$/gi | ||
reg: /^\w+@\s([a-z])$/gi, | ||
} | ||
@@ -57,3 +57,3 @@ const y = clone(x) | ||
a: 1, | ||
b: 'Awesome' | ||
b: 'Awesome', | ||
}, | ||
@@ -66,5 +66,5 @@ [ | ||
name: 'Lys', | ||
age: 11 | ||
} | ||
] | ||
age: 11, | ||
}, | ||
], | ||
] | ||
@@ -91,8 +91,8 @@ const y = clone(x) | ||
nationality: { | ||
name: 'America' | ||
name: 'America', | ||
}, | ||
groups: [ | ||
'admin', | ||
'accountant' | ||
] | ||
'accountant', | ||
], | ||
} | ||
@@ -104,3 +104,3 @@ const dest = { | ||
name: 'Alice', | ||
age: 27 | ||
age: 27, | ||
}, | ||
@@ -110,8 +110,8 @@ nationality: { | ||
long: '18123.123123.12312', | ||
lat: '98984771.134231.1234' | ||
lat: '98984771.134231.1234', | ||
}, | ||
groups: [ | ||
'finance', | ||
'manager' | ||
] | ||
'manager', | ||
], | ||
} | ||
@@ -129,7 +129,7 @@ copies(source, dest) | ||
age: 16, | ||
gender: 'male' | ||
gender: 'male', | ||
} | ||
const dest = { | ||
name: 'Aline', | ||
age: 20 | ||
age: 20, | ||
} | ||
@@ -166,3 +166,3 @@ copies(source, dest, true, ['age']) | ||
{ age: 12, name: 'D' }, | ||
{ age: 7, name: 'C' } | ||
{ age: 7, name: 'C' }, | ||
] | ||
@@ -174,3 +174,3 @@ const sortedByAge = [ | ||
{ age: 9, name: 'B' }, | ||
{ age: 12, name: 'D' } | ||
{ age: 12, name: 'D' }, | ||
] | ||
@@ -177,0 +177,0 @@ const sortedArr = sortBy(arr, 1, 'age') |
@@ -10,3 +10,3 @@ // utils / date | ||
dateStyle: 'medium', | ||
timeStyle: 'long' | ||
timeStyle: 'long', | ||
} | ||
@@ -23,3 +23,3 @@ } | ||
month: 4, | ||
year: 12 | ||
year: 12, | ||
} | ||
@@ -26,0 +26,0 @@ } |
@@ -25,3 +25,3 @@ // date.test | ||
timeStyle: 'medium', | ||
hour12: true | ||
hour12: true, | ||
}) | ||
@@ -36,3 +36,3 @@ const reg = /^\w+,\s\w+\s\d+,\s+\d{4}\sat\s\d+:\d+:\d+\s(AM|PM)$/ | ||
timeStyle: 'medium', | ||
hour12: true | ||
hour12: true, | ||
}) | ||
@@ -39,0 +39,0 @@ const reg = /^\w+,\s\w+\s\d+,\s+\d{4}\sat\s\d+:\d+:\d+\s(AM|PM)$/ |
@@ -7,3 +7,3 @@ // utils / defineProp | ||
configurable = false, | ||
enumerable = false | ||
enumerable = false, | ||
} = config | ||
@@ -14,4 +14,4 @@ Object.defineProperty(ob, key, { | ||
configurable, | ||
enumerable | ||
enumerable, | ||
}) | ||
} |
@@ -272,3 +272,3 @@ // detection.test | ||
name: 'alice', | ||
age: 17 | ||
age: 17, | ||
} | ||
@@ -275,0 +275,0 @@ const positives = ['name', 'age'] |
@@ -101,7 +101,7 @@ // utils / string | ||
u: 'ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự|û', | ||
y: 'ý|ỳ|ỷ|ỹ|ỵ|ÿ' | ||
y: 'ý|ỳ|ỷ|ỹ|ỵ|ÿ', | ||
} | ||
const map = { | ||
...lmap | ||
...lmap, | ||
} | ||
@@ -108,0 +108,0 @@ Object.keys(lmap).forEach((k) => { |
@@ -22,3 +22,3 @@ // string.test | ||
limit: 60, | ||
expectation: 'If a property is non-configurable, its writable attribute...' | ||
expectation: 'If a property is non-configurable, its writable attribute...', | ||
}, | ||
@@ -28,3 +28,3 @@ { | ||
limit: 100, | ||
expectation: 'this string is less than limit' | ||
expectation: 'this string is less than limit', | ||
}, | ||
@@ -34,4 +34,4 @@ { | ||
limit: 20, | ||
expectation: 'uyyiyirwqyiyiyrih...' | ||
} | ||
expectation: 'uyyiyirwqyiyiyrih...', | ||
}, | ||
] | ||
@@ -51,4 +51,4 @@ | ||
text: '<a>Hello <b>world</b></a>', | ||
expectation: 'Hello world' | ||
} | ||
expectation: 'Hello world', | ||
}, | ||
] | ||
@@ -74,7 +74,7 @@ | ||
text: '<a>Hello <b>world</b></a>', | ||
expectation: '<a>Hello <b>world</b></a>' | ||
} | ||
expectation: '<a>Hello <b>world</b></a>', | ||
}, | ||
] | ||
inputs.forEach(({ text, expectation }, k) => { | ||
inputs.forEach(({ text, expectation }) => { | ||
test(` check .escapeHTML(${text})`, () => { | ||
@@ -91,7 +91,7 @@ const actual = escapeHTML(text) | ||
text: '<a>Hello <b>world</b></a>', | ||
expectation: '<a>Hello <b>world</b></a>' | ||
} | ||
expectation: '<a>Hello <b>world</b></a>', | ||
}, | ||
] | ||
inputs.forEach(({ text, expectation }, k) => { | ||
inputs.forEach(({ text, expectation }) => { | ||
test(` check .unescapeHTML(${text})`, () => { | ||
@@ -108,11 +108,11 @@ const actual = unescapeHTML(text) | ||
text: 'HElLo wOrLd', | ||
expectation: 'Hello world' | ||
expectation: 'Hello world', | ||
}, | ||
{ | ||
text: 'h', | ||
expectation: 'H' | ||
} | ||
expectation: 'H', | ||
}, | ||
] | ||
inputs.forEach(({ text, expectation }, k) => { | ||
inputs.forEach(({ text, expectation }) => { | ||
test(` check .ucfirst(${text})`, () => { | ||
@@ -129,7 +129,7 @@ const actual = ucfirst(text) | ||
text: 'HElLo wOrLd', | ||
expectation: 'Hello World' | ||
} | ||
expectation: 'Hello World', | ||
}, | ||
] | ||
inputs.forEach(({ text, expectation }, k) => { | ||
inputs.forEach(({ text, expectation }) => { | ||
test(` check .ucwords(${text})`, () => { | ||
@@ -148,5 +148,5 @@ const actual = ucwords(text) | ||
b: 'l', | ||
c: '2' | ||
c: '2', | ||
}, | ||
expectation: 'He22o wor2d' | ||
expectation: 'He22o wor2d', | ||
}, | ||
@@ -157,5 +157,5 @@ { | ||
b: 'l', | ||
c: 2 | ||
c: 2, | ||
}, | ||
expectation: 'He22o wor2d' | ||
expectation: 'He22o wor2d', | ||
}, | ||
@@ -166,5 +166,5 @@ { | ||
b: 7, | ||
c: 1 | ||
c: 1, | ||
}, | ||
expectation: '198018961' | ||
expectation: '198018961', | ||
}, | ||
@@ -175,5 +175,5 @@ { | ||
b: ['l', 'o'], | ||
c: ['2', '0'] | ||
c: ['2', '0'], | ||
}, | ||
expectation: 'He220 w0r2d' | ||
expectation: 'He220 w0r2d', | ||
}, | ||
@@ -184,5 +184,5 @@ { | ||
b: ['l', 'o'], | ||
c: '2' | ||
c: '2', | ||
}, | ||
expectation: 'He222 w2r2d' | ||
expectation: 'He222 w2r2d', | ||
}, | ||
@@ -193,5 +193,5 @@ { | ||
b: ['l'], | ||
c: ['2', '0'] | ||
c: ['2', '0'], | ||
}, | ||
expectation: 'Hello world' | ||
expectation: 'Hello world', | ||
}, | ||
@@ -201,27 +201,27 @@ { | ||
a: 'Hello world', | ||
b: 'l' | ||
b: 'l', | ||
}, | ||
expectation: 'Hello world' | ||
expectation: 'Hello world', | ||
}, | ||
{ | ||
input: { | ||
a: 'Hello world' | ||
a: 'Hello world', | ||
}, | ||
expectation: 'Hello world' | ||
expectation: 'Hello world', | ||
}, | ||
{ | ||
input: { | ||
a: 10000 | ||
a: 10000, | ||
}, | ||
expectation: '10000' | ||
expectation: '10000', | ||
}, | ||
{ | ||
input: { | ||
a: 0 | ||
a: 0, | ||
}, | ||
expectation: '0' | ||
} | ||
expectation: '0', | ||
}, | ||
] | ||
inputs.forEach(({ input, expectation }, k) => { | ||
inputs.forEach(({ input, expectation }) => { | ||
const { a, b, c } = input | ||
@@ -239,7 +239,7 @@ test(` check .replaceAll(${a}, ${b}, ${c})`, () => { | ||
text: 'Sur l\'année 2015 - ủ Ù ỹ Ỹ', | ||
expectation: 'Sur l\'annee 2015 - u U y Y' | ||
} | ||
expectation: 'Sur l\'annee 2015 - u U y Y', | ||
}, | ||
] | ||
inputs.forEach(({ text, expectation }, k) => { | ||
inputs.forEach(({ text, expectation }) => { | ||
test(` check .stripAccent(${text})`, () => { | ||
@@ -256,11 +256,11 @@ const actual = stripAccent(text) | ||
text: 'Sur l\'année 2015', | ||
expectation: 'sur-l-annee-2015' | ||
expectation: 'sur-l-annee-2015', | ||
}, | ||
{ | ||
text: 'Nghị luận tác phẩm "Đường kách mệnh" của Hồ Chí Minh', | ||
expectation: 'nghi-luan-tac-pham-duong-kach-menh-cua-ho-chi-minh' | ||
} | ||
expectation: 'nghi-luan-tac-pham-duong-kach-menh-cua-ho-chi-minh', | ||
}, | ||
] | ||
inputs.forEach(({ text, expectation }, k) => { | ||
inputs.forEach(({ text, expectation }) => { | ||
test(` check .slugify(${text})`, () => { | ||
@@ -267,0 +267,0 @@ const actual = slugify(text) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1485
0
0
103665
30
526