fish-helper 0.0.52 → 0.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,s,l,i,a,r,n,c,h,_,o,u,d=require("tslib");const f=()=>null;t=new WeakMap,e=new WeakMap,s=new WeakMap,l=new WeakMap,i=new WeakMap,a=new WeakMap,r=new WeakMap,n=new WeakMap,c=new WeakMap,h=new WeakMap,_=new WeakMap,o=new WeakMap,u=new WeakMap;const v=new class{constructor(){t.set(this,1e3),e.set(this,36e5),s.set(this,null),l.set(this,null),i.set(this,t=>Object.prototype.toString.call(t).slice(8,-1)),a.set(this,t=>{if(!t)return Date.now();let e=null;e="string"==typeof t?t.replace(/(\-|\_)/g,"/"):new Date(t);let s=new Date(e);return"Invalid Date"===s.toString()&&(s=new Date(t)),s.getTime()}),r.set(this,t=>"Function"===d.__classPrivateFieldGet(this,i,"f").call(this,t)),n.set(this,t=>"Array"===d.__classPrivateFieldGet(this,i,"f").call(this,t)),c.set(this,t=>"Object"===d.__classPrivateFieldGet(this,i,"f").call(this,t)),h.set(this,t=>String(t).padStart(2,"0")),_.set(this,({date:t,hour:s=1,type:l="before_lt_hour"})=>{let i=d.__classPrivateFieldGet(this,a,"f").call(this,t);const r=new Date(i).getTime(),n=Date.now(),c=r<n,h=r>n;return"before_lt_hour"===l?c&&r+d.__classPrivateFieldGet(this,e,"f")*s>n:"before_gt_hour"===l?c&&r+d.__classPrivateFieldGet(this,e,"f")*s<n:"after_lt_hour"===l?h&&n+d.__classPrivateFieldGet(this,e,"f")*s>r:"after_gt_hour"===l&&(h&&n+d.__classPrivateFieldGet(this,e,"f")*s<r)}),this.offset_time=(t,e="minute")=>{const s=Math.abs(Date.now()-d.__classPrivateFieldGet(this,a,"f").call(this,t)),l=this.format_num2date(s);return"day"===e?d.__classPrivateFieldGet(this,h,"f").call(this,l.day):"hour"===e?d.__classPrivateFieldGet(this,h,"f").call(this,l.hour):"minute"===e?d.__classPrivateFieldGet(this,h,"f").call(this,l.minute):"second"===e?d.__classPrivateFieldGet(this,h,"f").call(this,l.seconds):"The second parameter has an error"},o.set(this,(e=0,s=f,i=d.__classPrivateFieldGet(this,t,"f"),a=0,r=Date.now())=>{if(e<=0)return clearTimeout(d.__classPrivateFieldGet(this,l,"f")),void d.__classPrivateFieldSet(this,l,null,"f");clearTimeout(d.__classPrivateFieldGet(this,l,"f")),d.__classPrivateFieldSet(this,l,setTimeout(()=>{a+=1,e-=d.__classPrivateFieldGet(this,t,"f");let l=this.format_timestamp_to_day_hour_minute_second(e);s({remain:e,obj:l});const i=Date.now()-(r+a*d.__classPrivateFieldGet(this,t,"f"));let n=d.__classPrivateFieldGet(this,t,"f")-i;n<0&&(n=0),d.__classPrivateFieldGet(this,o,"f").call(this,e,s,n,a,r)},i),"f")}),u.set(this,(e=0,l=f,i=d.__classPrivateFieldGet(this,t,"f"),a=0,r=Date.now())=>{if(e<=0)return clearTimeout(d.__classPrivateFieldGet(this,s,"f")),void d.__classPrivateFieldSet(this,s,null,"f");clearTimeout(d.__classPrivateFieldGet(this,s,"f")),d.__classPrivateFieldSet(this,s,setTimeout(()=>{a+=1,e-=d.__classPrivateFieldGet(this,t,"f");let s=this.format_num2date(e);l({remain:e,obj:s});const i=Date.now()-(r+a*d.__classPrivateFieldGet(this,t,"f"));let n=d.__classPrivateFieldGet(this,t,"f")-i;n<0&&(n=0),d.__classPrivateFieldGet(this,u,"f").call(this,e,l,n,a,r)},i),"f")}),this.sleep=t=>new Promise(e=>setTimeout(e,t)),this.roxFormatThousandth=(t,e="万")=>t<1e4?t:(Math.floor(t/1e3)/10).toFixed(1)+e,this.chunk=(t,e,s=!1)=>{if(!Array.isArray(t)||e<=0)return[];const l=[];for(let i=0;i<t.length;i+=e){const a=t.slice(i,i+e);s?a.length===e&&l.push(a):l.push(a)}return l},this.debounce=(t,e=200,s=!1)=>{let l,i=null;return function(...a){const r=this,n=s&&!i;return i&&clearTimeout(i),i=setTimeout(()=>{i=null,s||(l=t.apply(r,a))},e),n&&(l=t.apply(r,a)),l}},this.flatten=(t,e=!1)=>{let s=[];return t.forEach(t=>{e&&Array.isArray(t)?s=s.concat(this.flatten(t,e)):s.push(t)}),s},this.safeRequest=(t,e)=>t.then?t.catch?t.then(t=>[null,t]).catch(t=>(e&&Object.assign(t,e),[t,void 0])):t.then(t=>[null,t]):Promise.resolve([null,t])}before_lt_hour(t=Date.now(),e=1){return d.__classPrivateFieldGet(this,_,"f").call(this,{date:t,hour:e,type:"before_lt_hour"})}before_gt_hour(t=Date.now(),e=1){return d.__classPrivateFieldGet(this,_,"f").call(this,{date:t,hour:e,type:"before_gt_hour"})}after_lt_hour(t=Date.now(),e=1){return d.__classPrivateFieldGet(this,_,"f").call(this,{date:t,hour:e,type:"after_lt_hour"})}after_gt_hour(t=Date.now(),e=1){return d.__classPrivateFieldGet(this,_,"f").call(this,{date:t,hour:e,type:"after_gt_hour"})}is_current_year(t){const e=d.__classPrivateFieldGet(this,a,"f").call(this,t);return(new Date).getFullYear()===new Date(e).getFullYear()}get_time_obj(t){const e=d.__classPrivateFieldGet(this,a,"f").call(this,t),s=new Date(e),l=d.__classPrivateFieldGet(this,h,"f").call(this,s.getMonth()+1),i=d.__classPrivateFieldGet(this,h,"f").call(this,s.getDate()),r=d.__classPrivateFieldGet(this,h,"f").call(this,s.getHours()),n=d.__classPrivateFieldGet(this,h,"f").call(this,s.getMinutes()),c=d.__classPrivateFieldGet(this,h,"f").call(this,s.getSeconds());return{year:String(s.getFullYear()),month:l,day:i,hour:r,minute:n,seconds:c,day_of_week:String(s.getDay())}}format_count({num:t=0,decimal:e=1,divide:s=1e4,suffix:l="万",show_suffix_always:i=!1}){if(!t)return 0;if(s<=0||e<0)return i?`${t} ${l}`:t;const a=parseFloat(t);if(a<=0)return i?`${a} ${l}`:a;if(a>0&&a<s)return i?`${a} ${l}`:a;const[r,n]=(a/s).toFixed(e).split(".");return n&&0!==parseFloat(n)?`${r}.${n} ${l}`:`${r} ${l}`}format_num2date(t=Date.now()){const e=parseInt(t/1e3/60/60/24%24),s=parseInt(t/1e3/60/60%24),l=parseInt(t/1e3/60%60),i=parseInt(t/1e3%60);return{day:d.__classPrivateFieldGet(this,h,"f").call(this,e),hour:d.__classPrivateFieldGet(this,h,"f").call(this,s),minute:d.__classPrivateFieldGet(this,h,"f").call(this,l),seconds:d.__classPrivateFieldGet(this,h,"f").call(this,i)}}count_down_by_remain_seconds(t=f,e=60){let s;clearTimeout(s);let l=1e3*e,i=this.format_num2date(l),a={remain:l,obj:i};t(a);let r=this;return function t(e=0,n=f,c=1e3,h=0,_=Date.now()){if(e<=0)return clearTimeout(s),r=null,s=null,l=null,i=null,a=null,void n({remain:0,obj:{day:"00",hour:"00",minute:"00",seconds:"00"}});clearTimeout(s),s=setTimeout(()=>{h+=1,e-=1e3;let s=r.format_num2date(e);n({remain:e,obj:s});let l=1e3-(Date.now()-(_+1e3*h));l<0&&(l=0),t(e,n,l,h,_)},c)}(l,t,1e3),()=>{clearTimeout(s),r=null,s=null,l=null,i=null,a=null}}format_timestamp_to_day_hour_minute_second(t=Date.now()){const e=Math.floor(t/864e5),s=Math.floor(t%864e5/36e5),l=Math.floor(t%36e5/6e4),i=Math.floor(t%6e4/1e3);return{day:d.__classPrivateFieldGet(this,h,"f").call(this,e),hour:d.__classPrivateFieldGet(this,h,"f").call(this,s),minute:d.__classPrivateFieldGet(this,h,"f").call(this,l),seconds:d.__classPrivateFieldGet(this,h,"f").call(this,i)}}count_down(t=Date.now(),e=f){let s;clearTimeout(s);let l=this,i=d.__classPrivateFieldGet(this,a,"f").call(this,t),r=i-Date.now(),n=this.format_timestamp_to_day_hour_minute_second(r),c={remain:r,obj:n};return e(c),function t(e=0,a=f,h=1e3,_=0,o=Date.now()){if(e<=0)return clearTimeout(s),s=null,l=null,i=null,r=null,n=null,c=null,void a({remain:0,obj:{day:"00",hour:"00",minute:"00",seconds:"00"}});clearTimeout(s),s=setTimeout(()=>{_+=1,e-=1e3;let s=l.format_timestamp_to_day_hour_minute_second(e);a({remain:e,obj:s});let i=1e3-(Date.now()-(o+1e3*_));i<0&&(i=0),t(e,a,i,_,o)},h)}(r,e,1e3),()=>{clearTimeout(s),s=null,l=null,i=null,r=null,n=null,c=null}}add(t=1,e=Date.now()){return d.__classPrivateFieldGet(this,a,"f").call(this,e)+60*t*60*1e3}format_thousandth(t,e=2){try{const s=parseFloat(t),l=s.toString().split(".");let i=!1,a="";l[1]&&(a=l[1].replace(/0+$/,""),i=a.length>0);let r=0;i&&(r=void 0!==e?e:a.length);const n=s.toFixed(r).split("."),c=(n[0]||"").replace(/(\d)(?=(\d{3})+$)/g,"$1,");return n[1]?`${c}.${n[1]}`:c}catch(t){return 0}}format_thousandth_with_same_dotlen(t){var e;try{const s=(null===(e=t.toString().split(".")[1])||void 0===e?void 0:e.length)||0;let l=t.toString().replace(/\d+/,function(t){return t.replace(/(\d)(?=(\d{3})+$)/g,function(t){return t+","})});return s&&(l=l.replace(/\d+\.\d+/,function(t){return t.replace(/(\d)(?=(\d{3})+\.)/g,function(t){return t+","})})),l}catch(t){return 0}}is_empty(t){return null==t||("String"===d.__classPrivateFieldGet(this,i,"f").call(this,t)?!t.trim():"Array"===d.__classPrivateFieldGet(this,i,"f").call(this,t)?!t.length:"Object"===d.__classPrivateFieldGet(this,i,"f").call(this,t)&&!Object.keys(t).length)}poll(t,e=1){let s;if(!d.__classPrivateFieldGet(this,r,"f").call(this,t))return()=>{clearTimeout(s),s=void 0};const l=60*e*1e3,i=()=>{t(),s=setTimeout(i,l)};return i(),()=>{clearTimeout(s),s=void 0}}is_equal(t,e,s=!1){const l=d.__classPrivateFieldGet(this,n,"f").call(this,t)||d.__classPrivateFieldGet(this,c,"f").call(this,t),i=d.__classPrivateFieldGet(this,n,"f").call(this,e)||d.__classPrivateFieldGet(this,c,"f").call(this,e);if(!l||!i)return s?t===e:t==e;const a=Object.keys(t),r=Object.keys(e);return 0===a.length&&0===r.length||a.length===r.length&&a.every(l=>{const i=d.__classPrivateFieldGet(this,n,"f").call(this,t[l])||d.__classPrivateFieldGet(this,c,"f").call(this,t[l]),a=d.__classPrivateFieldGet(this,n,"f").call(this,e[l])||d.__classPrivateFieldGet(this,c,"f").call(this,e[l]);return i&&a?this.is_equal(t[l],e[l],s):s?t[l]===e[l]:t[l]==e[l]})}contains(t,e,s=!1){const l=d.__classPrivateFieldGet(this,n,"f").call(this,t)||d.__classPrivateFieldGet(this,c,"f").call(this,t),i=d.__classPrivateFieldGet(this,n,"f").call(this,e)||d.__classPrivateFieldGet(this,c,"f").call(this,e);if(!l||!i)return s?t===e:t==e;const a=Object.keys(t),r=Object.keys(e);return 0===r.length||!(0===a.length||a.length<r.length)&&r.every(l=>{if(a.indexOf(l)<0)return!1;const i=d.__classPrivateFieldGet(this,n,"f").call(this,t[l])||d.__classPrivateFieldGet(this,c,"f").call(this,t[l]),r=d.__classPrivateFieldGet(this,n,"f").call(this,e[l])||d.__classPrivateFieldGet(this,c,"f").call(this,e[l]);return i&&r?this.contains(t[l],e[l],s):s?t[l]===e[l]:t[l]==e[l]})}};exports.default=v,exports.helper=v;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,s,l,i,a,r,n,c,h,_,o,u,d=require("tslib");const f=()=>null;t=new WeakMap,e=new WeakMap,s=new WeakMap,l=new WeakMap,i=new WeakMap,a=new WeakMap,r=new WeakMap,n=new WeakMap,c=new WeakMap,h=new WeakMap,_=new WeakMap,o=new WeakMap,u=new WeakMap;const v=new class{constructor(){t.set(this,1e3),e.set(this,36e5),s.set(this,null),l.set(this,null),i.set(this,t=>Object.prototype.toString.call(t).slice(8,-1)),a.set(this,t=>{if(!t)return Date.now();let e=null;e="string"==typeof t?t.replace(/(\-|\_)/g,"/"):new Date(t);let s=new Date(e);return"Invalid Date"===s.toString()&&(s=new Date(t)),s.getTime()}),r.set(this,t=>"Function"===d.__classPrivateFieldGet(this,i,"f").call(this,t)),n.set(this,t=>"Array"===d.__classPrivateFieldGet(this,i,"f").call(this,t)),c.set(this,t=>"Object"===d.__classPrivateFieldGet(this,i,"f").call(this,t)),h.set(this,t=>String(t).padStart(2,"0")),_.set(this,({date:t,hour:s=1,type:l="before_lt_hour"})=>{let i=d.__classPrivateFieldGet(this,a,"f").call(this,t);const r=new Date(i).getTime(),n=Date.now(),c=r<n,h=r>n;return"before_lt_hour"===l?c&&r+d.__classPrivateFieldGet(this,e,"f")*s>n:"before_gt_hour"===l?c&&r+d.__classPrivateFieldGet(this,e,"f")*s<n:"after_lt_hour"===l?h&&n+d.__classPrivateFieldGet(this,e,"f")*s>r:"after_gt_hour"===l&&(h&&n+d.__classPrivateFieldGet(this,e,"f")*s<r)}),this.offset_time=(t,e="minute")=>{const s=Math.abs(Date.now()-d.__classPrivateFieldGet(this,a,"f").call(this,t)),l=this.format_num2date(s);return"day"===e?d.__classPrivateFieldGet(this,h,"f").call(this,l.day):"hour"===e?d.__classPrivateFieldGet(this,h,"f").call(this,l.hour):"minute"===e?d.__classPrivateFieldGet(this,h,"f").call(this,l.minute):"second"===e?d.__classPrivateFieldGet(this,h,"f").call(this,l.seconds):"The second parameter has an error"},o.set(this,(e=0,s=f,i=d.__classPrivateFieldGet(this,t,"f"),a=0,r=Date.now())=>{if(e<=0)return clearTimeout(d.__classPrivateFieldGet(this,l,"f")),void d.__classPrivateFieldSet(this,l,null,"f");clearTimeout(d.__classPrivateFieldGet(this,l,"f")),d.__classPrivateFieldSet(this,l,setTimeout(()=>{a+=1,e-=d.__classPrivateFieldGet(this,t,"f");let l=this.format_timestamp_to_day_hour_minute_second(e);s({remain:e,obj:l});const i=Date.now()-(r+a*d.__classPrivateFieldGet(this,t,"f"));let n=d.__classPrivateFieldGet(this,t,"f")-i;n<0&&(n=0),d.__classPrivateFieldGet(this,o,"f").call(this,e,s,n,a,r)},i),"f")}),u.set(this,(e=0,l=f,i=d.__classPrivateFieldGet(this,t,"f"),a=0,r=Date.now())=>{if(e<=0)return clearTimeout(d.__classPrivateFieldGet(this,s,"f")),void d.__classPrivateFieldSet(this,s,null,"f");clearTimeout(d.__classPrivateFieldGet(this,s,"f")),d.__classPrivateFieldSet(this,s,setTimeout(()=>{a+=1,e-=d.__classPrivateFieldGet(this,t,"f");let s=this.format_num2date(e);l({remain:e,obj:s});const i=Date.now()-(r+a*d.__classPrivateFieldGet(this,t,"f"));let n=d.__classPrivateFieldGet(this,t,"f")-i;n<0&&(n=0),d.__classPrivateFieldGet(this,u,"f").call(this,e,l,n,a,r)},i),"f")}),this.sleep=t=>new Promise(e=>setTimeout(e,t)),this.roxFormatThousandth=(t,e="万")=>t<1e4?t:(Math.floor(t/1e3)/10).toFixed(1)+e,this.chunk=(t,e,s=!1)=>{if(!Array.isArray(t)||e<=0)return[];const l=[];for(let i=0;i<t.length;i+=e){const a=t.slice(i,i+e);s?a.length===e&&l.push(a):l.push(a)}return l},this.debounce=(t,e=200,s=!1)=>{let l,i=null;return function(...a){const r=this,n=s&&!i;return i&&clearTimeout(i),i=setTimeout(()=>{i=null,s||(l=t.apply(r,a))},e),n&&(l=t.apply(r,a)),l}},this.flatten=(t,e=!1)=>{let s=[];return t.forEach(t=>{e&&Array.isArray(t)?s=s.concat(this.flatten(t,e)):s.push(t)}),s},this.safeRequest=(t,e)=>t&&t.then?t.catch?t.then(t=>[null,t]).catch(t=>(e&&Object.assign(t,e),[t,void 0])):t.then(t=>[null,t]):Promise.resolve([null,t])}before_lt_hour(t=Date.now(),e=1){return d.__classPrivateFieldGet(this,_,"f").call(this,{date:t,hour:e,type:"before_lt_hour"})}before_gt_hour(t=Date.now(),e=1){return d.__classPrivateFieldGet(this,_,"f").call(this,{date:t,hour:e,type:"before_gt_hour"})}after_lt_hour(t=Date.now(),e=1){return d.__classPrivateFieldGet(this,_,"f").call(this,{date:t,hour:e,type:"after_lt_hour"})}after_gt_hour(t=Date.now(),e=1){return d.__classPrivateFieldGet(this,_,"f").call(this,{date:t,hour:e,type:"after_gt_hour"})}is_current_year(t){const e=d.__classPrivateFieldGet(this,a,"f").call(this,t);return(new Date).getFullYear()===new Date(e).getFullYear()}get_time_obj(t){const e=d.__classPrivateFieldGet(this,a,"f").call(this,t),s=new Date(e),l=d.__classPrivateFieldGet(this,h,"f").call(this,s.getMonth()+1),i=d.__classPrivateFieldGet(this,h,"f").call(this,s.getDate()),r=d.__classPrivateFieldGet(this,h,"f").call(this,s.getHours()),n=d.__classPrivateFieldGet(this,h,"f").call(this,s.getMinutes()),c=d.__classPrivateFieldGet(this,h,"f").call(this,s.getSeconds());return{year:String(s.getFullYear()),month:l,day:i,hour:r,minute:n,seconds:c,day_of_week:String(s.getDay())}}format_count({num:t=0,decimal:e=1,divide:s=1e4,suffix:l="万",show_suffix_always:i=!1}){if(!t)return 0;if(s<=0||e<0)return i?`${t} ${l}`:t;const a=parseFloat(t);if(a<=0)return i?`${a} ${l}`:a;if(a>0&&a<s)return i?`${a} ${l}`:a;const[r,n]=(a/s).toFixed(e).split(".");return n&&0!==parseFloat(n)?`${r}.${n} ${l}`:`${r} ${l}`}format_num2date(t=Date.now()){const e=parseInt(t/1e3/60/60/24%24),s=parseInt(t/1e3/60/60%24),l=parseInt(t/1e3/60%60),i=parseInt(t/1e3%60);return{day:d.__classPrivateFieldGet(this,h,"f").call(this,e),hour:d.__classPrivateFieldGet(this,h,"f").call(this,s),minute:d.__classPrivateFieldGet(this,h,"f").call(this,l),seconds:d.__classPrivateFieldGet(this,h,"f").call(this,i)}}count_down_by_remain_seconds(t=f,e=60){let s;clearTimeout(s);let l=1e3*e,i=this.format_num2date(l),a={remain:l,obj:i};t(a);let r=this;return function t(e=0,n=f,c=1e3,h=0,_=Date.now()){if(e<=0)return clearTimeout(s),r=null,s=null,l=null,i=null,a=null,void n({remain:0,obj:{day:"00",hour:"00",minute:"00",seconds:"00"}});clearTimeout(s),s=setTimeout(()=>{h+=1,e-=1e3;let s=r.format_num2date(e);n({remain:e,obj:s});let l=1e3-(Date.now()-(_+1e3*h));l<0&&(l=0),t(e,n,l,h,_)},c)}(l,t,1e3),()=>{clearTimeout(s),r=null,s=null,l=null,i=null,a=null}}format_timestamp_to_day_hour_minute_second(t=Date.now()){const e=Math.floor(t/864e5),s=Math.floor(t%864e5/36e5),l=Math.floor(t%36e5/6e4),i=Math.floor(t%6e4/1e3);return{day:d.__classPrivateFieldGet(this,h,"f").call(this,e),hour:d.__classPrivateFieldGet(this,h,"f").call(this,s),minute:d.__classPrivateFieldGet(this,h,"f").call(this,l),seconds:d.__classPrivateFieldGet(this,h,"f").call(this,i)}}count_down(t=Date.now(),e=f){let s;clearTimeout(s);let l=this,i=d.__classPrivateFieldGet(this,a,"f").call(this,t),r=i-Date.now(),n=this.format_timestamp_to_day_hour_minute_second(r),c={remain:r,obj:n};return e(c),function t(e=0,a=f,h=1e3,_=0,o=Date.now()){if(e<=0)return clearTimeout(s),s=null,l=null,i=null,r=null,n=null,c=null,void a({remain:0,obj:{day:"00",hour:"00",minute:"00",seconds:"00"}});clearTimeout(s),s=setTimeout(()=>{_+=1,e-=1e3;let s=l.format_timestamp_to_day_hour_minute_second(e);a({remain:e,obj:s});let i=1e3-(Date.now()-(o+1e3*_));i<0&&(i=0),t(e,a,i,_,o)},h)}(r,e,1e3),()=>{clearTimeout(s),s=null,l=null,i=null,r=null,n=null,c=null}}add(t=1,e=Date.now()){return d.__classPrivateFieldGet(this,a,"f").call(this,e)+60*t*60*1e3}format_thousandth(t,e=2){try{const s=parseFloat(t),l=s.toString().split(".");let i=!1,a="";l[1]&&(a=l[1].replace(/0+$/,""),i=a.length>0);let r=0;i&&(r=void 0!==e?e:a.length);const n=s.toFixed(r).split("."),c=(n[0]||"").replace(/(\d)(?=(\d{3})+$)/g,"$1,");return n[1]?`${c}.${n[1]}`:c}catch(t){return 0}}format_thousandth_with_same_dotlen(t){var e;try{const s=(null===(e=t.toString().split(".")[1])||void 0===e?void 0:e.length)||0;let l=t.toString().replace(/\d+/,function(t){return t.replace(/(\d)(?=(\d{3})+$)/g,function(t){return t+","})});return s&&(l=l.replace(/\d+\.\d+/,function(t){return t.replace(/(\d)(?=(\d{3})+\.)/g,function(t){return t+","})})),l}catch(t){return 0}}is_empty(t){return null==t||("String"===d.__classPrivateFieldGet(this,i,"f").call(this,t)?!t.trim():"Array"===d.__classPrivateFieldGet(this,i,"f").call(this,t)?!t.length:"Object"===d.__classPrivateFieldGet(this,i,"f").call(this,t)&&!Object.keys(t).length)}poll(t,e=1){let s;if(!d.__classPrivateFieldGet(this,r,"f").call(this,t))return()=>{clearTimeout(s),s=void 0};const l=60*e*1e3,i=()=>{t(),s=setTimeout(i,l)};return i(),()=>{clearTimeout(s),s=void 0}}is_equal(t,e,s=!1){const l=d.__classPrivateFieldGet(this,n,"f").call(this,t)||d.__classPrivateFieldGet(this,c,"f").call(this,t),i=d.__classPrivateFieldGet(this,n,"f").call(this,e)||d.__classPrivateFieldGet(this,c,"f").call(this,e);if(!l||!i)return s?t===e:t==e;const a=Object.keys(t),r=Object.keys(e);return 0===a.length&&0===r.length||a.length===r.length&&a.every(l=>{const i=d.__classPrivateFieldGet(this,n,"f").call(this,t[l])||d.__classPrivateFieldGet(this,c,"f").call(this,t[l]),a=d.__classPrivateFieldGet(this,n,"f").call(this,e[l])||d.__classPrivateFieldGet(this,c,"f").call(this,e[l]);return i&&a?this.is_equal(t[l],e[l],s):s?t[l]===e[l]:t[l]==e[l]})}contains(t,e,s=!1){const l=d.__classPrivateFieldGet(this,n,"f").call(this,t)||d.__classPrivateFieldGet(this,c,"f").call(this,t),i=d.__classPrivateFieldGet(this,n,"f").call(this,e)||d.__classPrivateFieldGet(this,c,"f").call(this,e);if(!l||!i)return s?t===e:t==e;const a=Object.keys(t),r=Object.keys(e);return 0===r.length||!(0===a.length||a.length<r.length)&&r.every(l=>{if(a.indexOf(l)<0)return!1;const i=d.__classPrivateFieldGet(this,n,"f").call(this,t[l])||d.__classPrivateFieldGet(this,c,"f").call(this,t[l]),r=d.__classPrivateFieldGet(this,n,"f").call(this,e[l])||d.__classPrivateFieldGet(this,c,"f").call(this,e[l]);return i&&r?this.contains(t[l],e[l],s):s?t[l]===e[l]:t[l]==e[l]})}};exports.default=v,exports.helper=v;
package/dist/es/index.js CHANGED
@@ -1 +1 @@
1
- import{__classPrivateFieldGet as t,__classPrivateFieldSet as e}from"tslib";var s,i,l,n,a,r,h,o,u,c,f,m,_;const d=()=>null;s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,h=new WeakMap,o=new WeakMap,u=new WeakMap,c=new WeakMap,f=new WeakMap,m=new WeakMap,_=new WeakMap;const p=new class{constructor(){s.set(this,1e3),i.set(this,36e5),l.set(this,null),n.set(this,null),a.set(this,t=>Object.prototype.toString.call(t).slice(8,-1)),r.set(this,t=>{if(!t)return Date.now();let e=null;e="string"==typeof t?t.replace(/(\-|\_)/g,"/"):new Date(t);let s=new Date(e);return"Invalid Date"===s.toString()&&(s=new Date(t)),s.getTime()}),h.set(this,e=>"Function"===t(this,a,"f").call(this,e)),o.set(this,e=>"Array"===t(this,a,"f").call(this,e)),u.set(this,e=>"Object"===t(this,a,"f").call(this,e)),c.set(this,t=>String(t).padStart(2,"0")),f.set(this,({date:e,hour:s=1,type:l="before_lt_hour"})=>{let n=t(this,r,"f").call(this,e);const a=new Date(n).getTime(),h=Date.now(),o=a<h,u=a>h;return"before_lt_hour"===l?o&&a+t(this,i,"f")*s>h:"before_gt_hour"===l?o&&a+t(this,i,"f")*s<h:"after_lt_hour"===l?u&&h+t(this,i,"f")*s>a:"after_gt_hour"===l&&(u&&h+t(this,i,"f")*s<a)}),this.offset_time=(e,s="minute")=>{const i=Math.abs(Date.now()-t(this,r,"f").call(this,e)),l=this.format_num2date(i);return"day"===s?t(this,c,"f").call(this,l.day):"hour"===s?t(this,c,"f").call(this,l.hour):"minute"===s?t(this,c,"f").call(this,l.minute):"second"===s?t(this,c,"f").call(this,l.seconds):"The second parameter has an error"},m.set(this,(i=0,l=d,a=t(this,s,"f"),r=0,h=Date.now())=>{if(i<=0)return clearTimeout(t(this,n,"f")),void e(this,n,null,"f");clearTimeout(t(this,n,"f")),e(this,n,setTimeout(()=>{r+=1,i-=t(this,s,"f");let e=this.format_timestamp_to_day_hour_minute_second(i);l({remain:i,obj:e});const n=Date.now()-(h+r*t(this,s,"f"));let a=t(this,s,"f")-n;a<0&&(a=0),t(this,m,"f").call(this,i,l,a,r,h)},a),"f")}),_.set(this,(i=0,n=d,a=t(this,s,"f"),r=0,h=Date.now())=>{if(i<=0)return clearTimeout(t(this,l,"f")),void e(this,l,null,"f");clearTimeout(t(this,l,"f")),e(this,l,setTimeout(()=>{r+=1,i-=t(this,s,"f");let e=this.format_num2date(i);n({remain:i,obj:e});const l=Date.now()-(h+r*t(this,s,"f"));let a=t(this,s,"f")-l;a<0&&(a=0),t(this,_,"f").call(this,i,n,a,r,h)},a),"f")}),this.sleep=t=>new Promise(e=>setTimeout(e,t)),this.roxFormatThousandth=(t,e="万")=>t<1e4?t:(Math.floor(t/1e3)/10).toFixed(1)+e,this.chunk=(t,e,s=!1)=>{if(!Array.isArray(t)||e<=0)return[];const i=[];for(let l=0;l<t.length;l+=e){const n=t.slice(l,l+e);s?n.length===e&&i.push(n):i.push(n)}return i},this.debounce=(t,e=200,s=!1)=>{let i,l=null;return function(...n){const a=this,r=s&&!l;return l&&clearTimeout(l),l=setTimeout(()=>{l=null,s||(i=t.apply(a,n))},e),r&&(i=t.apply(a,n)),i}},this.flatten=(t,e=!1)=>{let s=[];return t.forEach(t=>{e&&Array.isArray(t)?s=s.concat(this.flatten(t,e)):s.push(t)}),s},this.safeRequest=(t,e)=>t.then?t.catch?t.then(t=>[null,t]).catch(t=>(e&&Object.assign(t,e),[t,void 0])):t.then(t=>[null,t]):Promise.resolve([null,t])}before_lt_hour(e=Date.now(),s=1){return t(this,f,"f").call(this,{date:e,hour:s,type:"before_lt_hour"})}before_gt_hour(e=Date.now(),s=1){return t(this,f,"f").call(this,{date:e,hour:s,type:"before_gt_hour"})}after_lt_hour(e=Date.now(),s=1){return t(this,f,"f").call(this,{date:e,hour:s,type:"after_lt_hour"})}after_gt_hour(e=Date.now(),s=1){return t(this,f,"f").call(this,{date:e,hour:s,type:"after_gt_hour"})}is_current_year(e){const s=t(this,r,"f").call(this,e);return(new Date).getFullYear()===new Date(s).getFullYear()}get_time_obj(e){const s=t(this,r,"f").call(this,e),i=new Date(s),l=t(this,c,"f").call(this,i.getMonth()+1),n=t(this,c,"f").call(this,i.getDate()),a=t(this,c,"f").call(this,i.getHours()),h=t(this,c,"f").call(this,i.getMinutes()),o=t(this,c,"f").call(this,i.getSeconds());return{year:String(i.getFullYear()),month:l,day:n,hour:a,minute:h,seconds:o,day_of_week:String(i.getDay())}}format_count({num:t=0,decimal:e=1,divide:s=1e4,suffix:i="万",show_suffix_always:l=!1}){if(!t)return 0;if(s<=0||e<0)return l?`${t} ${i}`:t;const n=parseFloat(t);if(n<=0)return l?`${n} ${i}`:n;if(n>0&&n<s)return l?`${n} ${i}`:n;const[a,r]=(n/s).toFixed(e).split(".");return r&&0!==parseFloat(r)?`${a}.${r} ${i}`:`${a} ${i}`}format_num2date(e=Date.now()){const s=parseInt(e/1e3/60/60/24%24),i=parseInt(e/1e3/60/60%24),l=parseInt(e/1e3/60%60),n=parseInt(e/1e3%60);return{day:t(this,c,"f").call(this,s),hour:t(this,c,"f").call(this,i),minute:t(this,c,"f").call(this,l),seconds:t(this,c,"f").call(this,n)}}count_down_by_remain_seconds(t=d,e=60){let s;clearTimeout(s);let i=1e3*e,l=this.format_num2date(i),n={remain:i,obj:l};t(n);let a=this;return function t(e=0,r=d,h=1e3,o=0,u=Date.now()){if(e<=0)return clearTimeout(s),a=null,s=null,i=null,l=null,n=null,void r({remain:0,obj:{day:"00",hour:"00",minute:"00",seconds:"00"}});clearTimeout(s),s=setTimeout(()=>{o+=1,e-=1e3;let s=a.format_num2date(e);r({remain:e,obj:s});let i=1e3-(Date.now()-(u+1e3*o));i<0&&(i=0),t(e,r,i,o,u)},h)}(i,t,1e3),()=>{clearTimeout(s),a=null,s=null,i=null,l=null,n=null}}format_timestamp_to_day_hour_minute_second(e=Date.now()){const s=Math.floor(e/864e5),i=Math.floor(e%864e5/36e5),l=Math.floor(e%36e5/6e4),n=Math.floor(e%6e4/1e3);return{day:t(this,c,"f").call(this,s),hour:t(this,c,"f").call(this,i),minute:t(this,c,"f").call(this,l),seconds:t(this,c,"f").call(this,n)}}count_down(e=Date.now(),s=d){let i;clearTimeout(i);let l=this,n=t(this,r,"f").call(this,e),a=n-Date.now(),h=this.format_timestamp_to_day_hour_minute_second(a),o={remain:a,obj:h};return s(o),function t(e=0,s=d,r=1e3,u=0,c=Date.now()){if(e<=0)return clearTimeout(i),i=null,l=null,n=null,a=null,h=null,o=null,void s({remain:0,obj:{day:"00",hour:"00",minute:"00",seconds:"00"}});clearTimeout(i),i=setTimeout(()=>{u+=1,e-=1e3;let i=l.format_timestamp_to_day_hour_minute_second(e);s({remain:e,obj:i});let n=1e3-(Date.now()-(c+1e3*u));n<0&&(n=0),t(e,s,n,u,c)},r)}(a,s,1e3),()=>{clearTimeout(i),i=null,l=null,n=null,a=null,h=null,o=null}}add(e=1,s=Date.now()){return t(this,r,"f").call(this,s)+60*e*60*1e3}format_thousandth(t,e=2){try{const s=parseFloat(t),i=s.toString().split(".");let l=!1,n="";i[1]&&(n=i[1].replace(/0+$/,""),l=n.length>0);let a=0;l&&(a=void 0!==e?e:n.length);const r=s.toFixed(a).split("."),h=(r[0]||"").replace(/(\d)(?=(\d{3})+$)/g,"$1,");return r[1]?`${h}.${r[1]}`:h}catch(t){return 0}}format_thousandth_with_same_dotlen(t){var e;try{const s=(null===(e=t.toString().split(".")[1])||void 0===e?void 0:e.length)||0;let i=t.toString().replace(/\d+/,function(t){return t.replace(/(\d)(?=(\d{3})+$)/g,function(t){return t+","})});return s&&(i=i.replace(/\d+\.\d+/,function(t){return t.replace(/(\d)(?=(\d{3})+\.)/g,function(t){return t+","})})),i}catch(t){return 0}}is_empty(e){return null==e||("String"===t(this,a,"f").call(this,e)?!e.trim():"Array"===t(this,a,"f").call(this,e)?!e.length:"Object"===t(this,a,"f").call(this,e)&&!Object.keys(e).length)}poll(e,s=1){let i;if(!t(this,h,"f").call(this,e))return()=>{clearTimeout(i),i=void 0};const l=60*s*1e3,n=()=>{e(),i=setTimeout(n,l)};return n(),()=>{clearTimeout(i),i=void 0}}is_equal(e,s,i=!1){const l=t(this,o,"f").call(this,e)||t(this,u,"f").call(this,e),n=t(this,o,"f").call(this,s)||t(this,u,"f").call(this,s);if(!l||!n)return i?e===s:e==s;const a=Object.keys(e),r=Object.keys(s);return 0===a.length&&0===r.length||a.length===r.length&&a.every(l=>{const n=t(this,o,"f").call(this,e[l])||t(this,u,"f").call(this,e[l]),a=t(this,o,"f").call(this,s[l])||t(this,u,"f").call(this,s[l]);return n&&a?this.is_equal(e[l],s[l],i):i?e[l]===s[l]:e[l]==s[l]})}contains(e,s,i=!1){const l=t(this,o,"f").call(this,e)||t(this,u,"f").call(this,e),n=t(this,o,"f").call(this,s)||t(this,u,"f").call(this,s);if(!l||!n)return i?e===s:e==s;const a=Object.keys(e),r=Object.keys(s);return 0===r.length||!(0===a.length||a.length<r.length)&&r.every(l=>{if(a.indexOf(l)<0)return!1;const n=t(this,o,"f").call(this,e[l])||t(this,u,"f").call(this,e[l]),r=t(this,o,"f").call(this,s[l])||t(this,u,"f").call(this,s[l]);return n&&r?this.contains(e[l],s[l],i):i?e[l]===s[l]:e[l]==s[l]})}};export{p as default,p as helper};
1
+ import{__classPrivateFieldGet as t,__classPrivateFieldSet as e}from"tslib";var s,i,l,n,a,r,h,o,u,c,f,m,_;const d=()=>null;s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,h=new WeakMap,o=new WeakMap,u=new WeakMap,c=new WeakMap,f=new WeakMap,m=new WeakMap,_=new WeakMap;const p=new class{constructor(){s.set(this,1e3),i.set(this,36e5),l.set(this,null),n.set(this,null),a.set(this,t=>Object.prototype.toString.call(t).slice(8,-1)),r.set(this,t=>{if(!t)return Date.now();let e=null;e="string"==typeof t?t.replace(/(\-|\_)/g,"/"):new Date(t);let s=new Date(e);return"Invalid Date"===s.toString()&&(s=new Date(t)),s.getTime()}),h.set(this,e=>"Function"===t(this,a,"f").call(this,e)),o.set(this,e=>"Array"===t(this,a,"f").call(this,e)),u.set(this,e=>"Object"===t(this,a,"f").call(this,e)),c.set(this,t=>String(t).padStart(2,"0")),f.set(this,({date:e,hour:s=1,type:l="before_lt_hour"})=>{let n=t(this,r,"f").call(this,e);const a=new Date(n).getTime(),h=Date.now(),o=a<h,u=a>h;return"before_lt_hour"===l?o&&a+t(this,i,"f")*s>h:"before_gt_hour"===l?o&&a+t(this,i,"f")*s<h:"after_lt_hour"===l?u&&h+t(this,i,"f")*s>a:"after_gt_hour"===l&&(u&&h+t(this,i,"f")*s<a)}),this.offset_time=(e,s="minute")=>{const i=Math.abs(Date.now()-t(this,r,"f").call(this,e)),l=this.format_num2date(i);return"day"===s?t(this,c,"f").call(this,l.day):"hour"===s?t(this,c,"f").call(this,l.hour):"minute"===s?t(this,c,"f").call(this,l.minute):"second"===s?t(this,c,"f").call(this,l.seconds):"The second parameter has an error"},m.set(this,(i=0,l=d,a=t(this,s,"f"),r=0,h=Date.now())=>{if(i<=0)return clearTimeout(t(this,n,"f")),void e(this,n,null,"f");clearTimeout(t(this,n,"f")),e(this,n,setTimeout(()=>{r+=1,i-=t(this,s,"f");let e=this.format_timestamp_to_day_hour_minute_second(i);l({remain:i,obj:e});const n=Date.now()-(h+r*t(this,s,"f"));let a=t(this,s,"f")-n;a<0&&(a=0),t(this,m,"f").call(this,i,l,a,r,h)},a),"f")}),_.set(this,(i=0,n=d,a=t(this,s,"f"),r=0,h=Date.now())=>{if(i<=0)return clearTimeout(t(this,l,"f")),void e(this,l,null,"f");clearTimeout(t(this,l,"f")),e(this,l,setTimeout(()=>{r+=1,i-=t(this,s,"f");let e=this.format_num2date(i);n({remain:i,obj:e});const l=Date.now()-(h+r*t(this,s,"f"));let a=t(this,s,"f")-l;a<0&&(a=0),t(this,_,"f").call(this,i,n,a,r,h)},a),"f")}),this.sleep=t=>new Promise(e=>setTimeout(e,t)),this.roxFormatThousandth=(t,e="万")=>t<1e4?t:(Math.floor(t/1e3)/10).toFixed(1)+e,this.chunk=(t,e,s=!1)=>{if(!Array.isArray(t)||e<=0)return[];const i=[];for(let l=0;l<t.length;l+=e){const n=t.slice(l,l+e);s?n.length===e&&i.push(n):i.push(n)}return i},this.debounce=(t,e=200,s=!1)=>{let i,l=null;return function(...n){const a=this,r=s&&!l;return l&&clearTimeout(l),l=setTimeout(()=>{l=null,s||(i=t.apply(a,n))},e),r&&(i=t.apply(a,n)),i}},this.flatten=(t,e=!1)=>{let s=[];return t.forEach(t=>{e&&Array.isArray(t)?s=s.concat(this.flatten(t,e)):s.push(t)}),s},this.safeRequest=(t,e)=>t&&t.then?t.catch?t.then(t=>[null,t]).catch(t=>(e&&Object.assign(t,e),[t,void 0])):t.then(t=>[null,t]):Promise.resolve([null,t])}before_lt_hour(e=Date.now(),s=1){return t(this,f,"f").call(this,{date:e,hour:s,type:"before_lt_hour"})}before_gt_hour(e=Date.now(),s=1){return t(this,f,"f").call(this,{date:e,hour:s,type:"before_gt_hour"})}after_lt_hour(e=Date.now(),s=1){return t(this,f,"f").call(this,{date:e,hour:s,type:"after_lt_hour"})}after_gt_hour(e=Date.now(),s=1){return t(this,f,"f").call(this,{date:e,hour:s,type:"after_gt_hour"})}is_current_year(e){const s=t(this,r,"f").call(this,e);return(new Date).getFullYear()===new Date(s).getFullYear()}get_time_obj(e){const s=t(this,r,"f").call(this,e),i=new Date(s),l=t(this,c,"f").call(this,i.getMonth()+1),n=t(this,c,"f").call(this,i.getDate()),a=t(this,c,"f").call(this,i.getHours()),h=t(this,c,"f").call(this,i.getMinutes()),o=t(this,c,"f").call(this,i.getSeconds());return{year:String(i.getFullYear()),month:l,day:n,hour:a,minute:h,seconds:o,day_of_week:String(i.getDay())}}format_count({num:t=0,decimal:e=1,divide:s=1e4,suffix:i="万",show_suffix_always:l=!1}){if(!t)return 0;if(s<=0||e<0)return l?`${t} ${i}`:t;const n=parseFloat(t);if(n<=0)return l?`${n} ${i}`:n;if(n>0&&n<s)return l?`${n} ${i}`:n;const[a,r]=(n/s).toFixed(e).split(".");return r&&0!==parseFloat(r)?`${a}.${r} ${i}`:`${a} ${i}`}format_num2date(e=Date.now()){const s=parseInt(e/1e3/60/60/24%24),i=parseInt(e/1e3/60/60%24),l=parseInt(e/1e3/60%60),n=parseInt(e/1e3%60);return{day:t(this,c,"f").call(this,s),hour:t(this,c,"f").call(this,i),minute:t(this,c,"f").call(this,l),seconds:t(this,c,"f").call(this,n)}}count_down_by_remain_seconds(t=d,e=60){let s;clearTimeout(s);let i=1e3*e,l=this.format_num2date(i),n={remain:i,obj:l};t(n);let a=this;return function t(e=0,r=d,h=1e3,o=0,u=Date.now()){if(e<=0)return clearTimeout(s),a=null,s=null,i=null,l=null,n=null,void r({remain:0,obj:{day:"00",hour:"00",minute:"00",seconds:"00"}});clearTimeout(s),s=setTimeout(()=>{o+=1,e-=1e3;let s=a.format_num2date(e);r({remain:e,obj:s});let i=1e3-(Date.now()-(u+1e3*o));i<0&&(i=0),t(e,r,i,o,u)},h)}(i,t,1e3),()=>{clearTimeout(s),a=null,s=null,i=null,l=null,n=null}}format_timestamp_to_day_hour_minute_second(e=Date.now()){const s=Math.floor(e/864e5),i=Math.floor(e%864e5/36e5),l=Math.floor(e%36e5/6e4),n=Math.floor(e%6e4/1e3);return{day:t(this,c,"f").call(this,s),hour:t(this,c,"f").call(this,i),minute:t(this,c,"f").call(this,l),seconds:t(this,c,"f").call(this,n)}}count_down(e=Date.now(),s=d){let i;clearTimeout(i);let l=this,n=t(this,r,"f").call(this,e),a=n-Date.now(),h=this.format_timestamp_to_day_hour_minute_second(a),o={remain:a,obj:h};return s(o),function t(e=0,s=d,r=1e3,u=0,c=Date.now()){if(e<=0)return clearTimeout(i),i=null,l=null,n=null,a=null,h=null,o=null,void s({remain:0,obj:{day:"00",hour:"00",minute:"00",seconds:"00"}});clearTimeout(i),i=setTimeout(()=>{u+=1,e-=1e3;let i=l.format_timestamp_to_day_hour_minute_second(e);s({remain:e,obj:i});let n=1e3-(Date.now()-(c+1e3*u));n<0&&(n=0),t(e,s,n,u,c)},r)}(a,s,1e3),()=>{clearTimeout(i),i=null,l=null,n=null,a=null,h=null,o=null}}add(e=1,s=Date.now()){return t(this,r,"f").call(this,s)+60*e*60*1e3}format_thousandth(t,e=2){try{const s=parseFloat(t),i=s.toString().split(".");let l=!1,n="";i[1]&&(n=i[1].replace(/0+$/,""),l=n.length>0);let a=0;l&&(a=void 0!==e?e:n.length);const r=s.toFixed(a).split("."),h=(r[0]||"").replace(/(\d)(?=(\d{3})+$)/g,"$1,");return r[1]?`${h}.${r[1]}`:h}catch(t){return 0}}format_thousandth_with_same_dotlen(t){var e;try{const s=(null===(e=t.toString().split(".")[1])||void 0===e?void 0:e.length)||0;let i=t.toString().replace(/\d+/,function(t){return t.replace(/(\d)(?=(\d{3})+$)/g,function(t){return t+","})});return s&&(i=i.replace(/\d+\.\d+/,function(t){return t.replace(/(\d)(?=(\d{3})+\.)/g,function(t){return t+","})})),i}catch(t){return 0}}is_empty(e){return null==e||("String"===t(this,a,"f").call(this,e)?!e.trim():"Array"===t(this,a,"f").call(this,e)?!e.length:"Object"===t(this,a,"f").call(this,e)&&!Object.keys(e).length)}poll(e,s=1){let i;if(!t(this,h,"f").call(this,e))return()=>{clearTimeout(i),i=void 0};const l=60*s*1e3,n=()=>{e(),i=setTimeout(n,l)};return n(),()=>{clearTimeout(i),i=void 0}}is_equal(e,s,i=!1){const l=t(this,o,"f").call(this,e)||t(this,u,"f").call(this,e),n=t(this,o,"f").call(this,s)||t(this,u,"f").call(this,s);if(!l||!n)return i?e===s:e==s;const a=Object.keys(e),r=Object.keys(s);return 0===a.length&&0===r.length||a.length===r.length&&a.every(l=>{const n=t(this,o,"f").call(this,e[l])||t(this,u,"f").call(this,e[l]),a=t(this,o,"f").call(this,s[l])||t(this,u,"f").call(this,s[l]);return n&&a?this.is_equal(e[l],s[l],i):i?e[l]===s[l]:e[l]==s[l]})}contains(e,s,i=!1){const l=t(this,o,"f").call(this,e)||t(this,u,"f").call(this,e),n=t(this,o,"f").call(this,s)||t(this,u,"f").call(this,s);if(!l||!n)return i?e===s:e==s;const a=Object.keys(e),r=Object.keys(s);return 0===r.length||!(0===a.length||a.length<r.length)&&r.every(l=>{if(a.indexOf(l)<0)return!1;const n=t(this,o,"f").call(this,e[l])||t(this,u,"f").call(this,e[l]),r=t(this,o,"f").call(this,s[l])||t(this,u,"f").call(this,s[l]);return n&&r?this.contains(e[l],s[l],i):i?e[l]===s[l]:e[l]==s[l]})}};export{p as default,p as helper};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fish-helper",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "a tool to process time",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/es/index.js",