Comparing version 7.2.0 to 7.2.1
{ | ||
"extends": "eslint-config-ggc" | ||
"extends": "eslint-config-goes" | ||
} |
/** | ||
* bellajs@7.2.0 | ||
* built on: Thu, 02 Nov 2017 13:10:05 GMT | ||
* bellajs@7.2.1 | ||
* built on: Mon, 07 May 2018 09:33:49 GMT | ||
* repository: https://github.com/ndaidong/bellajs | ||
@@ -568,97 +568,2 @@ * maintainer: @ndaidong | ||
}; | ||
var asyncGenerator = function () { | ||
function AwaitValue(value) { | ||
this.value = value; | ||
} | ||
function AsyncGenerator(gen) { | ||
var front, back; | ||
function send(key, arg) { | ||
return new Promise(function (resolve, reject) { | ||
var request = { | ||
key: key, | ||
arg: arg, | ||
resolve: resolve, | ||
reject: reject, | ||
next: null | ||
}; | ||
if (back) { | ||
back = back.next = request; | ||
} else { | ||
front = back = request; | ||
resume(key, arg); | ||
} | ||
}); | ||
} | ||
function resume(key, arg) { | ||
try { | ||
var result = gen[key](arg); | ||
var value = result.value; | ||
if (value instanceof AwaitValue) { | ||
Promise.resolve(value.value).then(function (arg) { | ||
resume("next", arg); | ||
}, function (arg) { | ||
resume("throw", arg); | ||
}); | ||
} else { | ||
settle(result.done ? "return" : "normal", result.value); | ||
} | ||
} catch (err) { | ||
settle("throw", err); | ||
} | ||
} | ||
function settle(type, value) { | ||
switch (type) { | ||
case "return": | ||
front.resolve({ | ||
value: value, | ||
done: true | ||
}); | ||
break; | ||
case "throw": | ||
front.reject(value); | ||
break; | ||
default: | ||
front.resolve({ | ||
value: value, | ||
done: false | ||
}); | ||
break; | ||
} | ||
front = front.next; | ||
if (front) { | ||
resume(front.key, front.arg); | ||
} else { | ||
back = null; | ||
} | ||
} | ||
this._invoke = send; | ||
if (typeof gen.return !== "function") { | ||
this.return = undefined; | ||
} | ||
} | ||
if (typeof Symbol === "function" && Symbol.asyncIterator) { | ||
AsyncGenerator.prototype[Symbol.asyncIterator] = function () { | ||
return this; | ||
}; | ||
} | ||
AsyncGenerator.prototype.next = function (arg) { | ||
return this._invoke("next", arg); | ||
}; | ||
AsyncGenerator.prototype.throw = function (arg) { | ||
return this._invoke("throw", arg); | ||
}; | ||
AsyncGenerator.prototype.return = function (arg) { | ||
return this._invoke("return", arg); | ||
}; | ||
return { | ||
wrap: function (fn) { | ||
return function () { | ||
return new AsyncGenerator(fn.apply(this, arguments)); | ||
}; | ||
}, | ||
await: function (value) { | ||
return new AwaitValue(value); | ||
} | ||
}; | ||
}(); | ||
var toConsumableArray = function (arr) { | ||
@@ -665,0 +570,0 @@ if (Array.isArray(arr)) { |
@@ -1,2 +0,2 @@ | ||
// bellajs@7.2.0, by @ndaidong - built on Thu, 02 Nov 2017 13:10:05 GMT - published under MIT license | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.bella={})}(this,function(n){"use strict";var r=function(n){return{}.toString.call(n)},t=function(n){return"[object Null]"===r(n)},e=function(n){return"[object Undefined]"===r(n)},o=function(n){return"[object String]"===r(n)},u=function(n){return"[object Number]"===r(n)},i=function(n){return Number.isInteger(n)},a=function(n){return Array.isArray(n)},c=function(n){return"[object Object]"===r(n)&&!a(n)},f=function(n){return n instanceof Date&&!isNaN(n.valueOf())},l=function(n){return!n||e(n)||t(n)||o(n)&&""===n||a(n)&&"[]"===JSON.stringify(n)||c(n)&&"{}"===JSON.stringify(n)},s=function(n,r){return!(!n||!r)&&Object.prototype.hasOwnProperty.call(n,r)},h=Number.MAX_SAFE_INTEGER,g=function(n,r){if((!n||n<0)&&(n=0),r||(r=h),n===r)return r;n>r&&(n=Math.min(n,r),r=Math.max(n,r));var t=n,e=r-n+1;return Math.floor(Math.random()*e)+t},v=function(n){var r=u(n)?String(n):n;if(!o(r))throw new Error("InvalidInput: String required.");return r},p=function(n){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=v(n);return(t=t.replace(/^[\s\xa0]+|[\s\xa0]+$/g,""))&&r&&(t=t.replace(/\r?\n|\r/g," ").replace(/\s\s+|\r/g," ")),t},d=function(n){var r=v(n);return 1===r.length?r.toUpperCase():(r=r.toLowerCase()).charAt(0).toUpperCase()+r.slice(1)},m=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0",e=v(n);return e.length>=r?e:new Array(r-e.length+1).join(t)+e},y=function n(r,t,e){var i=v(r);if(u(t)&&(t=String(t)),u(e)&&(e=String(e)),o(t)&&o(e)){var c=i.split(t);i=c.join(e)}else if(a(t)&&o(e))t.forEach(function(r){i=n(i,r,e)});else if(a(t)&&a(e)&&t.length===e.length){var f=t.length;if(f>0)for(var l=0;l<f;l++){var s=t[l],h=e[l];i=n(i,s,h)}}return i},w=function(n){var r=v(n),t={a:"á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ|ä",A:"Á|À|Ả|Ã|Ạ|Ă|Ắ|Ặ|Ằ|Ẳ|Ẵ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ|Ä",c:"ç",C:"Ç",d:"đ",D:"Đ",e:"é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ|ë",E:"É|È|Ẻ|Ẽ|Ẹ|Ê|Ế|Ề|Ể|Ễ|Ệ|Ë",i:"í|ì|ỉ|ĩ|ị|ï|î",I:"Í|Ì|Ỉ|Ĩ|Ị|Ï|Î",o:"ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ|ö",O:"Ó|Ò|Ỏ|Õ|Ọ|Ô|Ố|Ồ|Ổ|Ô|Ộ|Ơ|Ớ|Ờ|Ở|Ỡ|Ợ|Ö",u:"ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự|û",U:"Ú|Ù|Ủ|Ũ|Ụ|Ư|Ứ|Ừ|Ử|Ữ|Ự|Û",y:"ý|ỳ|ỷ|ỹ|ỵ",Y:"Ý|Ỳ|Ỷ|Ỹ|Ỵ"},e=function(n,t){r=y(r,n,t)};for(var o in t)!function(n){s(t,n)&&t[n].split("|").forEach(function(r){return e(r,n)})}(o);return r},b=function(n,r){var t=[];return r&&(o(r)||c(r)||a(r))?function n(r,e,i){i&&t.push(i);var f=[];for(var l in e)if(s(e,l)){var h=e[l];if(u(h)&&(h=String(h)),c(h)||a(h))f.push({key:l,data:h});else if(o(h)){h=y(h,["{","}"],["{","}"]);var g=t.concat([l]),v=new RegExp("{"+g.join(".")+"}","gi");r=r.replace(v,h)}}return f.length>0&&f.forEach(function(t){r=n(r,t.data,t.key)}),p(r,!0)}(n,r):n},j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],M=["January","February","March","April","May","June","July","August","September","October","November","December"],A=function(){return new Date},D=function(){return Date.now()},I=A().getTimezoneOffset(),S=function(){var n=Math.abs(I/60);return["GMT",I<0?"+":"-",m(n,4)].join("")}(),E=function(n){return String(n<10?"0"+n:n)},N=function(n){var r=n+" ",t=r.charAt(r.length-2);return r="1"===t?"st":"2"===t?"nd":"3"===t?"rd":"th"},x=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"D, M d, Y h:i:s A",t=f(n)?n:new Date(n);if(!f(t))throw new Error("InvalidInput: Number or Date required.");if(!o(r))throw new Error("Invalid output pattern.");var e=r.match(/(\.*)a{1}(\.*)*/i),u=j,i=M,a={Y:function(){return t.getFullYear()},y:function(){return(a.Y()+"").slice(-2)},F:function(){return i[a.n()-1]},M:function(){return(a.F()+"").slice(0,3)},m:function(){return E(a.n())},n:function(){return t.getMonth()+1},S:function(){return N(a.j())},j:function(){return t.getDate()},d:function(){return E(a.j())},t:function(){return new Date(a.Y(),a.n(),0).getDate()},w:function(){return t.getDay()},l:function(){return u[a.w()]},D:function(){return(a.l()+"").slice(0,3)},G:function(){return t.getHours()},g:function(){return a.G()%12||12},h:function(){return E(e?a.g():a.G())},i:function(){return E(t.getMinutes())},s:function(){return E(t.getSeconds())},a:function(){return a.G()>11?"pm":"am"},A:function(){return a.a().toUpperCase()},O:function(){return S}};return r.replace(/\.*\\?([a-z])/gi,function(n,r){return a[n]?a[n]():r})},O=(function(){function n(n){this.value=n}function r(r){function t(o,u){try{var i=r[o](u),a=i.value;a instanceof n?Promise.resolve(a.value).then(function(n){t("next",n)},function(n){t("throw",n)}):e(i.done?"return":"normal",i.value)}catch(n){e("throw",n)}}function e(n,r){switch(n){case"return":o.resolve({value:r,done:!0});break;case"throw":o.reject(r);break;default:o.resolve({value:r,done:!1})}(o=o.next)?t(o.key,o.arg):u=null}var o,u;this._invoke=function(n,r){return new Promise(function(e,i){var a={key:n,arg:r,resolve:e,reject:i,next:null};u?u=u.next=a:(o=u=a,t(n,r))})},"function"!=typeof r.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(r.prototype[Symbol.asyncIterator]=function(){return this}),r.prototype.next=function(n){return this._invoke("next",n)},r.prototype.throw=function(n){return this._invoke("throw",n)},r.prototype.return=function(n){return this._invoke("return",n)}}(),function(n){if(Array.isArray(n)){for(var r=0,t=Array(n.length);r<n.length;r++)t[r]=n[r];return t}return Array.from(n)}),k=function n(r){if(f(r))return new Date(r.valueOf());var t=function(r){var t=Object.create({});for(var e in r)s(r,e)&&(t[e]=n(r[e]));return t};return a(r)?function r(e){return[].concat(O(e)).map(function(e){return a(e)?r(e):c(e)?t(e):n(e)})}(r):c(r)?t(r):r};n.curry=function(n){return function r(t,e){return t>0?function(){for(var n=arguments.length,o=Array(n),u=0;u<n;u++)o[u]=arguments[u];return r(t-o.length,[].concat(O(e),o))}:n.apply(void 0,O(e))}(n.length,[])},n.compose=function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return r.reduce(function(n,r){return function(t){return n(r(t))}})},n.pipe=function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return r.reduce(function(n,r){return function(t){return r(n(t))}})},n.clone=k,n.copies=function n(r,t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];for(var u in r)if(!(o.length>0&&o.includes(u))&&(!e||e&&t.hasOwnProperty(u))){var i=r[u],f=t[u];c(f)&&c(i)||a(f)&&a(i)?t[u]=n(i,t[u],e,o):t[u]=k(i)}return t},n.unique=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[].concat(O(new Set(n)))},n.isNull=t,n.isUndefined=e,n.isFunction=function(n){return"[object Function]"===r(n)},n.isString=o,n.isNumber=u,n.isInteger=i,n.isArray=a,n.isObject=c,n.isBoolean=function(n){return!0===n||!1===n},n.isDate=f,n.isElement=function(n){return r(n).match(/^\[object HTML\w*Element]$/)},n.isLetter=function(n){return o(n)&&/^[a-z]+$/i.test(n)},n.isEmail=function(n){return o(n)&&/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(n)},n.isEmpty=l,n.hasProperty=s,n.equals=function n(r,t){var e=!0;if(l(r)&&l(t))return!0;if(f(r)&&f(t))return r.getTime()===t.getTime();if(u(r)&&u(t)||o(r)&&o(t))return r===t;if(a(r)&&a(t)){if(r.length!==t.length)return!1;if(r.length>0)for(var i=0,h=r.length;i<h;i++)if(!n(r[i],t[i])){e=!1;break}}else if(c(r)&&c(t)){var g=[],v=[];for(var p in r)s(r,p)&&g.push(p);for(var d in t)s(t,d)&&v.push(d);if(g.length!==v.length)return!1;for(var m in r)if(!s(t,m)||!n(r[m],t[m])){e=!1;break}}return e},n.encode=function(n){var r=v(n);return encodeURIComponent(r)},n.decode=function(n){var r=v(n);return decodeURIComponent(r.replace(/\+/g," "))},n.trim=p,n.truncate=function(n,r){var t=v(n),e=r||140;if(t.length<=e)return t;var o=t.substring(0,e),u=o.split(" "),i="";return u.length>1?(u.pop(),(i+=u.join(" ")).length<t.length&&(i+="...")):i=(o=o.substring(0,e-3))+"...",i},n.stripTags=function(n){var r=v(n);return p(r.replace(/<.*?>/gi," ").replace(/\s\s+/g," "))},n.escapeHTML=function(n){return v(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},n.unescapeHTML=function(n){return v(n).replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},n.ucfirst=d,n.ucwords=function(n){var r=[];return v(n).split(" ").forEach(function(n){r.push(d(n))}),r.join(" ")},n.leftPad=m,n.rightPad=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0",e=v(n);return e.length>=r?e:e+new Array(r-e.length+1).join(t)},n.repeat=function(n,r){var t=v(n);if(!i(r)||r<1)return t;if(t.length*r>=1<<28)throw new RangeError("Repeat count must not overflow maximum string size.");var e=[];return e.length=r,e.fill(t,0,r).join("")},n.replaceAll=y,n.stripAccent=w,n.createId=function(n){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t="abcdefghijklmnopqrstuvwxyz",e=[t,t.toUpperCase(),"0123456789"].join("").split("").sort(function(){return Math.random()>.5}).join(""),o=e.length,u=Math.max(n||32,r.length),i=r;i.length<u;){var a=g(0,o);i+=e.charAt(a)||""}return i},n.createAlias=function(n,r){var t=p(w(n)),e=r||"-";return t.toLowerCase().replace(/\W+/g," ").replace(/\s+/g," ").replace(/\s/g,e)},n.template=function(n){return{compile:function(r){return b(n,r)}}},n.random=g,n.now=A,n.time=D,n.format=x,n.relativize=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D(),r=f(n)?n:new Date(n);if(!f(r))throw new Error("InvalidInput: Number or Date required.");var t=A()-r,e=parseInt(r,10);if(isNaN(e)&&(e=0),t<=e)return"Just now";var o=null,u={millisecond:1,second:1e3,minute:60,hour:60,day:24,month:30,year:12};for(var i in u){if(t<u[i])break;o=i,t/=u[i]}return 1!==(t=Math.floor(t))&&(o+="s"),[t,o].join(" ")+" ago"},n.utc=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D(),r=f(n)?n:new Date(n);if(!f(r))throw new Error("InvalidInput: Number or Date required.");var t=r.getMinutes(),e=new Date(r);return e.setMinutes(t+I),x(e,"D, j M Y h:i:s")+" GMT+0000"},n.local=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D(),r=f(n)?n:new Date(n);if(!f(r))throw new Error("InvalidInput: Number or Date required.");return x(r,"D, j M Y h:i:s O")},n.md5=function(n){for(var r=[],t=0;t<64;)r[t]=0|4294967296*Math.abs(Math.sin(++t));for(var e,o,u,i,a=[],c=unescape(encodeURI(n)),f=c.length,l=[e=1732584193,o=-271733879,~e,~o],t=0;t<=f;)a[t>>2]|=(c.charCodeAt(t)||128)<<t++%4*8;for(a[n=16*(f+8>>6)+14]=8*f,t=0;t<n;t+=16){for(f=l,i=0;i<64;)f=[u=f[3],(e=0|f[1])+((u=f[0]+[e&(o=f[2])|~e&u,u&e|~u&o,e^o^u,o^(e|~u)][f=i>>4]+(r[i]+(0|a[[i,5*i+1,3*i+5,7*i][f]%16+t])))<<(f=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*f+i++%4])|u>>>32-f),e,o];for(i=4;i;)l[--i]=l[i]+f[i]}for(n="";i<32;)n+=(l[i>>3]>>4*(1^7&i++)&15).toString(16);return n},Object.defineProperty(n,"__esModule",{value:!0})}); | ||
// bellajs@7.2.1, by @ndaidong - built on Mon, 07 May 2018 09:33:49 GMT - published under MIT license | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.bella={})}(this,function(n){"use strict";var r,e=function(n){return{}.toString.call(n)},t=function(n){return"[object Null]"===e(n)},i=function(n){return"[object Undefined]"===e(n)},u=function(n){return"[object String]"===e(n)},o=function(n){return"[object Number]"===e(n)},a=function(n){return Number.isInteger(n)},c=function(n){return Array.isArray(n)},f=function(n){return"[object Object]"===e(n)&&!c(n)},l=function(n){return n instanceof Date&&!isNaN(n.valueOf())},s=function(n){return!n||i(n)||t(n)||u(n)&&""===n||c(n)&&"[]"===JSON.stringify(n)||f(n)&&"{}"===JSON.stringify(n)},g=function(n,r){return!(!n||!r)&&Object.prototype.hasOwnProperty.call(n,r)},h=Number.MAX_SAFE_INTEGER,p=function(n,r){if((!n||n<0)&&(n=0),r||(r=h),n===r)return r;n>r&&(n=Math.min(n,r),r=Math.max(n,r));var e=n,t=r-n+1;return Math.floor(Math.random()*t)+e},v=function(n){var r=o(n)?String(n):n;if(!u(r))throw new Error("InvalidInput: String required.");return r},d=function(n){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=v(n);return(e=e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,""))&&r&&(e=e.replace(/\r?\n|\r/g," ").replace(/\s\s+|\r/g," ")),e},m=function(n){var r=v(n);return 1===r.length?r.toUpperCase():(r=r.toLowerCase()).charAt(0).toUpperCase()+r.slice(1)},w=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0",t=v(n);return t.length>=r?t:new Array(r-t.length+1).join(e)+t},y=function n(r,e,t){var i=v(r);if(o(e)&&(e=String(e)),o(t)&&(t=String(t)),u(e)&&u(t)){var a=i.split(e);i=a.join(t)}else if(c(e)&&u(t))e.forEach(function(r){i=n(i,r,t)});else if(c(e)&&c(t)&&e.length===t.length){var f=e.length;if(f>0)for(var l=0;l<f;l++){var s=e[l],g=t[l];i=n(i,s,g)}}return i},b=function(n){var r=v(n),e={a:"á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ|ä",A:"Á|À|Ả|Ã|Ạ|Ă|Ắ|Ặ|Ằ|Ẳ|Ẵ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ|Ä",c:"ç",C:"Ç",d:"đ",D:"Đ",e:"é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ|ë",E:"É|È|Ẻ|Ẽ|Ẹ|Ê|Ế|Ề|Ể|Ễ|Ệ|Ë",i:"í|ì|ỉ|ĩ|ị|ï|î",I:"Í|Ì|Ỉ|Ĩ|Ị|Ï|Î",o:"ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ|ö",O:"Ó|Ò|Ỏ|Õ|Ọ|Ô|Ố|Ồ|Ổ|Ô|Ộ|Ơ|Ớ|Ờ|Ở|Ỡ|Ợ|Ö",u:"ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự|û",U:"Ú|Ù|Ủ|Ũ|Ụ|Ư|Ứ|Ừ|Ử|Ữ|Ự|Û",y:"ý|ỳ|ỷ|ỹ|ỵ",Y:"Ý|Ỳ|Ỷ|Ỹ|Ỵ"},t=function(n){g(e,n)&&e[n].split("|").forEach(function(e){return function(n,e){r=y(r,n,e)}(e,n)})};for(var i in e)t(i);return r},j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],M=["January","February","March","April","May","June","July","August","September","October","November","December"],A=function(){return new Date},D=function(){return Date.now()},E=A().getTimezoneOffset(),I=(r=Math.abs(E/60),["GMT",E<0?"+":"-",w(r,4)].join("")),S=function(n){return String(n<10?"0"+n:n)},N=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"D, M d, Y h:i:s A",e=l(n)?n:new Date(n);if(!l(e))throw new Error("InvalidInput: Number or Date required.");if(!u(r))throw new Error("Invalid output pattern.");var t=r.match(/(\.*)a{1}(\.*)*/i),i=j,o=M,a={Y:function(){return e.getFullYear()},y:function(){return(a.Y()+"").slice(-2)},F:function(){return o[a.n()-1]},M:function(){return(a.F()+"").slice(0,3)},m:function(){return S(a.n())},n:function(){return e.getMonth()+1},S:function(){return n=a.j(),e=(r=n+" ").charAt(r.length-2),r="1"===e?"st":"2"===e?"nd":"3"===e?"rd":"th";var n,r,e},j:function(){return e.getDate()},d:function(){return S(a.j())},t:function(){return new Date(a.Y(),a.n(),0).getDate()},w:function(){return e.getDay()},l:function(){return i[a.w()]},D:function(){return(a.l()+"").slice(0,3)},G:function(){return e.getHours()},g:function(){return a.G()%12||12},h:function(){return S(t?a.g():a.G())},i:function(){return S(e.getMinutes())},s:function(){return S(e.getSeconds())},a:function(){return a.G()>11?"pm":"am"},A:function(){return a.a().toUpperCase()},O:function(){return I}};return r.replace(/\.*\\?([a-z])/gi,function(n,r){return a[n]?a[n]():r})},O=function(n){if(Array.isArray(n)){for(var r=0,e=Array(n.length);r<n.length;r++)e[r]=n[r];return e}return Array.from(n)},T=function n(r){if(l(r))return new Date(r.valueOf());var e=function(r){var e=Object.create({});for(var t in r)g(r,t)&&(e[t]=n(r[t]));return e};return c(r)?function r(t){return[].concat(O(t)).map(function(t){return c(t)?r(t):f(t)?e(t):n(t)})}(r):f(r)?e(r):r};n.curry=function(n){return function r(e,t){return e>0?function(){for(var n=arguments.length,i=Array(n),u=0;u<n;u++)i[u]=arguments[u];return r(e-i.length,[].concat(O(t),i))}:n.apply(void 0,O(t))}(n.length,[])},n.compose=function(){for(var n=arguments.length,r=Array(n),e=0;e<n;e++)r[e]=arguments[e];return r.reduce(function(n,r){return function(e){return n(r(e))}})},n.pipe=function(){for(var n=arguments.length,r=Array(n),e=0;e<n;e++)r[e]=arguments[e];return r.reduce(function(n,r){return function(e){return r(n(e))}})},n.clone=T,n.copies=function n(r,e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];for(var u in r)if(!(i.length>0&&i.includes(u))&&(!t||t&&e.hasOwnProperty(u))){var o=r[u],a=e[u];f(a)&&f(o)||c(a)&&c(o)?e[u]=n(o,e[u],t,i):e[u]=T(o)}return e},n.unique=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[].concat(O(new Set(n)))},n.isNull=t,n.isUndefined=i,n.isFunction=function(n){return"[object Function]"===e(n)},n.isString=u,n.isNumber=o,n.isInteger=a,n.isArray=c,n.isObject=f,n.isBoolean=function(n){return!0===n||!1===n},n.isDate=l,n.isElement=function(n){return e(n).match(/^\[object HTML\w*Element]$/)},n.isLetter=function(n){return u(n)&&/^[a-z]+$/i.test(n)},n.isEmail=function(n){return u(n)&&/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(n)},n.isEmpty=s,n.hasProperty=g,n.equals=function n(r,e){var t=!0;if(s(r)&&s(e))return!0;if(l(r)&&l(e))return r.getTime()===e.getTime();if(o(r)&&o(e)||u(r)&&u(e))return r===e;if(c(r)&&c(e)){if(r.length!==e.length)return!1;if(r.length>0)for(var i=0,a=r.length;i<a;i++)if(!n(r[i],e[i])){t=!1;break}}else if(f(r)&&f(e)){var h=[],p=[];for(var v in r)g(r,v)&&h.push(v);for(var d in e)g(e,d)&&p.push(d);if(h.length!==p.length)return!1;for(var m in r)if(!g(e,m)||!n(r[m],e[m])){t=!1;break}}return t},n.encode=function(n){var r=v(n);return encodeURIComponent(r)},n.decode=function(n){var r=v(n);return decodeURIComponent(r.replace(/\+/g," "))},n.trim=d,n.truncate=function(n,r){var e=v(n),t=r||140;if(e.length<=t)return e;var i=e.substring(0,t),u=i.split(" "),o="";return u.length>1?(u.pop(),(o+=u.join(" ")).length<e.length&&(o+="...")):o=(i=i.substring(0,t-3))+"...",o},n.stripTags=function(n){var r=v(n);return d(r.replace(/<.*?>/gi," ").replace(/\s\s+/g," "))},n.escapeHTML=function(n){return v(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},n.unescapeHTML=function(n){return v(n).replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},n.ucfirst=m,n.ucwords=function(n){var r=[];return v(n).split(" ").forEach(function(n){r.push(m(n))}),r.join(" ")},n.leftPad=w,n.rightPad=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0",t=v(n);return t.length>=r?t:t+new Array(r-t.length+1).join(e)},n.repeat=function(n,r){var e=v(n);if(!a(r)||r<1)return e;if(e.length*r>=1<<28)throw new RangeError("Repeat count must not overflow maximum string size.");var t=[];return t.length=r,t.fill(e,0,r).join("")},n.replaceAll=y,n.stripAccent=b,n.createId=function(n){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e="abcdefghijklmnopqrstuvwxyz",t=[e,e.toUpperCase(),"0123456789"].join("").split("").sort(function(){return Math.random()>.5}).join(""),i=t.length,u=Math.max(n||32,r.length),o=r;o.length<u;){var a=p(0,i);o+=t.charAt(a)||""}return o},n.createAlias=function(n,r){var e=d(b(n)),t=r||"-";return e.toLowerCase().replace(/\W+/g," ").replace(/\s+/g," ").replace(/\s/g,t)},n.template=function(n){return{compile:function(r){return function(n,r){var e=[];return r&&(u(r)||f(r)||c(r))?function n(r,t,i){i&&e.push(i);var a=[];for(var l in t)if(g(t,l)){var s=t[l];if(o(s)&&(s=String(s)),f(s)||c(s))a.push({key:l,data:s});else if(u(s)){s=y(s,["{","}"],["{","}"]);var h=e.concat([l]),p=new RegExp("{"+h.join(".")+"}","gi");r=r.replace(p,s)}}return a.length>0&&a.forEach(function(e){r=n(r,e.data,e.key)}),d(r,!0)}(n,r):n}(n,r)}}},n.random=p,n.now=A,n.time=D,n.format=N,n.relativize=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D(),r=l(n)?n:new Date(n);if(!l(r))throw new Error("InvalidInput: Number or Date required.");var e=A()-r,t=parseInt(r,10);if(isNaN(t)&&(t=0),e<=t)return"Just now";var i=null,u={millisecond:1,second:1e3,minute:60,hour:60,day:24,month:30,year:12};for(var o in u){if(e<u[o])break;i=o,e/=u[o]}return 1!==(e=Math.floor(e))&&(i+="s"),[e,i].join(" ")+" ago"},n.utc=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D(),r=l(n)?n:new Date(n);if(!l(r))throw new Error("InvalidInput: Number or Date required.");var e=r.getMinutes(),t=new Date(r);return t.setMinutes(e+E),N(t,"D, j M Y h:i:s")+" GMT+0000"},n.local=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D(),r=l(n)?n:new Date(n);if(!l(r))throw new Error("InvalidInput: Number or Date required.");return N(r,"D, j M Y h:i:s O")},n.md5=function(n){for(var r=[],e=0;e<64;)r[e]=0|4294967296*Math.abs(Math.sin(++e));var t,i,u,o,a=[],c=unescape(encodeURI(n)),f=c.length,l=[t=1732584193,i=-271733879,~t,~i];for(e=0;e<=f;)a[e>>2]|=(c.charCodeAt(e)||128)<<e++%4*8;for(a[n=16*(f+8>>6)+14]=8*f,e=0;e<n;e+=16){for(f=l,o=0;o<64;)f=[u=f[3],(t=0|f[1])+((u=f[0]+[t&(i=f[2])|~t&u,u&t|~u&i,t^i^u,i^(t|~u)][f=o>>4]+(r[o]+(0|a[[o,5*o+1,3*o+5,7*o][f]%16+e])))<<(f=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*f+o++%4])|u>>>32-f),t,i];for(o=4;o;)l[--o]=l[o]+f[o]}for(n="";o<32;)n+=(l[o>>3]>>4*(1^7&o++)&15).toString(16);return n},Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"version": "7.2.0", | ||
"version": "7.2.1", | ||
"name": "bellajs", | ||
@@ -31,16 +31,16 @@ "description": "A useful helper for any javascript program", | ||
"devDependencies": { | ||
"babel-cli": "6.x.x", | ||
"babel-preset-env": "1.x.x", | ||
"codecov": "3.x.x", | ||
"eslint": "4.x.x", | ||
"eslint-config-ggc": "1.x.x", | ||
"gcc-min": "6.x.x", | ||
"is": "3.x.x", | ||
"jsdom": "11.x.x", | ||
"jsdom-global": "3.x.x", | ||
"nsp": "2.x.x", | ||
"nyc": "11.x.x", | ||
"sinon": "4.x.x", | ||
"tap-spec": "4.x.x", | ||
"tape": "4.x.x" | ||
"babel-cli": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"codecov": "^3.0.1", | ||
"eslint": "^4.19.1", | ||
"eslint-config-goes": "^1.0.0", | ||
"gcc-min": "^6.0.3", | ||
"is": "^3.2.1", | ||
"jsdom": "^11.10.0", | ||
"jsdom-global": "^3.0.2", | ||
"nsp": "^3.2.1", | ||
"nyc": "^11.7.1", | ||
"sinon": "^5.0.5", | ||
"tap-spec": "^4.1.1", | ||
"tape": "^4.9.0" | ||
}, | ||
@@ -47,0 +47,0 @@ "babel": { |
20
reset.js
#!/usr/bin/env node | ||
var { | ||
const { | ||
existsSync, | ||
unlinkSync | ||
unlinkSync, | ||
} = require('fs'); | ||
var exec = require('child_process').execSync; | ||
var dirs = [ | ||
const {execSync} = require('child_process'); | ||
const dirs = [ | ||
'dist', | ||
'docs', | ||
'.nyc_output', | ||
'coverage', | ||
'node_modules' | ||
'node_modules', | ||
'.nuxt', | ||
]; | ||
var files = [ | ||
const files = [ | ||
'yarn.lock', | ||
'package-lock.json', | ||
'coverage.lcov' | ||
'coverage.lcov', | ||
]; | ||
dirs.forEach((d) => { | ||
exec(`rm -rf ${d}`); | ||
execSync(`rm -rf ${d}`); | ||
}); | ||
@@ -24,0 +28,0 @@ |
@@ -10,3 +10,3 @@ /** | ||
isDate, | ||
hasProperty | ||
hasProperty, | ||
} from './utils/detection'; | ||
@@ -28,7 +28,7 @@ | ||
export const compose = (...fns) => { | ||
return fns.reduce((f, g) => x => f(g(x))); | ||
return fns.reduce((f, g) => (x) => f(g(x))); | ||
}; | ||
export const pipe = (...fns) => { | ||
return fns.reduce((f, g) => x => g(f(x))); | ||
return fns.reduce((f, g) => (x) => g(f(x))); | ||
}; | ||
@@ -38,3 +38,2 @@ | ||
export const clone = (val) => { | ||
if (isDate(val)) { | ||
@@ -41,0 +40,0 @@ return new Date(val.valueOf()); |
@@ -5,7 +5,7 @@ // utils / date | ||
isDate, | ||
isString | ||
isString, | ||
} from './detection'; | ||
import { | ||
leftPad | ||
leftPad, | ||
} from './string'; | ||
@@ -16,3 +16,3 @@ | ||
const WEEKDAYS = [ | ||
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' | ||
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', | ||
]; | ||
@@ -23,3 +23,3 @@ | ||
'May', 'June', 'July', 'August', | ||
'September', 'October', 'November', 'December' | ||
'September', 'October', 'November', 'December', | ||
]; | ||
@@ -37,3 +37,3 @@ | ||
var tz = (() => { | ||
const tz = (() => { | ||
let z = Math.abs(tzone / 60); | ||
@@ -65,3 +65,2 @@ let sign = tzone < 0 ? '+' : '-'; | ||
export let format = (input, output = PATTERN) => { | ||
let d = isDate(input) ? input : new Date(input); | ||
@@ -148,3 +147,3 @@ if (!isDate(d)) { | ||
}; | ||
/*eslint-enable */ | ||
/* eslint-enable */ | ||
@@ -159,3 +158,2 @@ let _term = (t, s) => { | ||
export let relativize = (input = time()) => { | ||
let d = isDate(input) ? input : new Date(input); | ||
@@ -182,3 +180,3 @@ if (!isDate(d)) { | ||
month: 30, | ||
year: 12 | ||
year: 12, | ||
}; | ||
@@ -185,0 +183,0 @@ for (let key in conversions) { |
// utils / detection | ||
var ob2Str = (val) => { | ||
const ob2Str = (val) => { | ||
return {}.toString.call(val); | ||
@@ -73,2 +73,2 @@ }; | ||
return Object.prototype.hasOwnProperty.call(ob, k); | ||
}; | ||
}; |
@@ -10,3 +10,3 @@ // utils / equals | ||
isDate, | ||
hasProperty | ||
hasProperty, | ||
} from './detection'; | ||
@@ -61,2 +61,2 @@ | ||
return re; | ||
}; | ||
}; |
@@ -70,2 +70,2 @@ // utils / md5 | ||
/*eslint-enable*/ | ||
/* eslint-enable*/ |
@@ -22,2 +22,3 @@ // utils / random | ||
return Math.floor(Math.random() * range) + offset; | ||
}; | ||
}; | ||
@@ -9,3 +9,3 @@ // utils / string | ||
isInteger, | ||
hasProperty | ||
hasProperty, | ||
} from './detection'; | ||
@@ -131,3 +131,2 @@ | ||
export const replaceAll = (s, a, b) => { | ||
let x = toString(s); | ||
@@ -163,3 +162,2 @@ | ||
export const stripAccent = (s) => { | ||
let x = toString(s); | ||
@@ -183,3 +181,3 @@ | ||
y: 'ý|ỳ|ỷ|ỹ|ỵ', | ||
Y: 'Ý|Ỳ|Ỷ|Ỹ|Ỵ' | ||
Y: 'Ý|Ỳ|Ỷ|Ỹ|Ỵ', | ||
}; | ||
@@ -209,3 +207,3 @@ | ||
uc, | ||
nb | ||
nb, | ||
].join('').split('').sort(() => { | ||
@@ -235,3 +233,3 @@ return Math.random() > 0.5; | ||
// Define bella.template | ||
var compile = (tpl, data) => { | ||
const compile = (tpl, data) => { | ||
let ns = []; | ||
@@ -252,3 +250,3 @@ let c = (s, ctx, namespace) => { | ||
key: k, | ||
data: v | ||
data: v, | ||
}); | ||
@@ -258,6 +256,6 @@ } else if (isString(v)) { | ||
'{', | ||
'}' | ||
'}', | ||
], [ | ||
'{', | ||
'}' | ||
'}', | ||
]); | ||
@@ -287,4 +285,4 @@ let cns = ns.concat([k]); | ||
return compile(tpl, data); | ||
} | ||
}, | ||
}; | ||
}; | ||
}; |
@@ -1,7 +0,7 @@ | ||
var es6Bella = require('../src/main'); | ||
var fullBella = require('../dist/bella'); | ||
var minBella = require('../dist/bella.min'); | ||
const es6Bella = require('../src/main'); | ||
const fullBella = require('../dist/bella'); | ||
const minBella = require('../dist/bella.min'); | ||
module.exports = { | ||
variants: [es6Bella, fullBella, minBella] | ||
variants: [es6Bella, fullBella, minBella], | ||
}; |
@@ -6,8 +6,8 @@ /** | ||
var fs = require('fs'); | ||
var test = require('tape'); | ||
const fs = require('fs'); | ||
const test = require('tape'); | ||
var pkgFake = require('../../package.json'); | ||
var proFile = './dist/bella.js'; | ||
var devFile = './dist/bella.min.js'; | ||
const pkgFake = require('../../package.json'); | ||
const proFile = './dist/bella.js'; | ||
const devFile = './dist/bella.min.js'; | ||
@@ -14,0 +14,0 @@ test('Validate production output', (assert) => { |
@@ -13,8 +13,8 @@ /** | ||
var test = require('tape'); | ||
var is = require('is'); | ||
const test = require('tape'); | ||
const is = require('is'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
var stringify = (x) => { | ||
const stringify = (x) => { | ||
if (is.array(x) || is.object(x)) { | ||
@@ -45,6 +45,6 @@ x = JSON.stringify(x); | ||
undefined, | ||
function x() {} | ||
function x() {}, | ||
].forEach((item) => { | ||
let r = bella.isElement(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must be not element.`); | ||
@@ -63,9 +63,9 @@ }); | ||
2, | ||
3 | ||
3, | ||
], | ||
new Array(), | ||
new Array(5) | ||
new Array(5), | ||
].forEach((item) => { | ||
let r = bella.isArray(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be an array.`); | ||
@@ -85,6 +85,6 @@ }); | ||
undefined, | ||
function x() {} | ||
function x() {}, | ||
].forEach((item) => { | ||
let r = bella.isArray(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must be not array.`); | ||
@@ -101,6 +101,6 @@ }); | ||
{a: 1, b: 0}, | ||
Object.create({}) | ||
Object.create({}), | ||
].forEach((item) => { | ||
let r = bella.isObject(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be an object.`); | ||
@@ -117,6 +117,6 @@ }); | ||
[], | ||
new Date() | ||
new Date(), | ||
].forEach((item) => { | ||
let r = bella.isObject(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must be not object.`); | ||
@@ -135,6 +135,6 @@ }); | ||
'undefined', | ||
String(1000) | ||
String(1000), | ||
].forEach((item) => { | ||
let r = bella.isString(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be an string.`); | ||
@@ -149,6 +149,6 @@ }); | ||
Number('1000'), | ||
0 | ||
0, | ||
].forEach((item) => { | ||
let r = bella.isString(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must be not string.`); | ||
@@ -164,6 +164,6 @@ }); | ||
true, | ||
2 - 1 === 1 | ||
2 - 1 === 1, | ||
].forEach((item) => { | ||
let r = bella.isBoolean(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be true.`); | ||
@@ -183,6 +183,6 @@ }); | ||
undefined, | ||
function x() {} | ||
function x() {}, | ||
].forEach((item) => { | ||
let r = bella.isBoolean(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must be false.`); | ||
@@ -197,3 +197,3 @@ }); | ||
let r = bella.isDate(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be date.`); | ||
@@ -213,6 +213,6 @@ }); | ||
undefined, | ||
function x() {} | ||
function x() {}, | ||
].forEach((item) => { | ||
let r = bella.isDate(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must not be date.`); | ||
@@ -228,6 +228,6 @@ }); | ||
'bob.nany@live.com', | ||
'bob.nany@live.com.vn' | ||
'bob.nany@live.com.vn', | ||
].forEach((item) => { | ||
let r = bella.isEmail(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be email.`); | ||
@@ -243,6 +243,6 @@ }); | ||
undefined, | ||
0 | ||
0, | ||
].forEach((item) => { | ||
let r = bella.isEmail(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must not be email.`); | ||
@@ -262,6 +262,6 @@ }); | ||
[], | ||
Object.create({}) | ||
Object.create({}), | ||
].forEach((item) => { | ||
let r = bella.isEmpty(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be empty.`); | ||
@@ -276,8 +276,8 @@ }); | ||
1, | ||
3 | ||
3, | ||
], | ||
function x() {} | ||
function x() {}, | ||
].forEach((item) => { | ||
let r = bella.isEmpty(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must not be empty.`); | ||
@@ -293,6 +293,6 @@ }); | ||
function x() {}, | ||
new Function() | ||
new Function(), | ||
].forEach((item) => { | ||
let r = bella.isFunction(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be function.`); | ||
@@ -308,3 +308,3 @@ }); | ||
1, | ||
3 | ||
3, | ||
], | ||
@@ -315,6 +315,6 @@ something, | ||
[], | ||
Object.create({}) | ||
Object.create({}), | ||
].forEach((item) => { | ||
let r = bella.isFunction(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must not be function.`); | ||
@@ -331,6 +331,6 @@ }); | ||
9, | ||
0 | ||
0, | ||
].forEach((item) => { | ||
let r = bella.isInteger(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be integer.`); | ||
@@ -347,6 +347,6 @@ }); | ||
null, | ||
undefined | ||
undefined, | ||
].forEach((item) => { | ||
let r = bella.isInteger(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must not be integer.`); | ||
@@ -363,6 +363,6 @@ }); | ||
'ABC', | ||
'AbCd' | ||
'AbCd', | ||
].forEach((item) => { | ||
let r = bella.isLetter(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be letter.`); | ||
@@ -384,6 +384,6 @@ }); | ||
null, | ||
undefined | ||
undefined, | ||
].forEach((item) => { | ||
let r = bella.isLetter(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must not be letter.`); | ||
@@ -403,6 +403,6 @@ }); | ||
9, | ||
0 | ||
0, | ||
].forEach((item) => { | ||
let r = bella.isNumber(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.ok(r, `"${x}" must be number.`); | ||
@@ -417,6 +417,6 @@ }); | ||
undefined, | ||
new Function() | ||
new Function(), | ||
].forEach((item) => { | ||
let r = bella.isNumber(item); | ||
var x = stringify(item); | ||
let x = stringify(item); | ||
assert.error(r, `"${x}" must not be number.`); | ||
@@ -434,3 +434,3 @@ }); | ||
label: 'undefined', | ||
color: 0 | ||
color: 0, | ||
}; | ||
@@ -443,3 +443,3 @@ | ||
'label', | ||
'color' | ||
'color', | ||
]; | ||
@@ -456,3 +456,3 @@ for (let i = 0; i < props.length; i++) { | ||
'__proto__', | ||
'toString' | ||
'toString', | ||
]; | ||
@@ -481,3 +481,3 @@ for (let i = 0; i < fails.length; i++) { | ||
6, | ||
8 | ||
8, | ||
], | ||
@@ -487,5 +487,5 @@ { | ||
b: 4, | ||
c: 6 | ||
c: 6, | ||
}, | ||
t | ||
t, | ||
]; | ||
@@ -501,3 +501,3 @@ let b1 = [ | ||
6, | ||
8 | ||
8, | ||
], | ||
@@ -507,5 +507,5 @@ { | ||
b: 4, | ||
a: 1 | ||
a: 1, | ||
}, | ||
t | ||
t, | ||
]; | ||
@@ -530,3 +530,3 @@ | ||
66, | ||
'ab' | ||
'ab', | ||
], | ||
@@ -539,3 +539,3 @@ 0, | ||
6, | ||
8 | ||
8, | ||
], | ||
@@ -545,5 +545,5 @@ { | ||
b: 4, | ||
c: 6 | ||
c: 6, | ||
}, | ||
at | ||
at, | ||
]; | ||
@@ -559,3 +559,3 @@ let b2 = [ | ||
4, | ||
8 | ||
8, | ||
], | ||
@@ -565,5 +565,5 @@ { | ||
b: 4, | ||
a: 2 | ||
a: 2, | ||
}, | ||
bt | ||
bt, | ||
]; | ||
@@ -582,5 +582,4 @@ | ||
}); | ||
}; | ||
variants.map(checkDetection); |
@@ -6,10 +6,8 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
let checkStringMethods = (bella) => { | ||
test('With well-format string input:', (assert) => { | ||
let methods = [ | ||
@@ -30,3 +28,3 @@ 'encode', | ||
'unescapeHTML', | ||
'replaceAll' | ||
'replaceAll', | ||
]; | ||
@@ -100,3 +98,2 @@ | ||
test('Testing .truncate(String s) method', (assert) => { | ||
let x = 'If a property is non-configurable, its writable attribute can only be changed to false.'; | ||
@@ -112,3 +109,3 @@ let a = bella.truncate(x, 60); | ||
'the 1500s, when an unknown printer took a galley of', | ||
'type and scrambled it to make a type specimen book.' | ||
'type and scrambled it to make a type specimen book.', | ||
].join(' '); | ||
@@ -119,3 +116,3 @@ | ||
'Lorem Ipsum is simply dummy text of the printing and typesetting', | ||
'industry. Lorem Ipsum has been the industry\'s standard dummy text ever...' | ||
'industry. Lorem Ipsum has been the industry\'s standard dummy text ever...', | ||
].join(' '); | ||
@@ -198,3 +195,3 @@ | ||
pad: '0', | ||
expect: '0007' | ||
expect: '0007', | ||
}, | ||
@@ -205,3 +202,3 @@ { | ||
pad: '0', | ||
expect: '123456' | ||
expect: '123456', | ||
}, | ||
@@ -212,3 +209,3 @@ { | ||
pad: '0', | ||
expect: '123456' | ||
expect: '123456', | ||
}, | ||
@@ -219,4 +216,4 @@ { | ||
pad: '0', | ||
expect: '0123456' | ||
} | ||
expect: '0123456', | ||
}, | ||
]; | ||
@@ -244,3 +241,3 @@ | ||
pad: '0', | ||
expect: '7000' | ||
expect: '7000', | ||
}, | ||
@@ -251,3 +248,3 @@ { | ||
pad: '0', | ||
expect: '123456' | ||
expect: '123456', | ||
}, | ||
@@ -258,3 +255,3 @@ { | ||
pad: '0', | ||
expect: '123456' | ||
expect: '123456', | ||
}, | ||
@@ -265,4 +262,4 @@ { | ||
pad: '0', | ||
expect: '1234560' | ||
} | ||
expect: '1234560', | ||
}, | ||
]; | ||
@@ -290,5 +287,5 @@ | ||
b: 'l', | ||
c: '2' | ||
c: '2', | ||
}, | ||
expectation: 'He22o wor2d' | ||
expectation: 'He22o wor2d', | ||
}, | ||
@@ -299,5 +296,5 @@ { | ||
b: 'l', | ||
c: 2 | ||
c: 2, | ||
}, | ||
expectation: 'He22o wor2d' | ||
expectation: 'He22o wor2d', | ||
}, | ||
@@ -308,5 +305,5 @@ { | ||
b: 7, | ||
c: 1 | ||
c: 1, | ||
}, | ||
expectation: '198018961' | ||
expectation: '198018961', | ||
}, | ||
@@ -317,5 +314,5 @@ { | ||
b: ['l', 'o'], | ||
c: ['2', '0'] | ||
c: ['2', '0'], | ||
}, | ||
expectation: 'He220 w0r2d' | ||
expectation: 'He220 w0r2d', | ||
}, | ||
@@ -326,5 +323,5 @@ { | ||
b: ['l', 'o'], | ||
c: '2' | ||
c: '2', | ||
}, | ||
expectation: 'He222 w2r2d' | ||
expectation: 'He222 w2r2d', | ||
}, | ||
@@ -335,5 +332,5 @@ { | ||
b: ['l'], | ||
c: ['2', '0'] | ||
c: ['2', '0'], | ||
}, | ||
expectation: 'Hello world' | ||
expectation: 'Hello world', | ||
}, | ||
@@ -343,24 +340,24 @@ { | ||
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', | ||
}, | ||
]; | ||
@@ -406,6 +403,4 @@ | ||
}); | ||
}; | ||
variants.map(checkStringMethods); |
@@ -6,5 +6,5 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -30,4 +30,4 @@ // compile | ||
name: 'Dong Nguyen', | ||
email: 'ndaidong@gmail.com' | ||
} | ||
email: 'ndaidong@gmail.com', | ||
}, | ||
}; | ||
@@ -34,0 +34,0 @@ |
@@ -6,5 +6,5 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -14,3 +14,2 @@ // clone | ||
test('Testing .clone(Object target) method', (assert) => { | ||
assert.comment('Clone object'); | ||
@@ -22,3 +21,3 @@ let a = { | ||
name: 'Alice', | ||
age: 27 | ||
age: 27, | ||
}, | ||
@@ -28,3 +27,3 @@ birthday: new Date(), | ||
clone: false, | ||
reg: /^\w+@\s([a-z])$/gi | ||
reg: /^\w+@\s([a-z])$/gi, | ||
}; | ||
@@ -51,3 +50,3 @@ | ||
a: 1, | ||
b: 'Awesome' | ||
b: 'Awesome', | ||
}, | ||
@@ -60,5 +59,5 @@ [ | ||
name: 'Lys', | ||
age: 11 | ||
} | ||
] | ||
age: 11, | ||
}, | ||
], | ||
]; | ||
@@ -65,0 +64,0 @@ |
@@ -6,5 +6,5 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -45,3 +45,2 @@ let checkCompose = (bella) => { | ||
test('Testing .compose() method', (assert) => { | ||
let ex = 'f1 f2 f3 Alice'; | ||
@@ -48,0 +47,0 @@ assert.deepEquals(addDashes('Alice'), ex, `addDashes('Alice') must return "${ex}"`); |
@@ -6,5 +6,5 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -19,4 +19,4 @@ // copies | ||
nationality: { | ||
name: 'America' | ||
} | ||
name: 'America', | ||
}, | ||
}; | ||
@@ -28,3 +28,3 @@ let b = { | ||
name: 'Alice', | ||
age: 27 | ||
age: 27, | ||
}, | ||
@@ -34,4 +34,4 @@ nationality: { | ||
long: '18123.123123.12312', | ||
lat: '98984771.134231.1234' | ||
} | ||
lat: '98984771.134231.1234', | ||
}, | ||
}; | ||
@@ -48,11 +48,10 @@ | ||
let c = { | ||
name: 'Kiwi', | ||
age: 16, | ||
gender: 'male' | ||
gender: 'male', | ||
}; | ||
let d = { | ||
name: 'Aline', | ||
age: 20 | ||
age: 20, | ||
}; | ||
@@ -59,0 +58,0 @@ bella.copies(c, d, true, ['age']); |
@@ -6,5 +6,5 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -11,0 +11,0 @@ // createId |
@@ -6,5 +6,5 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -33,3 +33,3 @@ let checkCurry = (bella) => { | ||
assert.ok(bella.isFunction(sum3(1, 2)), `sum3(1, 2) must be a function`); | ||
assert.ok(bella.isFunction(sum3(1, 2)), `sum3(1, 2) must be a function`); | ||
assert.end(); | ||
@@ -36,0 +36,0 @@ }); |
@@ -5,11 +5,11 @@ /** | ||
*/ | ||
var test = require('tape'); | ||
var sinon = require('sinon'); | ||
const test = require('tape'); | ||
const sinon = require('sinon'); | ||
var { | ||
const { | ||
time, | ||
now | ||
now, | ||
} = require('bellajs'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -20,4 +20,3 @@ let isSameTimes = (t1, t2) => { | ||
var checkDateMethods = (date) => { | ||
const checkDateMethods = (date) => { | ||
let { | ||
@@ -27,3 +26,3 @@ format, | ||
local, | ||
utc | ||
utc, | ||
} = date; | ||
@@ -46,3 +45,2 @@ | ||
test('With invalid date time input:', (assert) => { | ||
let check = (t) => { | ||
@@ -62,3 +60,3 @@ let err = new Error('InvalidInput: Number or Date required.'); | ||
return false; | ||
} | ||
}, | ||
].map(check); | ||
@@ -70,3 +68,2 @@ | ||
test('Testing .format(Number timestamp, String pattern) method:', (assert) => { | ||
let atime = 1455784100752; | ||
@@ -86,3 +83,3 @@ | ||
expectation: 'Feb 21st, 2016', | ||
input: atime + 3 * 24 * 60 * 6e4 | ||
input: atime + 3 * 24 * 60 * 6e4, | ||
}, | ||
@@ -92,3 +89,3 @@ { | ||
expectation: 'Feb 22nd, 2016', | ||
input: atime + 4 * 24 * 60 * 6e4 | ||
input: atime + 4 * 24 * 60 * 6e4, | ||
}, | ||
@@ -98,4 +95,4 @@ { | ||
expectation: 'Feb 23rd, 2016', | ||
input: atime + 5 * 24 * 60 * 6e4 | ||
} | ||
input: atime + 5 * 24 * 60 * 6e4, | ||
}, | ||
]; | ||
@@ -119,3 +116,2 @@ | ||
test('Testing .relativize(Number timestamp) method:', (assert) => { | ||
let t = time(); | ||
@@ -122,0 +118,0 @@ let clock = sinon.useFakeTimers(t); |
@@ -6,5 +6,5 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -11,0 +11,0 @@ // md5 |
@@ -6,5 +6,5 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -45,3 +45,2 @@ let checkPipe = (bella) => { | ||
test('Testing .pipe() method', (assert) => { | ||
let ex = 'f3 f2 f1 Alice'; | ||
@@ -48,0 +47,0 @@ assert.deepEquals(addDashes('Alice'), ex, `addDashes('Alice') must return "${ex}"`); |
@@ -6,6 +6,6 @@ /** | ||
var test = require('tape'); | ||
var is = require('is'); | ||
const test = require('tape'); | ||
const is = require('is'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -53,5 +53,4 @@ // random | ||
}); | ||
}; | ||
variants.map(checkRandom); |
@@ -6,5 +6,5 @@ /** | ||
var test = require('tape'); | ||
const test = require('tape'); | ||
var {variants} = require('../../config'); | ||
const {variants} = require('../../config'); | ||
@@ -11,0 +11,0 @@ // unique |
@@ -1,4 +0,1 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
/** | ||
@@ -8,3 +5,13 @@ * Import specs | ||
var dirs = [ | ||
const { | ||
existsSync, | ||
readdirSync, | ||
} = require('fs'); | ||
const { | ||
extname, | ||
join, | ||
} = require('path'); | ||
const dirs = [ | ||
'', | ||
@@ -14,3 +21,3 @@ 'detection', | ||
'string', | ||
'template' | ||
'template', | ||
]; | ||
@@ -20,6 +27,6 @@ | ||
let where = './test/specs/' + dir; | ||
if (fs.existsSync(where)) { | ||
fs.readdirSync(where).forEach((file) => { | ||
if (path.extname(file) === '.js') { | ||
require(path.join('.' + where, file)); | ||
if (existsSync(where)) { | ||
readdirSync(where).forEach((file) => { | ||
if (extname(file) === '.js') { | ||
require(join('.' + where, file)); | ||
} | ||
@@ -26,0 +33,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
113158
2888