From c20464df9012e2585bc95642df985c97b0182450 Mon Sep 17 00:00:00 2001
From: Anton Shchekota
${{user}}
`; - define: function define(intent, callback) { + define: (intent, callback) => { if (intent.indexOf('-') < 0) { if (!(intent in intents)) { length = keys.push(intent); } - intents[intent] = callback; } else { attributes[intent] = callback; } }, + // this method is used internally as last resort // to retrieve a value out of an object - invoke: function invoke(object, callback) { - for (var i = 0; i < length; i++) { - var key = keys[i]; - + invoke: (object, callback) => { + for (let i = 0; i < length; i++) { + let key = keys[i]; if (hasOwnProperty.call(object, key)) { return intents[key](object[key], callback); } @@ -743,142 +791,81 @@ var hyperHTML = (function (document) { } }; - var isArray = Array.isArray || - /* istanbul ignore next */ - function (toString) { - /* istanbul ignore next */ - var $ = toString.call([]); - /* istanbul ignore next */ - - return function isArray(object) { - return toString.call(object) === $; - }; - }({}.toString); - - /*! (c) Andrea Giammarchi - ISC */ - var createContent = function (document) { - - var FRAGMENT = 'fragment'; - var TEMPLATE = 'template'; - var HAS_CONTENT = ('content' in create(TEMPLATE)); - var createHTML = HAS_CONTENT ? function (html) { - var template = create(TEMPLATE); - template.innerHTML = html; - return template.content; - } : function (html) { - var content = create(FRAGMENT); - var template = create(TEMPLATE); - var childNodes = null; - - if (/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(html)) { - var selector = RegExp.$1; - template.innerHTML = '