@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 575 B
JavaScript
// 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-integer.js";import t from"./../assert/is-leap-year.js";var i=e,a=r.isPrimitive,s=t,o=365,l=366;function n(e){var r;if(arguments.length)if(i(e))r=e.getFullYear();else{if(!a(e))throw new TypeError("invalid argument. Must provide either an integer or a `Date` object. Value: `"+e+"`.");r=e}else r=(new Date).getFullYear();return s(r)?l:o}var f=n;export default f;
//# sourceMappingURL=days-in-year.js.map