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

self-timer

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

self-timer - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

12

dist/selftimer-promise-polyfill.js

@@ -188,2 +188,11 @@ !function(e){function n(){}function t(e,n){return function(){e.apply(n,arguments)}}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function i(e,n){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(n):(e._handled=!0,void o._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null===t)return void(1===e._state?r:u)(n.promise,e._value);var o;try{o=t(e._value)}catch(i){return void u(n.promise,i)}r(n.promise,o)}))}function r(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var i=n.then;if(n instanceof o)return e._state=3,e._value=n,void f(e);if("function"==typeof i)return void s(t(i,n),e)}e._state=1,e._value=n,f(e)}catch(r){u(e,r)}}function u(e,n){e._state=2,e._value=n,f(e)}function f(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var n=0,t=e._deferreds.length;n<t;n++)i(e,e._deferreds[n]);e._deferreds=null}function c(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}function s(e,n){var t=!1;try{e(function(e){t||(t=!0,r(n,e))},function(e){t||(t=!0,u(n,e))})}catch(o){if(t)return;t=!0,u(n,o)}}var a=setTimeout;o.prototype["catch"]=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var o=new this.constructor(n);return i(this,new c(e,t,o)),o},o.all=function(e){var n=Array.prototype.slice.call(e);return new o(function(e,t){function o(r,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var f=u.then;if("function"==typeof f)return void f.call(u,function(e){o(r,e)},t)}n[r]=u,0===--i&&e(n)}catch(c){t(c)}}if(0===n.length)return e([]);for(var i=n.length,r=0;r<n.length;r++)o(r,n[r])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(n){n(e)})},o.reject=function(e){return new o(function(n,t){t(e)})},o.race=function(e){return new o(function(n,t){for(var o=0,i=e.length;o<i;o++)e[o].then(n,t)})},o._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){a(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},"undefined"!=typeof module&&module.exports?module.exports=o:e.Promise||(e.Promise=o)}(this);

/**
* @return {[ String ]}
*/
var __detectLang = function() {
return navigator.userLanguage === "undefined"
? navigator.userLanguage
: navigator.language;
} // ! __detectLang()
// Register methods

@@ -198,3 +207,4 @@ var REGISTER = {

__dateString: __dateString,
__typeToMilliseconds: __typeToMilliseconds
__typeToMilliseconds: __typeToMilliseconds,
__detectLang: __detectLang
};

@@ -201,0 +211,0 @@

2

dist/selftimer-promise-polyfill.min.js

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

!function(t){function e(){}function r(t,e){return function(){t.apply(e,arguments)}}function n(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(t,this)}function o(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void n._immediateFn(function(){var r=1===t._state?e.onFulfilled:e.onRejected;if(null===r)return void(1===t._state?i:u)(e.promise,t._value);var n;try{n=r(t._value)}catch(t){return void u(e.promise,t)}i(e.promise,n)}))}function i(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var o=e.then;if(e instanceof n)return t._state=3,t._value=e,void a(t);if("function"==typeof o)return void c(r(o,e),t)}t._state=1,t._value=e,a(t)}catch(e){u(t,e)}}function u(t,e){t._state=2,t._value=e,a(t)}function a(t){2===t._state&&0===t._deferreds.length&&n._immediateFn(function(){t._handled||n._unhandledRejectionFn(t._value)});for(var e=0,r=t._deferreds.length;e<r;e++)o(t,t._deferreds[e]);t._deferreds=null}function s(t,e,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=r}function c(t,e){var r=!1;try{t(function(t){r||(r=!0,i(e,t))},function(t){r||(r=!0,u(e,t))})}catch(t){if(r)return;r=!0,u(e,t)}}var f=setTimeout;n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,r){var n=new this.constructor(e);return o(this,new s(t,r,n)),n},n.all=function(t){var e=Array.prototype.slice.call(t);return new n(function(t,r){function n(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,function(t){n(i,t)},r)}e[i]=u,0===--o&&t(e)}catch(t){r(t)}}if(0===e.length)return t([]);for(var o=e.length,i=0;i<e.length;i++)n(i,e[i])})},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n(function(e){e(t)})},n.reject=function(t){return new n(function(e,r){r(t)})},n.race=function(t){return new n(function(e,r){for(var n=0,o=t.length;n<o;n++)t[n].then(e,r)})},n._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){f(t,0)},n._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},n._setImmediateFn=function(t){n._immediateFn=t},n._setUnhandledRejectionFn=function(t){n._unhandledRejectionFn=t},"undefined"!=typeof module&&module.exports?module.exports=n:t.Promise||(t.Promise=n)}(this),function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.SelfTimer=e()}(this,function(){"use strict";function t(t){this.D=t}return t.prototype.helpers=function(){var t=this.D,e=(this.D.getDay(),function(t){return"function"==typeof t||void 0==t}),r=function(t,e){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1},n=function(t){return t.map(function(t){return t.replace(/Sun/g,0)}).map(function(t){return t.replace(/Mon/g,1)}).map(function(t){return t.replace(/Tue/g,2)}).map(function(t){return t.replace(/Wed/g,3)}).map(function(t){return t.replace(/Thu/g,4)}).map(function(t){return t.replace(/Fri/g,5)}).map(function(t){return t.replace(/Sat/g,6)}).map(function(t){return parseInt(t)})},o=function(t){var e=t.split(/:|\s/),r=new Date;return"pm"==e.pop().toLowerCase()&&(e[0]=+e[0]+12),r.setHours(+e.shift()),r.setMinutes(+e.shift()),r},i=function(t,e){1==arguments.length&&(e=t,t=0);for(var r=[],n=0;n<e;n++)r.push(t-n);return r},u=function(t,e,r){return r<e.setDate(e.getDate()+1)&&r>t},a=function(){var e=t.getMonth()+1,r=t.getDate();return e.length<2&&(e="0"+e),r.length<2&&(r="0"+r),[e,r].join("-")},s=function(t){var e;switch(t){case"s":case"sec":case"second":case"seconds":e=1e3;break;case"m":case"min":case"minute":case"minutes":e=6e4;break;default:e=!1}return e},c={__checkIsValid:e,__contains:r,__dayOfTheWeekStringToNumber:n,__timeObject:o,__range:i,__dateCompare:u,__dateString:a,__typeToMilliseconds:s};return c},t.prototype.messages=function(t){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+t+" should be object or function",notExist:"Error: "+t+" not exist",shouldBeFunction:"Error: "+t+" is shold be function"}},t.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},t.prototype.on=function(t){var e=t,r=this.D,n=this.D.getDay(),o=this.messages(),i=this.helpers(),u=this.formats(),a=function(){return new Promise(function(t,r){return 0===n?t(!0):e===!0&&r(!1)})},s=function(){return new Promise(function(t,r){return 1===n?t(!0):e===!0&&r(!1)})},c=function(){return new Promise(function(t,r){return 2===n?t(!0):e===!0&&r(!1)})},f=function(){return new Promise(function(t,r){return 3===n?t(!0):e===!0&&r(!1)})},h=function(){return new Promise(function(t,r){return 4===n?t(!0):e===!0&&r(!1)})},d=function(){return new Promise(function(t,r){return 5===n?t(!0):e===!0&&r(!1)})},m=function(){return new Promise(function(t,r){return 6===n?t(!0):e===!0&&r(!1)})},l=function(t){return new Promise(function(r,u){try{if(!Array.isArray(t))throw o.isNotArray;var a=i.__dayOfTheWeekStringToNumber(t);return i.__contains(a,n)?r(!0):e===!0&&u(!1)}catch(t){return void console.error(t)}})},y=function(){return new Promise(function(t,r){var o=[1,2,3,4,5];return i.__contains(o,n)?t(!0):e===!0&&r(!1)})},p=function(){return new Promise(function(t,r){var o=[0,6];return i.__contains(o,n)?t(!0):e===!0&&r(!1)})},_=function(t){return new Promise(function(r,n){try{if(!t.match(u.date))throw o.date;return t==i.__dateString()?r(!0):e===!0&&n(!1)}catch(t){return void console.error(t)}})},v=function(t,n){return new Promise(function(u,a){var s=new Date(t),c=new Date(n);try{if(s>c)throw o.dateGrater;if(s==c)throw o.dateSameDay;return i.__dateCompare(s,c,r)?u(!0):e===!0&&a(!1)}catch(t){return void console.error(t)}})},w=function(t){return new Promise(function(n,u){try{if(!Array.isArray(t))throw o.isNotArray;return i.__contains(t,r.toISOString().slice(0,10))?n(!0):e===!0&&u(!1)}catch(t){return void console.error(t)}})},g={Sunday:a,Monday:s,Tuesday:c,Wednesday:f,Thursday:h,Friday:d,Saturday:m,Selects:l,Weekdays:y,Weekend:p,Annual:_,DatesBetween:v,DatesContain:w};return g},t.prototype.at=function(t){var e=t,r=this.D,n=(this.D.getDay(),this.D.getHours()),o=this.messages(),i=this.helpers(),u=this.formats(),a=function(t,n){return new Promise(function(a,s){try{if(!t.match(u.time))throw o.time+"at start";if(!n.match(u.time))throw o.time+" at end";var c=r<i.__timeObject(n)&&r>i.__timeObject(t);return c?a(!0):e===!0&&s(!1)}catch(t){return void console.error(t)}})},s=function(t,n){return new Promise(function(a,s){try{if(!t.match(u.time))throw o.time+"at start";if(!n.match(u.time))throw o.time+" at end";var c=r<i.__timeObject(n)&&r>i.__timeObject(t);return c?e===!0&&s(!1):a(!0)}catch(t){return void console.error(t)}})},c=function(t){return new Promise(function(r,i){var u=parseInt(t);try{if(u>23)throw o.startHour;return u===n?r(!0):e===!0&&i(!1)}catch(t){return void console.error(t)}})},f=function(t,r){return new Promise(function(u,a){var s=parseInt(t),c=parseInt(r);try{if(s>23)throw o.startHour;if(c>23)throw o.endHour;var f=i.__range(c,c-s);return f.push(t),i.__contains(f,n)?u(!0):e===!0&&a(!1)}catch(t){return void console.error(t)}})},h=function(t,r){return new Promise(function(r,u){try{if(!Array.isArray(t))throw o.isNotArray;if(1!=!t.some(isNaN))throw o.hourFormat;var a=t.map(function(t){return parseInt(t)});return a.map(function(t){if(t>23)throw o.isNotValidHour}),i.__contains(a,n)?r(!0):e===!0&&u(!1)}catch(t){return void console.error(t)}})},d={Between:a,Unless:s,Hour:c,HoursBetween:f,HourSelects:h};return d},t.prototype.in=function(t){var e=t,r=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),u=this.D.getMonth()+1,a=this.D.getFullYear(),s=function(t){return new Promise(function(r,n){try{if(parseInt(t)>31)throw __message.day;return t==i?r(!0):e===!0&&n(!1)}catch(t){return void console.error(t)}})},c=function(t){return new Promise(function(o,u){try{if(!Array.isArray(t))throw r.isNotArray;var a=t.map(function(t){return parseInt(t)});return n.__contains(a,i)?o(!0):e===!0&&u(!1)}catch(t){return void console.error(t)}})},f=function(t,o){return new Promise(function(u,a){try{var s=parseInt(t),c=parseInt(o);if(s>30)throw r.startDay;if(c>31)throw r.endDay;var f=n.__range(c,c-s);return f.push(t),n.__contains(f,i)?u(!0):e===!0&&a(!1)}catch(t){return void console.error(t)}})},h=function(t){return new Promise(function(n,o){try{if(parseInt(t)>12)throw r.month;var i=t<10?"0"+t:t;return i==u?n(!0):e===!0&&o(!1)}catch(t){return void console.error(t)}})},d=function(t){return new Promise(function(o,i){try{if(!Array.isArray(t))throw r.isNotArray;return n.__contains(t,u)?o(!0):e===!0&&i(!1)}catch(t){return void console.error(t)}})},m=function(t){return new Promise(function(n,i){try{if(!t.toString().match(o.year))throw r.year;return t==a?n(!0):e===!0&&i(!1)}catch(t){return void console.error(t)}})},l={Day:s,Days:c,DaysBetween:f,Month:h,MonthSelects:d,Year:m};return l},t.prototype.is=function(t){var e=t,r=function(t){return new Promise(function(r,n){return t?r(!0):e===!0&&n(!1)})},n=function(t){return new Promise(function(r,n){return t?e===!0&&n(!1):r(!0)})},o=function(t){return new Promise(function(r,n){var o="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;return t==o?r(!0):e===!0&&n(!1)})},i=function(t){return new Promise(function(r,n){var o="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;return t==o.slice(0,2)?r(!0):e===!0&&n(!1)})},u={True:r,False:n,Language:o,Lang:i};return u},t.prototype.timer=function(){var t=this.messages(),e=this.helpers(),r=function(r,n,o){return new Promise(function(i){var u=e.__typeToMilliseconds(r),a=typeof o;try{if(!u)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!e.__contains(["object","function","undefined"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in o))throw this.messages("key:before").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;return o.before(),setTimeout(function(){return i(!0)},n*u)}return setTimeout(function(){return i(!0)},n*u)}catch(t){return void console.error(t)}})},n={After:r};return n},t});
!function(t){function e(){}function r(t,e){return function(){t.apply(e,arguments)}}function n(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(t,this)}function o(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void n._immediateFn(function(){var r=1===t._state?e.onFulfilled:e.onRejected;if(null===r)return void(1===t._state?i:u)(e.promise,t._value);var n;try{n=r(t._value)}catch(t){return void u(e.promise,t)}i(e.promise,n)}))}function i(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var o=e.then;if(e instanceof n)return t._state=3,t._value=e,void a(t);if("function"==typeof o)return void c(r(o,e),t)}t._state=1,t._value=e,a(t)}catch(e){u(t,e)}}function u(t,e){t._state=2,t._value=e,a(t)}function a(t){2===t._state&&0===t._deferreds.length&&n._immediateFn(function(){t._handled||n._unhandledRejectionFn(t._value)});for(var e=0,r=t._deferreds.length;e<r;e++)o(t,t._deferreds[e]);t._deferreds=null}function s(t,e,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=r}function c(t,e){var r=!1;try{t(function(t){r||(r=!0,i(e,t))},function(t){r||(r=!0,u(e,t))})}catch(t){if(r)return;r=!0,u(e,t)}}var f=setTimeout;n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,r){var n=new this.constructor(e);return o(this,new s(t,r,n)),n},n.all=function(t){var e=Array.prototype.slice.call(t);return new n(function(t,r){function n(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,function(t){n(i,t)},r)}e[i]=u,0===--o&&t(e)}catch(t){r(t)}}if(0===e.length)return t([]);for(var o=e.length,i=0;i<e.length;i++)n(i,e[i])})},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n(function(e){e(t)})},n.reject=function(t){return new n(function(e,r){r(t)})},n.race=function(t){return new n(function(e,r){for(var n=0,o=t.length;n<o;n++)t[n].then(e,r)})},n._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){f(t,0)},n._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},n._setImmediateFn=function(t){n._immediateFn=t},n._setUnhandledRejectionFn=function(t){n._unhandledRejectionFn=t},"undefined"!=typeof module&&module.exports?module.exports=n:t.Promise||(t.Promise=n)}(this),function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.SelfTimer=e()}(this,function(){"use strict";function t(t){this.D=t}return t.prototype.helpers=function(){var t=this.D,e=(this.D.getDay(),function(t){return"function"==typeof t||void 0==t}),r=function(t,e){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1},n=function(t){return t.map(function(t){return t.replace(/Sun/g,0)}).map(function(t){return t.replace(/Mon/g,1)}).map(function(t){return t.replace(/Tue/g,2)}).map(function(t){return t.replace(/Wed/g,3)}).map(function(t){return t.replace(/Thu/g,4)}).map(function(t){return t.replace(/Fri/g,5)}).map(function(t){return t.replace(/Sat/g,6)}).map(function(t){return parseInt(t)})},o=function(t){var e=t.split(/:|\s/),r=new Date;return"pm"==e.pop().toLowerCase()&&(e[0]=+e[0]+12),r.setHours(+e.shift()),r.setMinutes(+e.shift()),r},i=function(t,e){1==arguments.length&&(e=t,t=0);for(var r=[],n=0;n<e;n++)r.push(t-n);return r},u=function(t,e,r){return r<e.setDate(e.getDate()+1)&&r>t},a=function(){var e=t.getMonth()+1,r=t.getDate();return e.length<2&&(e="0"+e),r.length<2&&(r="0"+r),[e,r].join("-")},s=function(t){var e;switch(t){case"s":case"sec":case"second":case"seconds":e=1e3;break;case"m":case"min":case"minute":case"minutes":e=6e4;break;default:e=!1}return e},c=function(){return"undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language},f={__checkIsValid:e,__contains:r,__dayOfTheWeekStringToNumber:n,__timeObject:o,__range:i,__dateCompare:u,__dateString:a,__typeToMilliseconds:s,__detectLang:c};return f},t.prototype.messages=function(t){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+t+" should be object or function",notExist:"Error: "+t+" not exist",shouldBeFunction:"Error: "+t+" is shold be function"}},t.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},t.prototype.on=function(t){var e=t,r=this.D,n=this.D.getDay(),o=this.messages(),i=this.helpers(),u=this.formats(),a=function(){return new Promise(function(t,r){return 0===n?t(!0):e===!0&&r(!1)})},s=function(){return new Promise(function(t,r){return 1===n?t(!0):e===!0&&r(!1)})},c=function(){return new Promise(function(t,r){return 2===n?t(!0):e===!0&&r(!1)})},f=function(){return new Promise(function(t,r){return 3===n?t(!0):e===!0&&r(!1)})},h=function(){return new Promise(function(t,r){return 4===n?t(!0):e===!0&&r(!1)})},d=function(){return new Promise(function(t,r){return 5===n?t(!0):e===!0&&r(!1)})},m=function(){return new Promise(function(t,r){return 6===n?t(!0):e===!0&&r(!1)})},l=function(t){return new Promise(function(r,u){try{if(!Array.isArray(t))throw o.isNotArray;var a=i.__dayOfTheWeekStringToNumber(t);return i.__contains(a,n)?r(!0):e===!0&&u(!1)}catch(t){return void console.error(t)}})},y=function(){return new Promise(function(t,r){var o=[1,2,3,4,5];return i.__contains(o,n)?t(!0):e===!0&&r(!1)})},p=function(){return new Promise(function(t,r){var o=[0,6];return i.__contains(o,n)?t(!0):e===!0&&r(!1)})},_=function(t){return new Promise(function(r,n){try{if(!t.match(u.date))throw o.date;return t==i.__dateString()?r(!0):e===!0&&n(!1)}catch(t){return void console.error(t)}})},v=function(t,n){return new Promise(function(u,a){var s=new Date(t),c=new Date(n);try{if(s>c)throw o.dateGrater;if(s==c)throw o.dateSameDay;return i.__dateCompare(s,c,r)?u(!0):e===!0&&a(!1)}catch(t){return void console.error(t)}})},w=function(t){return new Promise(function(n,u){try{if(!Array.isArray(t))throw o.isNotArray;return i.__contains(t,r.toISOString().slice(0,10))?n(!0):e===!0&&u(!1)}catch(t){return void console.error(t)}})},g={Sunday:a,Monday:s,Tuesday:c,Wednesday:f,Thursday:h,Friday:d,Saturday:m,Selects:l,Weekdays:y,Weekend:p,Annual:_,DatesBetween:v,DatesContain:w};return g},t.prototype.at=function(t){var e=t,r=this.D,n=(this.D.getDay(),this.D.getHours()),o=this.messages(),i=this.helpers(),u=this.formats(),a=function(t,n){return new Promise(function(a,s){try{if(!t.match(u.time))throw o.time+"at start";if(!n.match(u.time))throw o.time+" at end";var c=r<i.__timeObject(n)&&r>i.__timeObject(t);return c?a(!0):e===!0&&s(!1)}catch(t){return void console.error(t)}})},s=function(t,n){return new Promise(function(a,s){try{if(!t.match(u.time))throw o.time+"at start";if(!n.match(u.time))throw o.time+" at end";var c=r<i.__timeObject(n)&&r>i.__timeObject(t);return c?e===!0&&s(!1):a(!0)}catch(t){return void console.error(t)}})},c=function(t){return new Promise(function(r,i){var u=parseInt(t);try{if(u>23)throw o.startHour;return u===n?r(!0):e===!0&&i(!1)}catch(t){return void console.error(t)}})},f=function(t,r){return new Promise(function(u,a){var s=parseInt(t),c=parseInt(r);try{if(s>23)throw o.startHour;if(c>23)throw o.endHour;var f=i.__range(c,c-s);return f.push(t),i.__contains(f,n)?u(!0):e===!0&&a(!1)}catch(t){return void console.error(t)}})},h=function(t,r){return new Promise(function(r,u){try{if(!Array.isArray(t))throw o.isNotArray;if(1!=!t.some(isNaN))throw o.hourFormat;var a=t.map(function(t){return parseInt(t)});return a.map(function(t){if(t>23)throw o.isNotValidHour}),i.__contains(a,n)?r(!0):e===!0&&u(!1)}catch(t){return void console.error(t)}})},d={Between:a,Unless:s,Hour:c,HoursBetween:f,HourSelects:h};return d},t.prototype.in=function(t){var e=t,r=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),u=this.D.getMonth()+1,a=this.D.getFullYear(),s=function(t){return new Promise(function(r,n){try{if(parseInt(t)>31)throw __message.day;return t==i?r(!0):e===!0&&n(!1)}catch(t){return void console.error(t)}})},c=function(t){return new Promise(function(o,u){try{if(!Array.isArray(t))throw r.isNotArray;var a=t.map(function(t){return parseInt(t)});return n.__contains(a,i)?o(!0):e===!0&&u(!1)}catch(t){return void console.error(t)}})},f=function(t,o){return new Promise(function(u,a){try{var s=parseInt(t),c=parseInt(o);if(s>30)throw r.startDay;if(c>31)throw r.endDay;var f=n.__range(c,c-s);return f.push(t),n.__contains(f,i)?u(!0):e===!0&&a(!1)}catch(t){return void console.error(t)}})},h=function(t){return new Promise(function(n,o){try{if(parseInt(t)>12)throw r.month;var i=t<10?"0"+t:t;return i==u?n(!0):e===!0&&o(!1)}catch(t){return void console.error(t)}})},d=function(t){return new Promise(function(o,i){try{if(!Array.isArray(t))throw r.isNotArray;return n.__contains(t,u)?o(!0):e===!0&&i(!1)}catch(t){return void console.error(t)}})},m=function(t){return new Promise(function(n,i){try{if(!t.toString().match(o.year))throw r.year;return t==a?n(!0):e===!0&&i(!1)}catch(t){return void console.error(t)}})},l={Day:s,Days:c,DaysBetween:f,Month:h,MonthSelects:d,Year:m};return l},t.prototype.is=function(t){var e=t,r=function(t){return new Promise(function(r,n){return t?r(!0):e===!0&&n(!1)})},n=function(t){return new Promise(function(r,n){return t?e===!0&&n(!1):r(!0)})},o=function(t){return new Promise(function(r,n){var o="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;return t==o?r(!0):e===!0&&n(!1)})},i=function(t){return new Promise(function(r,n){var o="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;return t==o.slice(0,2)?r(!0):e===!0&&n(!1)})},u={True:r,False:n,Language:o,Lang:i};return u},t.prototype.timer=function(){var t=this.messages(),e=this.helpers(),r=function(r,n,o){return new Promise(function(i){var u=e.__typeToMilliseconds(r),a=typeof o;try{if(!u)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!e.__contains(["object","function","undefined"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in o))throw this.messages("key:before").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;return o.before(),setTimeout(function(){return i(!0)},n*u)}return setTimeout(function(){return i(!0)},n*u)}catch(t){return void console.error(t)}})},n={After:r};return n},t});

@@ -187,2 +187,11 @@ ;(function(root, factory) {

/**
* @return {[ String ]}
*/
var __detectLang = function() {
return navigator.userLanguage === "undefined"
? navigator.userLanguage
: navigator.language;
} // ! __detectLang()
// Register methods

@@ -197,3 +206,4 @@ var REGISTER = {

__dateString: __dateString,
__typeToMilliseconds: __typeToMilliseconds
__typeToMilliseconds: __typeToMilliseconds,
__detectLang: __detectLang
};

@@ -200,0 +210,0 @@

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

!function(r,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():r.SelfTimer=t()}(this,function(){"use strict";function r(r){this.D=r}return r.prototype.helpers=function(){var r=this.D,t=(this.D.getDay(),function(r){return"function"==typeof r||void 0==r}),e=function(r,t){for(var e=r.length;e--;)if(r[e]===t)return!0;return!1},n=function(r){return r.map(function(r){return r.replace(/Sun/g,0)}).map(function(r){return r.replace(/Mon/g,1)}).map(function(r){return r.replace(/Tue/g,2)}).map(function(r){return r.replace(/Wed/g,3)}).map(function(r){return r.replace(/Thu/g,4)}).map(function(r){return r.replace(/Fri/g,5)}).map(function(r){return r.replace(/Sat/g,6)}).map(function(r){return parseInt(r)})},o=function(r){var t=r.split(/:|\s/),e=new Date;return"pm"==t.pop().toLowerCase()&&(t[0]=+t[0]+12),e.setHours(+t.shift()),e.setMinutes(+t.shift()),e},i=function(r,t){1==arguments.length&&(t=r,r=0);for(var e=[],n=0;n<t;n++)e.push(r-n);return e},u=function(r,t,e){return e<t.setDate(t.getDate()+1)&&e>r},a=function(){var t=r.getMonth()+1,e=r.getDate();return t.length<2&&(t="0"+t),e.length<2&&(e="0"+e),[t,e].join("-")},s=function(r){var t;switch(r){case"s":case"sec":case"second":case"seconds":t=1e3;break;case"m":case"min":case"minute":case"minutes":t=6e4;break;default:t=!1}return t},c={__checkIsValid:t,__contains:e,__dayOfTheWeekStringToNumber:n,__timeObject:o,__range:i,__dateCompare:u,__dateString:a,__typeToMilliseconds:s};return c},r.prototype.messages=function(r){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+r+" should be object or function",notExist:"Error: "+r+" not exist",shouldBeFunction:"Error: "+r+" is shold be function"}},r.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},r.prototype.on=function(r){var t=r,e=this.D,n=this.D.getDay(),o=this.messages(),i=this.helpers(),u=this.formats(),a=function(){return new Promise(function(r,e){return 0===n?r(!0):t===!0&&e(!1)})},s=function(){return new Promise(function(r,e){return 1===n?r(!0):t===!0&&e(!1)})},c=function(){return new Promise(function(r,e){return 2===n?r(!0):t===!0&&e(!1)})},f=function(){return new Promise(function(r,e){return 3===n?r(!0):t===!0&&e(!1)})},h=function(){return new Promise(function(r,e){return 4===n?r(!0):t===!0&&e(!1)})},m=function(){return new Promise(function(r,e){return 5===n?r(!0):t===!0&&e(!1)})},d=function(){return new Promise(function(r,e){return 6===n?r(!0):t===!0&&e(!1)})},l=function(r){return new Promise(function(e,u){try{if(!Array.isArray(r))throw o.isNotArray;var a=i.__dayOfTheWeekStringToNumber(r);return i.__contains(a,n)?e(!0):t===!0&&u(!1)}catch(r){return void console.error(r)}})},y=function(){return new Promise(function(r,e){var o=[1,2,3,4,5];return i.__contains(o,n)?r(!0):t===!0&&e(!1)})},p=function(){return new Promise(function(r,e){var o=[0,6];return i.__contains(o,n)?r(!0):t===!0&&e(!1)})},w=function(r){return new Promise(function(e,n){try{if(!r.match(u.date))throw o.date;return r==i.__dateString()?e(!0):t===!0&&n(!1)}catch(r){return void console.error(r)}})},g=function(r,n){return new Promise(function(u,a){var s=new Date(r),c=new Date(n);try{if(s>c)throw o.dateGrater;if(s==c)throw o.dateSameDay;return i.__dateCompare(s,c,e)?u(!0):t===!0&&a(!1)}catch(r){return void console.error(r)}})},_=function(r){return new Promise(function(n,u){try{if(!Array.isArray(r))throw o.isNotArray;return i.__contains(r,e.toISOString().slice(0,10))?n(!0):t===!0&&u(!1)}catch(r){return void console.error(r)}})},v={Sunday:a,Monday:s,Tuesday:c,Wednesday:f,Thursday:h,Friday:m,Saturday:d,Selects:l,Weekdays:y,Weekend:p,Annual:w,DatesBetween:g,DatesContain:_};return v},r.prototype.at=function(r){var t=r,e=this.D,n=(this.D.getDay(),this.D.getHours()),o=this.messages(),i=this.helpers(),u=this.formats(),a=function(r,n){return new Promise(function(a,s){try{if(!r.match(u.time))throw o.time+"at start";if(!n.match(u.time))throw o.time+" at end";var c=e<i.__timeObject(n)&&e>i.__timeObject(r);return c?a(!0):t===!0&&s(!1)}catch(r){return void console.error(r)}})},s=function(r,n){return new Promise(function(a,s){try{if(!r.match(u.time))throw o.time+"at start";if(!n.match(u.time))throw o.time+" at end";var c=e<i.__timeObject(n)&&e>i.__timeObject(r);return c?t===!0&&s(!1):a(!0)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(e,i){var u=parseInt(r);try{if(u>23)throw o.startHour;return u===n?e(!0):t===!0&&i(!1)}catch(r){return void console.error(r)}})},f=function(r,e){return new Promise(function(u,a){var s=parseInt(r),c=parseInt(e);try{if(s>23)throw o.startHour;if(c>23)throw o.endHour;var f=i.__range(c,c-s);return f.push(r),i.__contains(f,n)?u(!0):t===!0&&a(!1)}catch(r){return void console.error(r)}})},h=function(r,e){return new Promise(function(e,u){try{if(!Array.isArray(r))throw o.isNotArray;if(1!=!r.some(isNaN))throw o.hourFormat;var a=r.map(function(r){return parseInt(r)});return a.map(function(r){if(r>23)throw o.isNotValidHour}),i.__contains(a,n)?e(!0):t===!0&&u(!1)}catch(r){return void console.error(r)}})},m={Between:a,Unless:s,Hour:c,HoursBetween:f,HourSelects:h};return m},r.prototype.in=function(r){var t=r,e=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),u=this.D.getMonth()+1,a=this.D.getFullYear(),s=function(r){return new Promise(function(e,n){try{if(parseInt(r)>31)throw __message.day;return r==i?e(!0):t===!0&&n(!1)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(o,u){try{if(!Array.isArray(r))throw e.isNotArray;var a=r.map(function(r){return parseInt(r)});return n.__contains(a,i)?o(!0):t===!0&&u(!1)}catch(r){return void console.error(r)}})},f=function(r,o){return new Promise(function(u,a){try{var s=parseInt(r),c=parseInt(o);if(s>30)throw e.startDay;if(c>31)throw e.endDay;var f=n.__range(c,c-s);return f.push(r),n.__contains(f,i)?u(!0):t===!0&&a(!1)}catch(r){return void console.error(r)}})},h=function(r){return new Promise(function(n,o){try{if(parseInt(r)>12)throw e.month;var i=r<10?"0"+r:r;return i==u?n(!0):t===!0&&o(!1)}catch(r){return void console.error(r)}})},m=function(r){return new Promise(function(o,i){try{if(!Array.isArray(r))throw e.isNotArray;return n.__contains(r,u)?o(!0):t===!0&&i(!1)}catch(r){return void console.error(r)}})},d=function(r){return new Promise(function(n,i){try{if(!r.toString().match(o.year))throw e.year;return r==a?n(!0):t===!0&&i(!1)}catch(r){return void console.error(r)}})},l={Day:s,Days:c,DaysBetween:f,Month:h,MonthSelects:m,Year:d};return l},r.prototype.is=function(r){var t=r,e=function(r){return new Promise(function(e,n){return r?e(!0):t===!0&&n(!1)})},n=function(r){return new Promise(function(e,n){return r?t===!0&&n(!1):e(!0)})},o=function(r){return new Promise(function(e,n){var o="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;return r==o?e(!0):t===!0&&n(!1)})},i=function(r){return new Promise(function(e,n){var o="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;return r==o.slice(0,2)?e(!0):t===!0&&n(!1)})},u={True:e,False:n,Language:o,Lang:i};return u},r.prototype.timer=function(){var r=this.messages(),t=this.helpers(),e=function(e,n,o){return new Promise(function(i){var u=t.__typeToMilliseconds(e),a=typeof o;try{if(!u)throw r.timeFormat;if(isNaN(n))throw r.numFormat;if(0===n||"0"===n)throw r.numFormat;if(!t.__contains(["object","function","undefined"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in o))throw this.messages("key:before").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;return o.before(),setTimeout(function(){return i(!0)},n*u)}return setTimeout(function(){return i(!0)},n*u)}catch(r){return void console.error(r)}})},n={After:e};return n},r});
!function(r,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():r.SelfTimer=t()}(this,function(){"use strict";function r(r){this.D=r}return r.prototype.helpers=function(){var r=this.D,t=(this.D.getDay(),function(r){return"function"==typeof r||void 0==r}),e=function(r,t){for(var e=r.length;e--;)if(r[e]===t)return!0;return!1},n=function(r){return r.map(function(r){return r.replace(/Sun/g,0)}).map(function(r){return r.replace(/Mon/g,1)}).map(function(r){return r.replace(/Tue/g,2)}).map(function(r){return r.replace(/Wed/g,3)}).map(function(r){return r.replace(/Thu/g,4)}).map(function(r){return r.replace(/Fri/g,5)}).map(function(r){return r.replace(/Sat/g,6)}).map(function(r){return parseInt(r)})},o=function(r){var t=r.split(/:|\s/),e=new Date;return"pm"==t.pop().toLowerCase()&&(t[0]=+t[0]+12),e.setHours(+t.shift()),e.setMinutes(+t.shift()),e},i=function(r,t){1==arguments.length&&(t=r,r=0);for(var e=[],n=0;n<t;n++)e.push(r-n);return e},a=function(r,t,e){return e<t.setDate(t.getDate()+1)&&e>r},u=function(){var t=r.getMonth()+1,e=r.getDate();return t.length<2&&(t="0"+t),e.length<2&&(e="0"+e),[t,e].join("-")},s=function(r){var t;switch(r){case"s":case"sec":case"second":case"seconds":t=1e3;break;case"m":case"min":case"minute":case"minutes":t=6e4;break;default:t=!1}return t},c=function(){return"undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language},f={__checkIsValid:t,__contains:e,__dayOfTheWeekStringToNumber:n,__timeObject:o,__range:i,__dateCompare:a,__dateString:u,__typeToMilliseconds:s,__detectLang:c};return f},r.prototype.messages=function(r){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+r+" should be object or function",notExist:"Error: "+r+" not exist",shouldBeFunction:"Error: "+r+" is shold be function"}},r.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},r.prototype.on=function(r){var t=r,e=this.D,n=this.D.getDay(),o=this.messages(),i=this.helpers(),a=this.formats(),u=function(){return new Promise(function(r,e){return 0===n?r(!0):t===!0&&e(!1)})},s=function(){return new Promise(function(r,e){return 1===n?r(!0):t===!0&&e(!1)})},c=function(){return new Promise(function(r,e){return 2===n?r(!0):t===!0&&e(!1)})},f=function(){return new Promise(function(r,e){return 3===n?r(!0):t===!0&&e(!1)})},h=function(){return new Promise(function(r,e){return 4===n?r(!0):t===!0&&e(!1)})},m=function(){return new Promise(function(r,e){return 5===n?r(!0):t===!0&&e(!1)})},d=function(){return new Promise(function(r,e){return 6===n?r(!0):t===!0&&e(!1)})},l=function(r){return new Promise(function(e,a){try{if(!Array.isArray(r))throw o.isNotArray;var u=i.__dayOfTheWeekStringToNumber(r);return i.__contains(u,n)?e(!0):t===!0&&a(!1)}catch(r){return void console.error(r)}})},y=function(){return new Promise(function(r,e){var o=[1,2,3,4,5];return i.__contains(o,n)?r(!0):t===!0&&e(!1)})},g=function(){return new Promise(function(r,e){var o=[0,6];return i.__contains(o,n)?r(!0):t===!0&&e(!1)})},p=function(r){return new Promise(function(e,n){try{if(!r.match(a.date))throw o.date;return r==i.__dateString()?e(!0):t===!0&&n(!1)}catch(r){return void console.error(r)}})},w=function(r,n){return new Promise(function(a,u){var s=new Date(r),c=new Date(n);try{if(s>c)throw o.dateGrater;if(s==c)throw o.dateSameDay;return i.__dateCompare(s,c,e)?a(!0):t===!0&&u(!1)}catch(r){return void console.error(r)}})},_=function(r){return new Promise(function(n,a){try{if(!Array.isArray(r))throw o.isNotArray;return i.__contains(r,e.toISOString().slice(0,10))?n(!0):t===!0&&a(!1)}catch(r){return void console.error(r)}})},v={Sunday:u,Monday:s,Tuesday:c,Wednesday:f,Thursday:h,Friday:m,Saturday:d,Selects:l,Weekdays:y,Weekend:g,Annual:p,DatesBetween:w,DatesContain:_};return v},r.prototype.at=function(r){var t=r,e=this.D,n=(this.D.getDay(),this.D.getHours()),o=this.messages(),i=this.helpers(),a=this.formats(),u=function(r,n){return new Promise(function(u,s){try{if(!r.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=e<i.__timeObject(n)&&e>i.__timeObject(r);return c?u(!0):t===!0&&s(!1)}catch(r){return void console.error(r)}})},s=function(r,n){return new Promise(function(u,s){try{if(!r.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=e<i.__timeObject(n)&&e>i.__timeObject(r);return c?t===!0&&s(!1):u(!0)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(e,i){var a=parseInt(r);try{if(a>23)throw o.startHour;return a===n?e(!0):t===!0&&i(!1)}catch(r){return void console.error(r)}})},f=function(r,e){return new Promise(function(a,u){var s=parseInt(r),c=parseInt(e);try{if(s>23)throw o.startHour;if(c>23)throw o.endHour;var f=i.__range(c,c-s);return f.push(r),i.__contains(f,n)?a(!0):t===!0&&u(!1)}catch(r){return void console.error(r)}})},h=function(r,e){return new Promise(function(e,a){try{if(!Array.isArray(r))throw o.isNotArray;if(1!=!r.some(isNaN))throw o.hourFormat;var u=r.map(function(r){return parseInt(r)});return u.map(function(r){if(r>23)throw o.isNotValidHour}),i.__contains(u,n)?e(!0):t===!0&&a(!1)}catch(r){return void console.error(r)}})},m={Between:u,Unless:s,Hour:c,HoursBetween:f,HourSelects:h};return m},r.prototype.in=function(r){var t=r,e=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),a=this.D.getMonth()+1,u=this.D.getFullYear(),s=function(r){return new Promise(function(e,n){try{if(parseInt(r)>31)throw __message.day;return r==i?e(!0):t===!0&&n(!1)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(o,a){try{if(!Array.isArray(r))throw e.isNotArray;var u=r.map(function(r){return parseInt(r)});return n.__contains(u,i)?o(!0):t===!0&&a(!1)}catch(r){return void console.error(r)}})},f=function(r,o){return new Promise(function(a,u){try{var s=parseInt(r),c=parseInt(o);if(s>30)throw e.startDay;if(c>31)throw e.endDay;var f=n.__range(c,c-s);return f.push(r),n.__contains(f,i)?a(!0):t===!0&&u(!1)}catch(r){return void console.error(r)}})},h=function(r){return new Promise(function(n,o){try{if(parseInt(r)>12)throw e.month;var i=r<10?"0"+r:r;return i==a?n(!0):t===!0&&o(!1)}catch(r){return void console.error(r)}})},m=function(r){return new Promise(function(o,i){try{if(!Array.isArray(r))throw e.isNotArray;return n.__contains(r,a)?o(!0):t===!0&&i(!1)}catch(r){return void console.error(r)}})},d=function(r){return new Promise(function(n,i){try{if(!r.toString().match(o.year))throw e.year;return r==u?n(!0):t===!0&&i(!1)}catch(r){return void console.error(r)}})},l={Day:s,Days:c,DaysBetween:f,Month:h,MonthSelects:m,Year:d};return l},r.prototype.is=function(r){var t=r,e=function(r){return new Promise(function(e,n){return r?e(!0):t===!0&&n(!1)})},n=function(r){return new Promise(function(e,n){return r?t===!0&&n(!1):e(!0)})},o=function(r){return new Promise(function(e,n){var o="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;return r==o?e(!0):t===!0&&n(!1)})},i=function(r){return new Promise(function(e,n){var o="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;return r==o.slice(0,2)?e(!0):t===!0&&n(!1)})},a={True:e,False:n,Language:o,Lang:i};return a},r.prototype.timer=function(){var r=this.messages(),t=this.helpers(),e=function(e,n,o){return new Promise(function(i){var a=t.__typeToMilliseconds(e),u=typeof o;try{if(!a)throw r.timeFormat;if(isNaN(n))throw r.numFormat;if(0===n||"0"===n)throw r.numFormat;if(!t.__contains(["object","function","undefined"],u))throw this.messages("type").taskFormat;if("object"===u){if(!("before"in o))throw this.messages("key:before").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;return o.before(),setTimeout(function(){return i(!0)},n*a)}return setTimeout(function(){return i(!0)},n*a)}catch(r){return void console.error(r)}})},n={After:e};return n},r});

@@ -187,2 +187,11 @@ ;(function(root, factory) {

/**
* @return {[ String ]}
*/
var __detectLang = function() {
return navigator.userLanguage === "undefined"
? navigator.userLanguage
: navigator.language;
} // ! __detectLang()
// Register methods

@@ -197,3 +206,4 @@ var REGISTER = {

__dateString: __dateString,
__typeToMilliseconds: __typeToMilliseconds
__typeToMilliseconds: __typeToMilliseconds,
__detectLang: __detectLang
};

@@ -200,0 +210,0 @@

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

!function(t,r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?module.exports=r():t.SelfTimer=r()}(this,function(){"use strict";function t(t){this.D=t}return t.prototype.helpers=function(){var t=this.D,r=(this.D.getDay(),function(t){return"function"==typeof t||void 0==t}),e=function(t,r){for(var e=t.length;e--;)if(t[e]===r)return!0;return!1},n=function(t){return t.map(function(t){return t.replace(/Sun/g,0)}).map(function(t){return t.replace(/Mon/g,1)}).map(function(t){return t.replace(/Tue/g,2)}).map(function(t){return t.replace(/Wed/g,3)}).map(function(t){return t.replace(/Thu/g,4)}).map(function(t){return t.replace(/Fri/g,5)}).map(function(t){return t.replace(/Sat/g,6)}).map(function(t){return parseInt(t)})},i=function(t){var r=t.split(/:|\s/),e=new Date;return"pm"==r.pop().toLowerCase()&&(r[0]=+r[0]+12),e.setHours(+r.shift()),e.setMinutes(+r.shift()),e},o=function(t,r){1==arguments.length&&(r=t,t=0);for(var e=[],n=0;n<r;n++)e.push(t-n);return e},a=function(t,r,e){return e<r.setDate(r.getDate()+1)&&e>t},s=function(){var r=t.getMonth()+1,e=t.getDate();return r.length<2&&(r="0"+r),e.length<2&&(e="0"+e),[r,e].join("-")},u=function(t){var r;switch(t){case"s":case"sec":case"second":case"seconds":r=1e3;break;case"m":case"min":case"minute":case"minutes":r=6e4;break;default:r=!1}return r},c={__checkIsValid:r,__contains:e,__dayOfTheWeekStringToNumber:n,__timeObject:i,__range:o,__dateCompare:a,__dateString:s,__typeToMilliseconds:u};return c},t.prototype.messages=function(t){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+t+" should be object or function",notExist:"Error: "+t+" not exist",shouldBeFunction:"Error: "+t+" is shold be function"}},t.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},t.prototype.on=function(){var t=this.D,r=this.D.getDay(),e=this.messages(),n=this.helpers(),i=this.formats(),o=function(t){if(n.__checkIsValid(t)&&0===r)return void 0===t||t()},a=function(t){if(n.__checkIsValid(t)&&1===r)return void 0===t||t()},s=function(t){if(n.__checkIsValid(t)&&2===r)return void 0==t||t()},u=function(t){if(n.__checkIsValid(t)&&3===r)return void 0===t||t()},c=function(t){if(n.__checkIsValid(t)&&4===r)return void 0===t||t()},h=function(t){if(n.__checkIsValid(t)&&5===r)return void 0===t||t()},f=function(t){if(n.__checkIsValid(t)&&6===r)return void 0===t||t()},d=function(t,i){if(n.__checkIsValid(i))try{if(!Array.isArray(t))throw e.isNotArray;var o=n.__dayOfTheWeekStringToNumber(t);if(n.__contains(o,r))return void 0===i||i()}catch(t){return void console.error(t)}},_=function(t){if(n.__checkIsValid(t)){var e=[1,2,3,4,5];if(n.__contains(e,r))return void 0===t||t()}},l=function(t){if(n.__checkIsValid(t)){var e=[0,6];if(n.__contains(e,r))return void 0===t||t()}},m=function(t,r){if(n.__checkIsValid(r))try{if(!t.match(i.date))throw e.date;if(t==n.__dateString())return void 0===r||r()}catch(t){return void console.error(t)}},y=function(r,i,o){if(n.__checkIsValid(o)){var a=new Date(r),s=new Date(i);try{if(a>s)throw e.dateGrater;if(a==s)throw e.dateSameDay;if(n.__dateCompare(a,s,t))return void 0===o||o()}catch(t){return void console.error(t)}}},v=function(r,i){if(n.__checkIsValid(i))try{if(!Array.isArray(r))throw e.isNotArray;if(n.__contains(r,t.toISOString().slice(0,10)))return void 0===i||i()}catch(t){return void console.error(t)}},p={Sunday:o,Monday:a,Tuesday:s,Wednesday:u,Thursday:c,Friday:h,Saturday:f,Selects:d,Weekdays:_,Weekend:l,Annual:m,DatesBetween:y,DatesContain:v};return p},t.prototype.at=function(){var t=this.D,r=(this.D.getDay(),this.D.getHours()),e=this.messages(),n=this.helpers(),i=this.formats(),o=function(r,o,a){if(n.__checkIsValid(a))try{if(!r.match(i.time))throw e.time+"at start";if(!o.match(i.time))throw e.time+" at end";var s=t<n.__timeObject(o)&&t>n.__timeObject(r);if(s)return void 0===a||a()}catch(t){return void console.error(t)}},a=function(r,o,a){if(n.__checkIsValid(a))try{if(!r.match(i.time))throw e.time+"at start";if(!o.match(i.time))throw e.time+" at end";var s=t<n.__timeObject(o)&&t>n.__timeObject(r);if(!s)return void 0===a||a()}catch(t){return void console.error(t)}},s=function(t,i){if(n.__checkIsValid(i)){var o=parseInt(t);try{if(o>23)throw e.startHour;if(o===r)return void 0===i||i()}catch(t){return void console.error(t)}}},u=function(t,i,o){if(n.__checkIsValid(o)){var a=parseInt(t),s=parseInt(i);try{if(a>23)throw e.startHour;if(s>23)throw e.endHour;var u=n.__range(s,s-a);if(u.push(t),n.__contains(u,r))return void 0===o||o()}catch(t){return void console.error(t)}}},c=function(t,i){if(n.__checkIsValid(i))try{if(!Array.isArray(t))throw e.isNotArray;if(1!=!t.some(isNaN))throw e.hourFormat;var o=t.map(function(t){return parseInt(t)});if(o.map(function(t){if(t>23)throw e.isNotValidHour}),n.__contains(o,r))return void 0===i||i()}catch(t){return void console.error(t)}},h={Between:o,Unless:a,Hour:s,HoursBetween:u,HourSelects:c};return h},t.prototype.in=function(t){var r=t,e=this.messages(),n=this.helpers(),i=this.formats(),o=(this.D,this.D.getDate()),a=this.D.getMonth()+1,s=this.D.getFullYear(),u=function(t,e){if(0!=this._Chain&&n.__checkIsValid(e))try{if(parseInt(t)>31)throw __message.day;return t==o?void 0!==e?e():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},c=function(t,i){if(0!=this._Chain&&n.__checkIsValid(i))try{if(!Array.isArray(t))throw e.isNotArray;var a=t.map(function(t){return parseInt(t)});return n.__contains(a,o)?void 0!==i?i():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},h=function(t,i,a){if(0!=this._Chain&&n.__checkIsValid(a))try{var s=parseInt(t),u=parseInt(i);if(s>30)throw e.startDay;if(u>31)throw e.endDay;var c=n.__range(u,u-s);return c.push(t),n.__contains(c,o)?void 0!==a?a():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},f=function(t,i){if(0!=this._Chain&&n.__checkIsValid(i))try{if(parseInt(t)>12)throw e.month;var o=t<10?"0"+t:t;return o==a?void 0!==i?i():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},d=function(t,i){if(0!=this._Chain&&n.__checkIsValid(i)){if(!Array.isArray(t))throw e.isNotArray;return n.__contains(t,a)?void 0!==i?i():1!=r||this:(this._Chain=!1,1==r&&this)}},_=function(t,o){if(0!=this._Chain&&n.__checkIsValid(o))try{if(!t.toString().match(i.year))throw e.year;return t==s?void 0!==o?o():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},l={Day:u,Days:c,DaysBetween:h,Month:f,MonthSelects:d,Year:_};return l},t.prototype.is=function(){var t=function(t,r){if(t)return void 0===r||r()},r=function(t,r){if(!t)return void 0===r||r()},e=function(t,r){var e="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;if(t==e)return void 0===r||r()},n=function(t,r){var e="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;if(t==e.slice(0,2))return void 0===r||r()},i={True:t,False:r,Language:e,Lang:n};return i},t.prototype.timer=function(){var t=this.messages(),r=this.helpers(),e=function(e,n,i){var o=r.__typeToMilliseconds(e),a=typeof i;try{if(!o)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!r.__contains(["object","function"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in i))throw this.messages("key:before").notExist;if(!("before"in i))throw this.messages("key:after").notExist;if("function"!=typeof i.before)throw this.messages("before").shouldBeFunction;if("function"!=typeof i.after)throw this.messages("after").shouldBeFunction;return i.before(),setTimeout(function(){return i.after()},n*o)}if("function"===a)return setTimeout(function(){return i()},n*o)}catch(t){return void console.error(t)}},n=function(e,n,i){var o=r.__typeToMilliseconds(e),a=typeof i;try{if(!o)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!r.__contains(["object","function"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in i))throw this.messages("key:before").notExist;if(!("before"in i))throw this.messages("key:after").notExist;if("function"!=typeof i.before)throw this.messages("before").shouldBeFunction;if("function"!=typeof i.after)throw this.messages("after").shouldBeFunction;return i.before(),setInterval(function(){return i.after()},n*o)}if("function"===a)return setInterval(function(){return i()},n*o)}catch(t){return void console.error(t)}},i={After:e,Every:n};return i},t});
!function(t,r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?module.exports=r():t.SelfTimer=r()}(this,function(){"use strict";function t(t){this.D=t}return t.prototype.helpers=function(){var t=this.D,r=(this.D.getDay(),function(t){return"function"==typeof t||void 0==t}),e=function(t,r){for(var e=t.length;e--;)if(t[e]===r)return!0;return!1},n=function(t){return t.map(function(t){return t.replace(/Sun/g,0)}).map(function(t){return t.replace(/Mon/g,1)}).map(function(t){return t.replace(/Tue/g,2)}).map(function(t){return t.replace(/Wed/g,3)}).map(function(t){return t.replace(/Thu/g,4)}).map(function(t){return t.replace(/Fri/g,5)}).map(function(t){return t.replace(/Sat/g,6)}).map(function(t){return parseInt(t)})},i=function(t){var r=t.split(/:|\s/),e=new Date;return"pm"==r.pop().toLowerCase()&&(r[0]=+r[0]+12),e.setHours(+r.shift()),e.setMinutes(+r.shift()),e},o=function(t,r){1==arguments.length&&(r=t,t=0);for(var e=[],n=0;n<r;n++)e.push(t-n);return e},a=function(t,r,e){return e<r.setDate(r.getDate()+1)&&e>t},s=function(){var r=t.getMonth()+1,e=t.getDate();return r.length<2&&(r="0"+r),e.length<2&&(e="0"+e),[r,e].join("-")},u=function(t){var r;switch(t){case"s":case"sec":case"second":case"seconds":r=1e3;break;case"m":case"min":case"minute":case"minutes":r=6e4;break;default:r=!1}return r},c=function(){return"undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language},h={__checkIsValid:r,__contains:e,__dayOfTheWeekStringToNumber:n,__timeObject:i,__range:o,__dateCompare:a,__dateString:s,__typeToMilliseconds:u,__detectLang:c};return h},t.prototype.messages=function(t){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+t+" should be object or function",notExist:"Error: "+t+" not exist",shouldBeFunction:"Error: "+t+" is shold be function"}},t.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},t.prototype.on=function(){var t=this.D,r=this.D.getDay(),e=this.messages(),n=this.helpers(),i=this.formats(),o=function(t){if(n.__checkIsValid(t)&&0===r)return void 0===t||t()},a=function(t){if(n.__checkIsValid(t)&&1===r)return void 0===t||t()},s=function(t){if(n.__checkIsValid(t)&&2===r)return void 0==t||t()},u=function(t){if(n.__checkIsValid(t)&&3===r)return void 0===t||t()},c=function(t){if(n.__checkIsValid(t)&&4===r)return void 0===t||t()},h=function(t){if(n.__checkIsValid(t)&&5===r)return void 0===t||t()},f=function(t){if(n.__checkIsValid(t)&&6===r)return void 0===t||t()},d=function(t,i){if(n.__checkIsValid(i))try{if(!Array.isArray(t))throw e.isNotArray;var o=n.__dayOfTheWeekStringToNumber(t);if(n.__contains(o,r))return void 0===i||i()}catch(t){return void console.error(t)}},_=function(t){if(n.__checkIsValid(t)){var e=[1,2,3,4,5];if(n.__contains(e,r))return void 0===t||t()}},l=function(t){if(n.__checkIsValid(t)){var e=[0,6];if(n.__contains(e,r))return void 0===t||t()}},m=function(t,r){if(n.__checkIsValid(r))try{if(!t.match(i.date))throw e.date;if(t==n.__dateString())return void 0===r||r()}catch(t){return void console.error(t)}},y=function(r,i,o){if(n.__checkIsValid(o)){var a=new Date(r),s=new Date(i);try{if(a>s)throw e.dateGrater;if(a==s)throw e.dateSameDay;if(n.__dateCompare(a,s,t))return void 0===o||o()}catch(t){return void console.error(t)}}},v=function(r,i){if(n.__checkIsValid(i))try{if(!Array.isArray(r))throw e.isNotArray;if(n.__contains(r,t.toISOString().slice(0,10)))return void 0===i||i()}catch(t){return void console.error(t)}},g={Sunday:o,Monday:a,Tuesday:s,Wednesday:u,Thursday:c,Friday:h,Saturday:f,Selects:d,Weekdays:_,Weekend:l,Annual:m,DatesBetween:y,DatesContain:v};return g},t.prototype.at=function(){var t=this.D,r=(this.D.getDay(),this.D.getHours()),e=this.messages(),n=this.helpers(),i=this.formats(),o=function(r,o,a){if(n.__checkIsValid(a))try{if(!r.match(i.time))throw e.time+"at start";if(!o.match(i.time))throw e.time+" at end";var s=t<n.__timeObject(o)&&t>n.__timeObject(r);if(s)return void 0===a||a()}catch(t){return void console.error(t)}},a=function(r,o,a){if(n.__checkIsValid(a))try{if(!r.match(i.time))throw e.time+"at start";if(!o.match(i.time))throw e.time+" at end";var s=t<n.__timeObject(o)&&t>n.__timeObject(r);if(!s)return void 0===a||a()}catch(t){return void console.error(t)}},s=function(t,i){if(n.__checkIsValid(i)){var o=parseInt(t);try{if(o>23)throw e.startHour;if(o===r)return void 0===i||i()}catch(t){return void console.error(t)}}},u=function(t,i,o){if(n.__checkIsValid(o)){var a=parseInt(t),s=parseInt(i);try{if(a>23)throw e.startHour;if(s>23)throw e.endHour;var u=n.__range(s,s-a);if(u.push(t),n.__contains(u,r))return void 0===o||o()}catch(t){return void console.error(t)}}},c=function(t,i){if(n.__checkIsValid(i))try{if(!Array.isArray(t))throw e.isNotArray;if(1!=!t.some(isNaN))throw e.hourFormat;var o=t.map(function(t){return parseInt(t)});if(o.map(function(t){if(t>23)throw e.isNotValidHour}),n.__contains(o,r))return void 0===i||i()}catch(t){return void console.error(t)}},h={Between:o,Unless:a,Hour:s,HoursBetween:u,HourSelects:c};return h},t.prototype.in=function(t){var r=t,e=this.messages(),n=this.helpers(),i=this.formats(),o=(this.D,this.D.getDate()),a=this.D.getMonth()+1,s=this.D.getFullYear(),u=function(t,e){if(0!=this._Chain&&n.__checkIsValid(e))try{if(parseInt(t)>31)throw __message.day;return t==o?void 0!==e?e():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},c=function(t,i){if(0!=this._Chain&&n.__checkIsValid(i))try{if(!Array.isArray(t))throw e.isNotArray;var a=t.map(function(t){return parseInt(t)});return n.__contains(a,o)?void 0!==i?i():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},h=function(t,i,a){if(0!=this._Chain&&n.__checkIsValid(a))try{var s=parseInt(t),u=parseInt(i);if(s>30)throw e.startDay;if(u>31)throw e.endDay;var c=n.__range(u,u-s);return c.push(t),n.__contains(c,o)?void 0!==a?a():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},f=function(t,i){if(0!=this._Chain&&n.__checkIsValid(i))try{if(parseInt(t)>12)throw e.month;var o=t<10?"0"+t:t;return o==a?void 0!==i?i():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},d=function(t,i){if(0!=this._Chain&&n.__checkIsValid(i)){if(!Array.isArray(t))throw e.isNotArray;return n.__contains(t,a)?void 0!==i?i():1!=r||this:(this._Chain=!1,1==r&&this)}},_=function(t,o){if(0!=this._Chain&&n.__checkIsValid(o))try{if(!t.toString().match(i.year))throw e.year;return t==s?void 0!==o?o():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},l={Day:u,Days:c,DaysBetween:h,Month:f,MonthSelects:d,Year:_};return l},t.prototype.is=function(){var t=function(t,r){if(t)return void 0===r||r()},r=function(t,r){if(!t)return void 0===r||r()},e=function(t,r){var e="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;if(t==e)return void 0===r||r()},n=function(t,r){var e="undefined"===navigator.userLanguage?navigator.userLanguage:navigator.language;if(t==e.slice(0,2))return void 0===r||r()},i={True:t,False:r,Language:e,Lang:n};return i},t.prototype.timer=function(){var t=this.messages(),r=this.helpers(),e=function(e,n,i){var o=r.__typeToMilliseconds(e),a=typeof i;try{if(!o)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!r.__contains(["object","function"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in i))throw this.messages("key:before").notExist;if(!("before"in i))throw this.messages("key:after").notExist;if("function"!=typeof i.before)throw this.messages("before").shouldBeFunction;if("function"!=typeof i.after)throw this.messages("after").shouldBeFunction;return i.before(),setTimeout(function(){return i.after()},n*o)}if("function"===a)return setTimeout(function(){return i()},n*o)}catch(t){return void console.error(t)}},n=function(e,n,i){var o=r.__typeToMilliseconds(e),a=typeof i;try{if(!o)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!r.__contains(["object","function"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in i))throw this.messages("key:before").notExist;if(!("before"in i))throw this.messages("key:after").notExist;if("function"!=typeof i.before)throw this.messages("before").shouldBeFunction;if("function"!=typeof i.after)throw this.messages("after").shouldBeFunction;return i.before(),setInterval(function(){return i.after()},n*o)}if("function"===a)return setInterval(function(){return i()},n*o)}catch(t){return void console.error(t)}},i={After:e,Every:n};return i},t});
{
"name": "self-timer",
"version": "1.3.0",
"version": "1.3.1",
"description": "light-weight callback runner.",

@@ -5,0 +5,0 @@ "main": "./dist/selftimer.min.js",

@@ -187,2 +187,11 @@ ;(function(root, factory) {

/**
* @return {[ String ]}
*/
var __detectLang = function() {
return navigator.userLanguage === "undefined"
? navigator.userLanguage
: navigator.language;
} // ! __detectLang()
// Register methods

@@ -197,3 +206,4 @@ var REGISTER = {

__dateString: __dateString,
__typeToMilliseconds: __typeToMilliseconds
__typeToMilliseconds: __typeToMilliseconds,
__detectLang: __detectLang
};

@@ -200,0 +210,0 @@

@@ -178,2 +178,11 @@ "use strict";

/**
* @return {[ String ]}
*/
var __detectLang = function() {
return navigator.userLanguage === "undefined"
? navigator.userLanguage
: navigator.language;
} // ! __detectLang()
// Register methods

@@ -188,3 +197,4 @@ var REGISTER = {

__dateString: __dateString,
__typeToMilliseconds: __typeToMilliseconds
__typeToMilliseconds: __typeToMilliseconds,
__detectLang: __detectLang
};

@@ -191,0 +201,0 @@

@@ -187,2 +187,11 @@ ;(function(root, factory) {

/**
* @return {[ String ]}
*/
var __detectLang = function() {
return navigator.userLanguage === "undefined"
? navigator.userLanguage
: navigator.language;
} // ! __detectLang()
// Register methods

@@ -197,3 +206,4 @@ var REGISTER = {

__dateString: __dateString,
__typeToMilliseconds: __typeToMilliseconds
__typeToMilliseconds: __typeToMilliseconds,
__detectLang: __detectLang
};

@@ -200,0 +210,0 @@

@@ -188,2 +188,11 @@ !function(e){function n(){}function t(e,n){return function(){e.apply(n,arguments)}}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function i(e,n){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(n):(e._handled=!0,void o._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null===t)return void(1===e._state?r:u)(n.promise,e._value);var o;try{o=t(e._value)}catch(i){return void u(n.promise,i)}r(n.promise,o)}))}function r(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var i=n.then;if(n instanceof o)return e._state=3,e._value=n,void f(e);if("function"==typeof i)return void s(t(i,n),e)}e._state=1,e._value=n,f(e)}catch(r){u(e,r)}}function u(e,n){e._state=2,e._value=n,f(e)}function f(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var n=0,t=e._deferreds.length;n<t;n++)i(e,e._deferreds[n]);e._deferreds=null}function c(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}function s(e,n){var t=!1;try{e(function(e){t||(t=!0,r(n,e))},function(e){t||(t=!0,u(n,e))})}catch(o){if(t)return;t=!0,u(n,o)}}var a=setTimeout;o.prototype["catch"]=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var o=new this.constructor(n);return i(this,new c(e,t,o)),o},o.all=function(e){var n=Array.prototype.slice.call(e);return new o(function(e,t){function o(r,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var f=u.then;if("function"==typeof f)return void f.call(u,function(e){o(r,e)},t)}n[r]=u,0===--i&&e(n)}catch(c){t(c)}}if(0===n.length)return e([]);for(var i=n.length,r=0;r<n.length;r++)o(r,n[r])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(n){n(e)})},o.reject=function(e){return new o(function(n,t){t(e)})},o.race=function(e){return new o(function(n,t){for(var o=0,i=e.length;o<i;o++)e[o].then(n,t)})},o._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){a(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},"undefined"!=typeof module&&module.exports?module.exports=o:e.Promise||(e.Promise=o)}(this);

/**
* @return {[ String ]}
*/
var __detectLang = function() {
return navigator.userLanguage === "undefined"
? navigator.userLanguage
: navigator.language;
} // ! __detectLang()
// Register methods

@@ -198,3 +207,4 @@ var REGISTER = {

__dateString: __dateString,
__typeToMilliseconds: __typeToMilliseconds
__typeToMilliseconds: __typeToMilliseconds,
__detectLang: __detectLang
};

@@ -201,0 +211,0 @@

@@ -178,2 +178,11 @@ "use strict";

/**
* @return {[ String ]}
*/
var __detectLang = function() {
return navigator.userLanguage === "undefined"
? navigator.userLanguage
: navigator.language;
} // ! __detectLang()
// Register methods

@@ -188,3 +197,4 @@ var REGISTER = {

__dateString: __dateString,
__typeToMilliseconds: __typeToMilliseconds
__typeToMilliseconds: __typeToMilliseconds,
__detectLang: __detectLang
};

@@ -191,0 +201,0 @@

@@ -168,2 +168,11 @@ /**

/**
* @return {[ String ]}
*/
var __detectLang = function() {
return navigator.userLanguage === "undefined"
? navigator.userLanguage
: navigator.language;
} // ! __detectLang()
// Register methods

@@ -178,3 +187,4 @@ var REGISTER = {

__dateString: __dateString,
__typeToMilliseconds: __typeToMilliseconds
__typeToMilliseconds: __typeToMilliseconds,
__detectLang: __detectLang
};

@@ -181,0 +191,0 @@

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