Failsafe function that uses Object.prototype.hasOwnProperty() and return false in case if target is not a valid object.
Note: It uses arrow functions that may not be supported by some old environments.
You better use lodash/has.
/** | |
* Created by Oleg Galaburda on 26.09.15. | |
*/ | |
(function(){ | |
angular.module('timezone.gmt', []).factory('gmtFactory', function() { | |
function getTimezoneOffset(date){ | |
date = date || new Date(); | |
return date.getTimezoneOffset(); | |
} | |
function intToString(num, length) { |
.* | |
source.js |
((cache={}, list=[]) => { | |
const fieldsets = document.querySelectorAll('fieldset'); | |
document.body.innerHTML = fieldsets[fieldsets.length - 1].outerHTML; | |
document.querySelectorAll('table tr td:first-child') | |
.forEach(item => list.push(item)); | |
document.querySelector('table thead tr').prepend(document.createElement('th')); | |
list | |
.reverse() |
Failsafe function that uses Object.prototype.hasOwnProperty() and return false in case if target is not a valid object.
Note: It uses arrow functions that may not be supported by some old environments.
You better use lodash/has.
The isFunction()
is a simple wrapper over
typeof value === 'function'
Previously I was using instanceof but it seems using typeof should faster. And since I do not like putting string literal here and there, I've decided to wrap it into a function.
Simple function wrapper over Object.getPrototypeOf()
.
Additionally provides functions to getClassName()
and getParentClass()
.
Listens for jQuery events to re-dispatch them from DOM element as CustomEvent. To redispatch Bootstrap 4 modal events from modal DOM element
import translateJQueryEventsToDOM from '@actualwave/jquery-events-to-dom';
translateJQueryEventsToDOM()(
'show.bs.modal',
'shown.bs.modal',
Factory functions to create a value storage hidden in a closure