sass-site/source/assets/js/vendor/html5-boilerplate/plugins.ts
Jonny Gerig Meyer 2e97aaf8d8
lint
2023-03-08 16:14:25 -05:00

23 lines
685 B
TypeScript

// Avoid `console` errors in browsers that lack a console.
(function() {
let method;
const noop = function () {};
const methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
];
let length = methods.length;
const console = (window.console = window.console || {});
while (length--) {
method = methods[length];
// Only stub undefined methods.
if (!(console as any)[method]) {
(console as any)[method] = noop;
}
}
}());