swc/bundler/tests/.cache/deno/b786d34f39415771516f7cbe2d830da7239576d2.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

26 lines
772 B
TypeScript

// Loaded from https://deno.land/x/ramda@v0.27.2/source/internal/_toISOString.js
/**
* Polyfill from <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString>.
*/
var pad = function pad(n) { return (n < 10 ? '0' : '') + n; };
var _toISOString = typeof Date.prototype.toISOString === 'function' ?
function _toISOString(d) {
return d.toISOString();
} :
function _toISOString(d) {
return (
d.getUTCFullYear() + '-' +
pad(d.getUTCMonth() + 1) + '-' +
pad(d.getUTCDate()) + 'T' +
pad(d.getUTCHours()) + ':' +
pad(d.getUTCMinutes()) + ':' +
pad(d.getUTCSeconds()) + '.' +
(d.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) + 'Z'
);
};
export default _toISOString;