UNPKG

@stdlib/esm

Version:

ES module distribution for Stdlib, a standard library for JavaScript and Node.js.

3 lines 1.83 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import e from"./../assert/is-date-object.js";import r from"./../assert/is-string.js";import t from"./../assert/is-integer.js";import i from"./../string/lowercase.js";import a from"./../assert/is-leap-year.js";import n from"./../constants/time/minutes-in-day.js";var o=44640,s=44640,m=40320,u=40320,g=44640,l=44640,f=43200,p=43200,v=44640,h=43200,d=43200,j=44640,w=44640,b=44640,c=44640,y=43200,E=43200,F=44640,V=44640,D=43200,M=43200,T=44640,Y=44640,P={1:44640,2:40320,3:44640,4:43200,5:44640,6:43200,7:44640,8:44640,9:43200,10:44640,11:43200,12:44640,jan:o,january:s,feb:m,february:u,mar:g,march:l,apr:f,april:p,may:v,jun:h,june:d,jul:j,july:w,aug:b,august:c,sep:y,september:E,oct:F,october:V,nov:D,november:M,dec:T,december:Y},S=e,x=r.isPrimitive,z=t.isPrimitive,A=i,R=a,k=n,q=P;function B(e,r){var t,i,a,n;if(0===arguments.length)i=(n=new Date).getMonth()+1,a=n.getFullYear();else if(1===arguments.length)if(S(e))i=(n=e).getMonth()+1,a=n.getFullYear();else{if(!x(e)&&!z(e))throw new TypeError("invalid argument. First argument must be either a string, integer, or `Date` object. Value: `"+e+"`.");a=(new Date).getFullYear(),i=e}else{if(!x(e)&&!z(e))throw new TypeError("invalid argument. First argument must be either a string or integer. Value: `"+e+"`.");if(!z(r))throw new TypeError("invalid argument. Second argument must be an integer. Value: `"+r+"`.");i=e,a=r}if(z(i)&&(i<1||i>12))throw new RangeError("invalid argument. An integer month value must be on the interval `[1,12]`. Value: `"+i+"`.");if(i=A(i.toString()),void 0===(t=q[i]))throw new Error("invalid argument. Must provide a recognized month. Value: `"+i+"`.");return 40320===t&&R(a)&&(t+=k),t}var C=B;export default C; //# sourceMappingURL=minutes-in-month.js.map