├── AUTHORS ├── .travis.yml ├── .gitignore ├── tests ├── tests.js ├── test-fromHtml.js ├── tests.html ├── phantom.js ├── test-place.js ├── test-build.js ├── test-create.js └── test-hyperscript.js ├── .editorconfig ├── bower.json ├── fromHtml.js ├── dist ├── fromHtml.js ├── hyperscript.js ├── place.js ├── build.js └── create.js ├── package.json ├── hyperscript.js ├── place.js ├── README.md ├── create.js ├── LICENSE └── yarn.lock /AUTHORS: -------------------------------------------------------------------------------- 1 | Eugene Lazutkin (http://lazutkin.com/) 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: node_js 4 | 5 | node_js: 6 | - "9" 7 | 8 | script: npm test 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .idea 3 | *.sublime-* 4 | report/* 5 | coverage/* 6 | /bower_components/ 7 | /node_modules/ 8 | -------------------------------------------------------------------------------- /tests/tests.js: -------------------------------------------------------------------------------- 1 | define(['heya-unit', './test-create', './test-build', './test-hyperscript', './test-fromHtml', './test-place'], function (unit) { 2 | 'use strict'; 3 | 4 | unit.run(); 5 | 6 | return {}; 7 | }); 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | indent_style = tab 9 | indent_size = 4 10 | 11 | [*.{json,yml,md}] 12 | indent_style = space 13 | indent_size = 2 14 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "heya-dom", 3 | "description": "DOM utilities.", 4 | "authors": [ 5 | "Eugene Lazutkin (http://lazutkin.com/)" 6 | ], 7 | "license": "BSD-3-Clause", 8 | "keywords": [ 9 | "DOM", 10 | "CSS", 11 | "class", 12 | "style" 13 | ], 14 | "homepage": "https://github.com/heya/dom", 15 | "moduleType": [ 16 | "amd", 17 | "globals" 18 | ], 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "tests" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /fromHtml.js: -------------------------------------------------------------------------------- 1 | define([], function () { 2 | 'use strict'; 3 | 4 | function fromHtml (html, options) { 5 | var doc = options && options.document || document; 6 | 7 | if (typeof doc.createRange == 'function') { 8 | var range = doc.createRange(); 9 | if (typeof range.createContextualFragment == 'function') { 10 | range.selectNode(doc.body); 11 | return range.createContextualFragment(html); 12 | } 13 | } 14 | 15 | var container = doc.createElement('div'), frag = doc.createDocumentFragment(); 16 | container.innerHTML = html; 17 | 18 | while (container.firstChild) { 19 | frag.appendChild(container.firstChild); 20 | } 21 | 22 | return frag; 23 | } 24 | 25 | return fromHtml; 26 | }); 27 | -------------------------------------------------------------------------------- /dist/fromHtml.js: -------------------------------------------------------------------------------- 1 | (function(_,f,g){g=window;g=g.heya||(g.heya={});g=g.dom||(g.dom={});g.fromHtml=f();}) 2 | ([], function () { 3 | 'use strict'; 4 | 5 | function fromHtml (html, options) { 6 | var doc = options && options.document || document; 7 | 8 | if (typeof doc.createRange == 'function') { 9 | var range = doc.createRange(); 10 | if (typeof range.createContextualFragment == 'function') { 11 | range.selectNode(doc.body); 12 | return range.createContextualFragment(html); 13 | } 14 | } 15 | 16 | var container = doc.createElement('div'), frag = doc.createDocumentFragment(); 17 | container.innerHTML = html; 18 | 19 | while (container.firstChild) { 20 | frag.appendChild(container.firstChild); 21 | } 22 | 23 | return frag; 24 | } 25 | 26 | return fromHtml; 27 | }); 28 | -------------------------------------------------------------------------------- /tests/test-fromHtml.js: -------------------------------------------------------------------------------- 1 | define(["module", "heya-unit", "../fromHtml"], function (module, unit, fromHtml) { 2 | "use strict"; 3 | 4 | unit.add(module, [ 5 | function test_text (t) { 6 | var node = fromHtml('Hello!'); 7 | eval(t.TEST('node.nodeName == "#document-fragment"')); 8 | eval(t.TEST('node.childNodes.length == 1')); 9 | var div = document.createElement('div'); 10 | div.appendChild(node); 11 | eval(t.TEST('div.innerHTML === "Hello!"')); 12 | }, 13 | function test_mixed_text (t) { 14 | var node = fromHtml('Hello, world!'); 15 | eval(t.TEST('node.nodeName == "#document-fragment"')); 16 | eval(t.TEST('node.childNodes.length == 3')); 17 | var div = document.createElement('div'); 18 | div.appendChild(node); 19 | eval(t.TEST('div.innerHTML === "Hello, world!"')); 20 | } 21 | ]); 22 | 23 | return {}; 24 | }); 25 | -------------------------------------------------------------------------------- /tests/tests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | heya-dom test runner 5 | 6 | 7 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "heya-dom", 3 | "version": "1.0.3", 4 | "description": "DOM utilities.", 5 | "directories": { 6 | "test": "tests" 7 | }, 8 | "scripts": { 9 | "test": "node_modules/.bin/phantomjs tests/phantom.js", 10 | "dist": "node node_modules/heya-globalize/index.js" 11 | }, 12 | "devDependencies": { 13 | "heya-globalize": "^1.2.1", 14 | "heya-unit": "^0.3.0", 15 | "phantomjs-prebuilt": "^2.1.16" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/heya/dom.git" 20 | }, 21 | "keywords": [ 22 | "DOM", 23 | "CSS class", 24 | "style" 25 | ], 26 | "author": "Eugene Lazutkin (http://lazutkin.com/)", 27 | "license": "BSD-3-Clause", 28 | "bugs": { 29 | "url": "https://github.com/heya/dom/issues" 30 | }, 31 | "homepage": "https://github.com/heya/dom#readme", 32 | "browserGlobals": { 33 | "!root": "heya.dom" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /hyperscript.js: -------------------------------------------------------------------------------- 1 | define(['./create'], function (create) { 2 | 'use strict'; 3 | 4 | var textTypes = {string: 1, number: 1, boolean: 1}; 5 | 6 | // implementing hyperscript (see https://github.com/dominictarr/hyperscript) 7 | function hyperscript (tag, attributes, children) { 8 | var node = create(tag), rest = new Array(arguments.length - 1), i; 9 | for (i = 1; i < arguments.length; ++i) { 10 | rest[i - 1] = arguments[i]; 11 | } 12 | return addToNode(node, rest); 13 | } 14 | 15 | function addToNode (node, children) { 16 | for (var i = 0; i < children.length; ++i) { 17 | var child = children[i]; 18 | if (textTypes[typeof child] || child instanceof Date || child instanceof RegExp) { 19 | node.appendChild(node.ownerDocument.createTextNode(child.toString())); 20 | } else if (!child) { 21 | // skip 22 | } else if (child instanceof Array) { 23 | addToNode(node, child); 24 | } else if (typeof child.appendChild == 'function') { 25 | node.appendChild(child); 26 | } else { 27 | create.setProps(node, child); 28 | } 29 | } 30 | return node; 31 | } 32 | 33 | return hyperscript; 34 | }); 35 | -------------------------------------------------------------------------------- /dist/hyperscript.js: -------------------------------------------------------------------------------- 1 | (function(_,f){window.heya.dom.hyperscript=f(window.heya.dom.create);}) 2 | (['./create'], function (create) { 3 | 'use strict'; 4 | 5 | var textTypes = {string: 1, number: 1, boolean: 1}; 6 | 7 | // implementing hyperscript (see https://github.com/dominictarr/hyperscript) 8 | function hyperscript (tag, attributes, children) { 9 | var node = create(tag), rest = new Array(arguments.length - 1), i; 10 | for (i = 1; i < arguments.length; ++i) { 11 | rest[i - 1] = arguments[i]; 12 | } 13 | return addToNode(node, rest); 14 | } 15 | 16 | function addToNode (node, children) { 17 | for (var i = 0; i < children.length; ++i) { 18 | var child = children[i]; 19 | if (textTypes[typeof child] || child instanceof Date || child instanceof RegExp) { 20 | node.appendChild(node.ownerDocument.createTextNode(child.toString())); 21 | } else if (!child) { 22 | // skip 23 | } else if (child instanceof Array) { 24 | addToNode(node, child); 25 | } else if (typeof child.appendChild == 'function') { 26 | node.appendChild(child); 27 | } else { 28 | create.setProps(node, child); 29 | } 30 | } 31 | return node; 32 | } 33 | 34 | return hyperscript; 35 | }); 36 | -------------------------------------------------------------------------------- /tests/phantom.js: -------------------------------------------------------------------------------- 1 | phantom.onError = function(msg, trace){ 2 | var msgStack = ["PHANTOM ERROR: " + msg]; 3 | if(trace){ 4 | msgStack.push("TRACE:"); 5 | trace.forEach(function(t){ 6 | msgStack.push(" -> " + (t.file || t.sourceURL) + ": " + t.line + 7 | (t.function ? " (in function " + t.function + ")" : "")); 8 | }); 9 | } 10 | console.error(msgStack.join('\n')); 11 | phantom.exit(1); 12 | }; 13 | 14 | var page = require("webpage").create(); 15 | 16 | page.onError = function(msg){ 17 | console.error("ERROR: " + msg); 18 | phantom.exit(1); 19 | }; 20 | 21 | page.onAlert = function(msg){ 22 | console.log("ALERT: " + msg); 23 | }; 24 | page.onConsoleMessage = function(msg){ 25 | console.log(msg); 26 | }; 27 | page.onCallback = function(msg){ 28 | switch(msg){ 29 | case "success": 30 | phantom.exit(0); 31 | break; 32 | case "failure": 33 | phantom.exit(1); 34 | break; 35 | } 36 | } 37 | 38 | var scriptPath = require("system").args[0], 39 | path = require("fs").absolute( 40 | (scriptPath.length && scriptPath.charAt(0) == "/" ? "" : "./") + scriptPath).split("/"); 41 | 42 | path.pop(); 43 | path.push("tests.html"); 44 | 45 | page.open(path.join("/"), function(status){ 46 | if(status !== "success"){ 47 | console.error("ERROR: Can't load a web page."); 48 | phantom.exit(1); 49 | } 50 | }); 51 | -------------------------------------------------------------------------------- /place.js: -------------------------------------------------------------------------------- 1 | define([], function () { 2 | 'use strict'; 3 | 4 | function place (/*DOMNode*/ node, /*DOMNode*/ refNode, /*String|Number?*/ position) { 5 | // summary: 6 | // Attempt to insert node into the DOM, choosing from various positioning options. 7 | // Returns the first argument resolved to a DOM node. 8 | // node: DOMNode 9 | // node to place 10 | // refNode: DOMNode 11 | // node to use as basis for placement 12 | // position: String|Number? 13 | // string noting the position of node relative to refNode or a 14 | // number indicating the location in the childNodes collection of refNode. 15 | // Accepted string values are: 16 | // 17 | // - before 18 | // - after 19 | // - replace 20 | // - only 21 | // - first 22 | // - last 23 | // 24 | // "first" and "last" indicate positions as children of refNode, "replace" replaces refNode, 25 | // "only" replaces all children. position defaults to "last" if not specified 26 | // returns: DOMNode 27 | // Returned the first argument. 28 | 29 | if (typeof position == 'number') { // inline'd type check 30 | var children = refNode.childNodes; 31 | if (!children.length || children.length <= position) { 32 | refNode.appendChild(node); 33 | } else { 34 | refNode.insertBefore(node, children[position < 0 ? 0 : position]); 35 | } 36 | return node; 37 | } 38 | 39 | var parent = refNode.parentNode; 40 | switch (position) { 41 | case 'before': 42 | if (parent) { 43 | parent.insertBefore(node, refNode); 44 | } 45 | break; 46 | case 'after': 47 | if (parent) { 48 | parent.insertBefore(node, refNode.nextSibling); 49 | } 50 | break; 51 | case 'replace': 52 | if (parent) { 53 | parent.replaceChild(node, refNode); 54 | } 55 | break; 56 | case "only": 57 | refNode.innerHTML = ''; 58 | refNode.appendChild(node); 59 | break; 60 | case "first": 61 | refNode.insertBefore(node, refNode.firstChild); 62 | break; 63 | default: // aka: last 64 | refNode.appendChild(node); 65 | } 66 | return node; // DomNode 67 | } 68 | 69 | return place; 70 | }); 71 | -------------------------------------------------------------------------------- /dist/place.js: -------------------------------------------------------------------------------- 1 | (function(_,f,g){g=window;g=g.heya||(g.heya={});g=g.dom||(g.dom={});g.place=f();}) 2 | ([], function () { 3 | 'use strict'; 4 | 5 | function place (/*DOMNode*/ node, /*DOMNode*/ refNode, /*String|Number?*/ position) { 6 | // summary: 7 | // Attempt to insert node into the DOM, choosing from various positioning options. 8 | // Returns the first argument resolved to a DOM node. 9 | // node: DOMNode 10 | // node to place 11 | // refNode: DOMNode 12 | // node to use as basis for placement 13 | // position: String|Number? 14 | // string noting the position of node relative to refNode or a 15 | // number indicating the location in the childNodes collection of refNode. 16 | // Accepted string values are: 17 | // 18 | // - before 19 | // - after 20 | // - replace 21 | // - only 22 | // - first 23 | // - last 24 | // 25 | // "first" and "last" indicate positions as children of refNode, "replace" replaces refNode, 26 | // "only" replaces all children. position defaults to "last" if not specified 27 | // returns: DOMNode 28 | // Returned the first argument. 29 | 30 | if (typeof position == 'number') { // inline'd type check 31 | var children = refNode.childNodes; 32 | if (!children.length || children.length <= position) { 33 | refNode.appendChild(node); 34 | } else { 35 | refNode.insertBefore(node, children[position < 0 ? 0 : position]); 36 | } 37 | return node; 38 | } 39 | 40 | var parent = refNode.parentNode; 41 | switch (position) { 42 | case 'before': 43 | if (parent) { 44 | parent.insertBefore(node, refNode); 45 | } 46 | break; 47 | case 'after': 48 | if (parent) { 49 | parent.insertBefore(node, refNode.nextSibling); 50 | } 51 | break; 52 | case 'replace': 53 | if (parent) { 54 | parent.replaceChild(node, refNode); 55 | } 56 | break; 57 | case "only": 58 | refNode.innerHTML = ''; 59 | refNode.appendChild(node); 60 | break; 61 | case "first": 62 | refNode.insertBefore(node, refNode.firstChild); 63 | break; 64 | default: // aka: last 65 | refNode.appendChild(node); 66 | } 67 | return node; // DomNode 68 | } 69 | 70 | return place; 71 | }); 72 | -------------------------------------------------------------------------------- /dist/build.js: -------------------------------------------------------------------------------- 1 | (function(_,f){window.heya.dom.build=f(window.heya.dom.create);}) 2 | (['./create'], function (create) { 3 | 'use strict'; 4 | 5 | var textTypes = {string: 1, number: 1, boolean: 1}; 6 | 7 | function build (vdom, parent, options) { 8 | var doc = options && options.document || document, 9 | stack = [parent, vdom, null], node; 10 | 11 | if (parent) { 12 | if (parent.nodeType === 9) { 13 | doc = parent; 14 | parent = null; 15 | } else { 16 | doc = parent.ownerDocument || doc; 17 | } 18 | } 19 | 20 | while (stack.length) { 21 | var ns = stack.pop(), element = stack.pop(); 22 | parent = stack.pop(); 23 | node = null; 24 | 25 | // deref element 26 | while (typeof element == 'function') { 27 | element = element(options); 28 | } 29 | 30 | if (!(element instanceof Array)) { 31 | // make a specialty node 32 | if (textTypes[typeof element] || element instanceof Date || element instanceof RegExp) { 33 | // text 34 | node = doc.createTextNode(element.toString()); 35 | } else if (!element) { 36 | // skip 37 | } else if (typeof element.appendChild == 'function') { 38 | // node 39 | node = element; 40 | } else if (parent && typeof element == 'object') { 41 | // attributes 42 | create.setAttrs(parent, element, options); 43 | } 44 | // add it to a parent 45 | if (node && parent) { 46 | parent.appendChild(node); 47 | } 48 | continue; 49 | } 50 | 51 | // array: element or children 52 | var tag = element[0]; 53 | // deref tag 54 | while (typeof tag == 'function') { 55 | tag = tag(options); 56 | } 57 | // make a node 58 | if (typeof tag == 'string') { 59 | // tag 60 | node = create(tag, null, doc, ns, options); 61 | } else if (tag && typeof tag.appendChild == 'function') { 62 | // node 63 | node = tag; 64 | tag = node.tagName; 65 | } else if (tag instanceof Array) { 66 | // children 67 | if (element.length > 1 && !parent) { 68 | parent = doc.createDocumentFragment(); 69 | } 70 | node = parent; 71 | } 72 | var from = 0, i; 73 | if (node && node !== parent) { 74 | // redefine a default namespace for children 75 | switch (tag.toLowerCase()) { 76 | case 'svg': 77 | ns = 'svg'; 78 | break; 79 | case 'foreignobject': 80 | ns = null; 81 | break; 82 | } 83 | // add children 84 | stack.push(parent, node, ns); 85 | from = 1; 86 | } 87 | // add children to the stack in the reverse order 88 | for(i = element.length; i > from;) { 89 | stack.push(node, element[--i], ns); 90 | } 91 | } 92 | 93 | return parent || node; 94 | } 95 | 96 | return build; 97 | }); 98 | -------------------------------------------------------------------------------- /tests/test-place.js: -------------------------------------------------------------------------------- 1 | define(['module', 'heya-unit', '../build', '../fromHtml', '../place'], function (module, unit, build, fromHtml, place) { 2 | 'use strict'; 3 | 4 | unit.add(module, [ 5 | function test_number (t) { 6 | var tree = build(['ul', ['li', 'one'], ['li.x', 'two'], ['li', 'three']]); 7 | place(fromHtml('
  • A
  • B
  • '), tree, 1); 8 | 9 | var li = tree.querySelectorAll('li'); 10 | eval(t.ASSERT('li.length === 5')); 11 | eval(t.TEST('li[0].innerHTML === "one"')); 12 | eval(t.TEST('li[1].innerHTML === "A"')); 13 | eval(t.TEST('li[2].innerHTML === "B"')); 14 | eval(t.TEST('li[3].innerHTML === "two"')); 15 | eval(t.TEST('li[4].innerHTML === "three"')); 16 | }, 17 | function test_before (t) { 18 | var tree = build(['ul', ['li', 'one'], ['li.x', 'two'], ['li', 'three']]); 19 | place(fromHtml('
  • A
  • B
  • '), tree.querySelector('.x'), 'before'); 20 | 21 | var li = tree.querySelectorAll('li'); 22 | eval(t.ASSERT('li.length === 5')); 23 | eval(t.TEST('li[0].innerHTML === "one"')); 24 | eval(t.TEST('li[1].innerHTML === "A"')); 25 | eval(t.TEST('li[2].innerHTML === "B"')); 26 | eval(t.TEST('li[3].innerHTML === "two"')); 27 | eval(t.TEST('li[4].innerHTML === "three"')); 28 | }, 29 | function test_after (t) { 30 | var tree = build(['ul', ['li', 'one'], ['li.x', 'two'], ['li', 'three']]); 31 | place(fromHtml('
  • A
  • B
  • '), tree.querySelector('.x'), 'after'); 32 | 33 | var li = tree.querySelectorAll('li'); 34 | eval(t.ASSERT('li.length === 5')); 35 | eval(t.TEST('li[0].innerHTML === "one"')); 36 | eval(t.TEST('li[1].innerHTML === "two"')); 37 | eval(t.TEST('li[2].innerHTML === "A"')); 38 | eval(t.TEST('li[3].innerHTML === "B"')); 39 | eval(t.TEST('li[4].innerHTML === "three"')); 40 | }, 41 | function test_replace (t) { 42 | var tree = build(['ul', ['li', 'one'], ['li.x', 'two'], ['li', 'three']]); 43 | place(fromHtml('
  • A
  • B
  • '), tree.querySelector('.x'), 'replace'); 44 | 45 | var li = tree.querySelectorAll('li'); 46 | eval(t.ASSERT('li.length === 4')); 47 | eval(t.TEST('li[0].innerHTML === "one"')); 48 | eval(t.TEST('li[1].innerHTML === "A"')); 49 | eval(t.TEST('li[2].innerHTML === "B"')); 50 | eval(t.TEST('li[3].innerHTML === "three"')); 51 | }, 52 | function test_first (t) { 53 | var tree = build(['ul', ['li', 'one'], ['li.x', 'two'], ['li', 'three']]); 54 | place(fromHtml('
  • A
  • B
  • '), tree, 'first'); 55 | 56 | var li = tree.querySelectorAll('li'); 57 | eval(t.ASSERT('li.length === 5')); 58 | eval(t.TEST('li[0].innerHTML === "A"')); 59 | eval(t.TEST('li[1].innerHTML === "B"')); 60 | eval(t.TEST('li[2].innerHTML === "one"')); 61 | eval(t.TEST('li[3].innerHTML === "two"')); 62 | eval(t.TEST('li[4].innerHTML === "three"')); 63 | }, 64 | function test_last (t) { 65 | var tree = build(['ul', ['li', 'one'], ['li.x', 'two'], ['li', 'three']]); 66 | place(fromHtml('
  • A
  • B
  • '), tree, 'last'); 67 | 68 | var li = tree.querySelectorAll('li'); 69 | eval(t.ASSERT('li.length === 5')); 70 | eval(t.TEST('li[0].innerHTML === "one"')); 71 | eval(t.TEST('li[1].innerHTML === "two"')); 72 | eval(t.TEST('li[2].innerHTML === "three"')); 73 | eval(t.TEST('li[3].innerHTML === "A"')); 74 | eval(t.TEST('li[4].innerHTML === "B"')); 75 | }, 76 | function test_only (t) { 77 | var tree = build(['ul', ['li', 'one'], ['li.x', 'two'], ['li', 'three']]); 78 | place(fromHtml('
  • A
  • B
  • '), tree, 'only'); 79 | 80 | var li = tree.querySelectorAll('li'); 81 | eval(t.ASSERT('li.length === 2')); 82 | eval(t.TEST('li[0].innerHTML === "A"')); 83 | eval(t.TEST('li[1].innerHTML === "B"')); 84 | } 85 | ]); 86 | 87 | return {}; 88 | }); 89 | -------------------------------------------------------------------------------- /tests/test-build.js: -------------------------------------------------------------------------------- 1 | define(['module', 'heya-unit', '../build'], function (module, unit, build) { 2 | 'use strict'; 3 | 4 | unit.add(module, [ 5 | function test_div (t) { 6 | var node = build(['div']); 7 | eval(t.TEST('node.tagName === "DIV"')); 8 | eval(t.TEST('node.attributes.length === 0')); 9 | eval(t.TEST('node.classList.length == 0')); 10 | eval(t.TEST('node.innerHTML === ""')); 11 | }, 12 | function test_div_attr (t) { 13 | var node = build(['div', {'data-abc': 12}]); 14 | eval(t.TEST('node.tagName === "DIV"')); 15 | eval(t.TEST('node.attributes.length === 1')); 16 | eval(t.TEST('node.getAttribute("data-abc") === "12"')); 17 | eval(t.TEST('node.innerHTML === ""')); 18 | }, 19 | function test_div_attr_text (t) { 20 | var node = build(['div', {'data-abc': 12}, 'Hello!']); 21 | eval(t.TEST('node.tagName === "DIV"')); 22 | eval(t.TEST('node.attributes.length === 1')); 23 | eval(t.TEST('node.getAttribute("data-abc") === "12"')); 24 | eval(t.TEST('node.innerHTML === "Hello!"')); 25 | }, 26 | function test_div_text_attr (t) { 27 | var node = build(['div', 'Hello!', {'data-abc': 12}]); 28 | eval(t.TEST('node.tagName === "DIV"')); 29 | eval(t.TEST('node.attributes.length === 1')); 30 | eval(t.TEST('node.getAttribute("data-abc") === "12"')); 31 | eval(t.TEST('node.innerHTML === "Hello!"')); 32 | }, 33 | function test_div_attr_text_manual (t) { 34 | var node = build(['div', {'data-abc': 12}, document.createTextNode('Hello!')]); 35 | eval(t.TEST('node.tagName === "DIV"')); 36 | eval(t.TEST('node.attributes.length === 1')); 37 | eval(t.TEST('node.getAttribute("data-abc") === "12"')); 38 | eval(t.TEST('node.innerHTML === "Hello!"')); 39 | }, 40 | function test_div_text (t) { 41 | var node = build(['div', 'Hello!']); 42 | eval(t.TEST('node.tagName === "DIV"')); 43 | eval(t.TEST('node.attributes.length === 0')); 44 | eval(t.TEST('node.innerHTML === "Hello!"')); 45 | }, 46 | function test_div_divdiv (t) { 47 | var node = build(['div', ['div'], ['div']]); 48 | eval(t.TEST('node.tagName === "DIV"')); 49 | eval(t.TEST('node.attributes.length === 0')); 50 | eval(t.TEST('node.innerHTML === "
    "')); 51 | }, 52 | function test_div_divdiv_class (t) { 53 | var node = build(['div', ['.a'], ['.b']]); 54 | eval(t.TEST('node.tagName === "DIV"')); 55 | eval(t.TEST('node.attributes.length === 0')); 56 | eval(t.TEST("node.innerHTML === '
    '")); 57 | }, 58 | function test_svg (t) { 59 | var node = build(['svg', ['path']]); 60 | eval(t.TEST('node.tagName === "SVG"')); 61 | eval(t.TEST('node.firstChild.tagName === "path"')); 62 | eval(t.TEST('node.firstChild.namespaceURI === "http://www.w3.org/2000/svg"')); 63 | }, 64 | function test_frag (t) { 65 | var node = build([['.a'], ['.b']]); 66 | eval(t.TEST('node.nodeName === "#document-fragment"')); 67 | eval(t.TEST('node.childNodes.length === 2')); 68 | eval(t.TEST('node.firstChild.tagName === "DIV"')); 69 | eval(t.TEST('node.firstChild.classList.contains("a")')); 70 | eval(t.TEST('node.lastChild.tagName === "DIV"')); 71 | eval(t.TEST('node.lastChild.classList.contains("b")')); 72 | }, 73 | function test_fun (t) { 74 | function generate (options) { 75 | return ['div', 'Hello, ' + options.name + '!']; 76 | } 77 | 78 | var node = build(generate, null, {name: 'world'}); 79 | eval(t.TEST('node.tagName === "DIV"')); 80 | eval(t.TEST('node.attributes.length === 0')); 81 | eval(t.TEST('node.innerHTML === "Hello, world!"')); 82 | }, 83 | function test_parent (t) { 84 | var div = document.createElement('div'), 85 | node = build([['.a'], ['.b']], div); 86 | eval(t.TEST('div === node')); 87 | eval(t.TEST("div.innerHTML === '
    '")); 88 | } 89 | ]); 90 | 91 | return {}; 92 | }); 93 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `dom` 2 | 3 | [![Build status][travis-image]][travis-url] 4 | [![Dependencies][deps-image]][deps-url] 5 | [![devDependencies][dev-deps-image]][dev-deps-url] 6 | [![NPM version][npm-image]][npm-url] 7 | 8 | `heya-dom` is used on browser to simplify DOM-related tasks, especially construction, and modification of DOM. 9 | 10 | Following modules are provided: 11 | 12 | * [create](https://github.com/heya/dom/wiki/create) — largely based on venerable [Dojo](http://dojotoolkit.org). Includes creating DOM nodes with optional namespaces, setting attributes, properties, styles, and similar helpers. 13 | * [build](https://github.com/heya/dom/wiki/build) — a Virtual DOM-inspired utility to create DOM fragments in one go using a simple array-based structure. 14 | * [hyperscript](https://github.com/heya/dom/wiki/hyperscript) — an alternative for `build`, a minimalistic implementation of [Dominic Tarr](https://github.com/dominictarr)'s [hyperscript](https://github.com/dominictarr/hyperscript). It is there mostly to reuse existing tooling, and existing code created for other implementations. 15 | * [fromHtml](https://github.com/heya/dom/wiki/fromHtml) — a helper to instantiate HTML snippets as `DocumentFragment`. 16 | 17 | # Examples 18 | 19 | We want to create the following simple list: 20 | 21 | ```html 22 |
      23 |
    • one
    • 24 |
    • two
    • 25 |
    • three
    • 26 |
    27 | ``` 28 | 29 | Let's do it with `create()` (low-level): 30 | 31 | ```js 32 | var root = create('ul', {'data-sort': 'asc'}); 33 | create('li', {$: {innerHTML: 'one'}}, root); 34 | create('li.x', {$: {innerHTML: 'two'}}, root); 35 | create('li', {$: {innerHTML: 'three'}}, root); 36 | ``` 37 | 38 | Let's do it with `build()`: 39 | 40 | ```js 41 | var root = build(['ul', {'data-sort': 'asc'}, 42 | ['li', 'one'], ['li.x', 'two'], ['li', 'three']]); 43 | ``` 44 | 45 | Let's do it with `hyperscript()`: 46 | 47 | ```js 48 | var h = hyperscript; 49 | 50 | var root = h('ul', {dataset: {sort: 'asc'}}, 51 | h('li', 'one'), h('li.x', 'two'), h('li', 'three')); 52 | ``` 53 | 54 | Let's do it with `fromHtml()`: 55 | 56 | ```js 57 | var root = fromHtml( 58 | '
      ' + 59 | '
    • one
    • ' + 60 | '
    • two
    • ' + 61 | '
    • three
    • ' + 62 | '
    ' 63 | ); 64 | ``` 65 | 66 | # How to install 67 | 68 | With npm: 69 | 70 | ```txt 71 | npm install --save heya-dom 72 | ``` 73 | 74 | With bower: 75 | 76 | ```txt 77 | bower install --save heya-dom 78 | ``` 79 | 80 | # How to use 81 | 82 | `heya-dom` can be installed with `npm` or `bower` with files available from `node_modules/` or `bower_components/`. By default, it uses AMD: 83 | 84 | ```js 85 | define(['heya-dom/build'], function (build) { 86 | document.body.appendChild(build([ 87 | 'p', 'Hello, world!' 88 | ])); 89 | }); 90 | ``` 91 | 92 | But it can be loaded with ` 96 | ``` 97 | 98 | And used with globals like in examples above: 99 | 100 | ```js 101 | document.body.appendChild(heya.dom.build([ 102 | 'p', 'Hello, world!' 103 | ])); 104 | ``` 105 | 106 | See [How to include](https://github.com/heya/dom/wiki/How-to-include) for more details. 107 | 108 | # Documentation 109 | 110 | All documentation can be found in [project's wiki](https://github.com/heya/dom/wiki). 111 | 112 | # Versions 113 | 114 | - 1.0.3 — *Refreshed dependencies.* 115 | - 1.0.2 — *Consistently added options and dollar escapes.* 116 | - 1.0.1 — *Cosmetic change: removed the missing main module.* 117 | - 1.0.0 — *The initial public release as heya-dom.* 118 | 119 | # License 120 | 121 | BSD or AFL — your choice. 122 | 123 | 124 | [npm-image]: https://img.shields.io/npm/v/heya-dom.svg 125 | [npm-url]: https://npmjs.org/package/heya-dom 126 | [deps-image]: https://img.shields.io/david/heya/dom.svg 127 | [deps-url]: https://david-dm.org/heya/dom 128 | [dev-deps-image]: https://img.shields.io/david/dev/heya/dom.svg 129 | [dev-deps-url]: https://david-dm.org/heya/dom?type=dev 130 | [travis-image]: https://img.shields.io/travis/heya/dom.svg 131 | [travis-url]: https://travis-ci.org/heya/dom 132 | -------------------------------------------------------------------------------- /dist/create.js: -------------------------------------------------------------------------------- 1 | (function(_,f,g){g=window;g=g.heya||(g.heya={});g=g.dom||(g.dom={});g.create=f();}) 2 | ([], function () { 3 | 'use strict'; 4 | 5 | var namespaces = { 6 | svg: 'http://www.w3.org/2000/svg', 7 | xlink: 'http://www.w3.org/1999/xlink', 8 | ev: 'http://www.w3.org/2001/xml-events', 9 | xml: 'http://www.w3.org/XML/1998/namespace' 10 | }, 11 | parseName = /^(?:(\w+)\:)?([^\s\.#]*)/, 12 | parseSelector = /[\.#][^\s\.#]+/g; 13 | 14 | function allKeys (object) { 15 | var keys = []; 16 | for (var key in object) { keys.push(key); } 17 | return keys; 18 | } 19 | 20 | function assignStyle (node, styles) { 21 | var keys = allKeys(styles); 22 | for (var i = 0; i < keys.length; ++i) { 23 | var key = keys[i]; 24 | node.style[key] = styles[key]; 25 | } 26 | return node; 27 | } 28 | 29 | function setStyle (node, styles) { 30 | var keys = allKeys(styles); 31 | for (var i = 0; i < keys.length; ++i) { 32 | var key = keys[i]; 33 | if (key === '$') { 34 | create.assignStyle(node, styles.$); 35 | } else { 36 | node.style.setProperty(key, styles[key]); 37 | } 38 | } 39 | return node; 40 | } 41 | 42 | function setData (node, dataset) { 43 | var keys = allKeys(dataset); 44 | for (var i = 0; i < keys.length; ++i) { 45 | var key = keys[i]; 46 | node.dataset[key] = dataset[key]; 47 | } 48 | return node; 49 | } 50 | 51 | function addListener (node, name, value) { 52 | var type = name; 53 | if (type.substring(0, 2) == 'on') { 54 | type = type.substring(2); 55 | } 56 | node.addEventListener(type, value, false); 57 | } 58 | 59 | function setProperties (node, props) { 60 | var keys = allKeys(props); 61 | for (var i = 0; i < keys.length; ++i) { 62 | var key = keys[i]; 63 | switch (key) { 64 | case 'style': 65 | if (typeof props.style == 'string') { 66 | node.style.cssText = props.style; 67 | } else { 68 | create.setStyle(node, props.style); 69 | } 70 | break; 71 | case 'dataset': 72 | create.setData(node, props.dataset); 73 | break; 74 | default: 75 | if (typeof props[key] == 'function') { 76 | addListener(node, key, props[key]); 77 | } else { 78 | node[key] = props[key]; 79 | } 80 | break; 81 | } 82 | } 83 | return node; 84 | } 85 | 86 | function setAttributes (node, attributes, options) { 87 | var keys = allKeys(attributes); 88 | for (var i = 0; i < keys.length; ++i) { 89 | var key = keys[i]; 90 | switch (key) { 91 | case '$': 92 | if (options && typeof options.setComponentProperties == 'function' && node.tagName.indexOf('-') > 0) { 93 | options.setComponentProperties(node, attributes.$); 94 | } else { 95 | create.setProps(node, attributes.$); 96 | } 97 | break; 98 | case 'style': 99 | if (typeof attributes.style == 'string') { 100 | node.style.cssText = attributes.style; 101 | } else { 102 | create.setStyle(node, attributes.style); 103 | } 104 | break; 105 | case 'class': 106 | case 'className': 107 | node.className = attributes[key]; 108 | break; 109 | default: 110 | var name = parseName.exec(key); 111 | if (name && name[1]) { 112 | node.setAttributeNS(create.namespaces[name[1]], name[2], attributes[key]); 113 | } else { 114 | if (typeof attributes[key] == 'function') { 115 | addListener(node, key, attributes[key]); 116 | } else { 117 | node.setAttribute(key, attributes[key]); 118 | } 119 | } 120 | break; 121 | } 122 | } 123 | return node; 124 | } 125 | 126 | function createText (text, parent) { 127 | var doc = document; 128 | if (parent) { 129 | if (parent.nodeType === 9) { 130 | doc = parent; 131 | parent = null; 132 | } else { 133 | doc = parent.ownerDocument || doc; 134 | } 135 | } 136 | var node = doc.createTextNode(text); 137 | if (parent && parent.nodeType === 1) { 138 | parent.appendChild(node); 139 | } 140 | return node; 141 | } 142 | 143 | function create (tag, attributes, parent, ns, options) { 144 | var doc = options && options.document || document; 145 | if (parent) { 146 | if (parent.nodeType === 9) { 147 | doc = parent; 148 | parent = null; 149 | } else { 150 | doc = parent.ownerDocument || doc; 151 | } 152 | } 153 | 154 | // create an element 155 | var name = parseName.exec(tag), node; 156 | 157 | ns = name[1] || ns; 158 | if (ns) { 159 | node = doc.createElementNS(create.namespaces[ns], name[2] || 'div'); 160 | } else { 161 | node = doc.createElement(name[2] || 'div'); 162 | } 163 | if (name[0].length < tag.length) { 164 | // add selector's classes and ids 165 | tag.substring(name[0].length).replace(parseSelector, function (match) { 166 | switch (match.charAt(0)) { 167 | case '.': 168 | node.classList.add(match.substring(1)); 169 | break; 170 | case '#': 171 | node.id = match.substring(1); 172 | break; 173 | } 174 | return ''; 175 | }); 176 | } 177 | 178 | if (attributes) { 179 | create.setAttrs(node, attributes, options); 180 | } 181 | 182 | if (parent && parent.nodeType === 1) { 183 | parent.appendChild(node); 184 | } 185 | return node; 186 | } 187 | 188 | create.text = createText; 189 | create.allKeys = allKeys; 190 | create.setAttrs = setAttributes; 191 | create.setProps = setProperties; 192 | create.setData = setData; 193 | create.setStyle = setStyle; 194 | create.assignStyle = assignStyle; 195 | create.namespaces = namespaces; 196 | 197 | return create; 198 | }); 199 | -------------------------------------------------------------------------------- /create.js: -------------------------------------------------------------------------------- 1 | define([], function () { 2 | 'use strict'; 3 | 4 | var namespaces = { 5 | svg: 'http://www.w3.org/2000/svg', 6 | xlink: 'http://www.w3.org/1999/xlink', 7 | ev: 'http://www.w3.org/2001/xml-events', 8 | xml: 'http://www.w3.org/XML/1998/namespace' 9 | }, 10 | parseName = /^(?:(\w+)\:)?([^\s\.#]*)/, 11 | parseSelector = /[\.#][^\s\.#]+/g; 12 | 13 | function allKeys (object) { 14 | var keys = []; 15 | for (var key in object) { keys.push(key); } 16 | return keys; 17 | } 18 | 19 | function assignStyle (node, styles, options) { 20 | var keys = allKeys(styles); 21 | for (var i = 0; i < keys.length; ++i) { 22 | var key = keys[i]; 23 | if (key === '$') { 24 | create.setStyle(node, styles.$, options); 25 | } else { 26 | node.style[key] = styles[key]; 27 | } 28 | } 29 | return node; 30 | } 31 | 32 | function setStyle (node, styles, options) { 33 | var keys = allKeys(styles); 34 | for (var i = 0; i < keys.length; ++i) { 35 | var key = keys[i]; 36 | if (key === '$') { 37 | create.assignStyle(node, styles.$, options); 38 | } else { 39 | node.style.setProperty(key, styles[key]); 40 | } 41 | } 42 | return node; 43 | } 44 | 45 | function setData (node, dataset, options) { 46 | var keys = allKeys(dataset); 47 | for (var i = 0; i < keys.length; ++i) { 48 | var key = keys[i]; 49 | node.dataset[key] = dataset[key]; 50 | } 51 | return node; 52 | } 53 | 54 | function addListener (node, name, value) { 55 | var type = name; 56 | if (type.substring(0, 2) == 'on') { 57 | type = type.substring(2); 58 | } 59 | node.addEventListener(type, value, false); 60 | } 61 | 62 | function setProperties (node, props, options) { 63 | var keys = allKeys(props); 64 | for (var i = 0; i < keys.length; ++i) { 65 | var key = keys[i]; 66 | switch (key) { 67 | case '$': 68 | create.setAttrs(node, props.$, options); 69 | break; 70 | case 'style': 71 | if (typeof props.style == 'string') { 72 | node.style.cssText = props.style; 73 | } else { 74 | create.setStyle(node, props.style, options); 75 | } 76 | break; 77 | case 'dataset': 78 | create.setData(node, props.dataset, options); 79 | break; 80 | default: 81 | if (typeof props[key] == 'function') { 82 | addListener(node, key, props[key]); 83 | } else { 84 | node[key] = props[key]; 85 | } 86 | break; 87 | } 88 | } 89 | return node; 90 | } 91 | 92 | function setAttributes (node, attributes, options) { 93 | var keys = allKeys(attributes); 94 | for (var i = 0; i < keys.length; ++i) { 95 | var key = keys[i]; 96 | switch (key) { 97 | case '$': 98 | if (options && typeof options.setComponentProperties == 'function' && node.tagName.indexOf('-') > 0) { 99 | options.setComponentProperties(node, attributes.$, options); 100 | } else { 101 | create.setProps(node, attributes.$, options); 102 | } 103 | break; 104 | case 'style': 105 | if (typeof attributes.style == 'string') { 106 | node.style.cssText = attributes.style; 107 | } else { 108 | create.setStyle(node, attributes.style); 109 | } 110 | break; 111 | case 'class': 112 | case 'className': 113 | node.className = attributes[key]; 114 | break; 115 | default: 116 | var name = parseName.exec(key); 117 | if (name && name[1]) { 118 | node.setAttributeNS(create.namespaces[name[1]], name[2], attributes[key]); 119 | } else { 120 | if (typeof attributes[key] == 'function') { 121 | addListener(node, key, attributes[key]); 122 | } else { 123 | node.setAttribute(key, attributes[key]); 124 | } 125 | } 126 | break; 127 | } 128 | } 129 | return node; 130 | } 131 | 132 | function createText (text, parent, options) { 133 | var doc = options && options.document || document; 134 | if (parent) { 135 | if (parent.nodeType === 9) { 136 | doc = parent; 137 | parent = null; 138 | } else { 139 | doc = parent.ownerDocument || doc; 140 | } 141 | } 142 | var node = doc.createTextNode(text); 143 | if (parent && parent.nodeType === 1) { 144 | parent.appendChild(node); 145 | } 146 | return node; 147 | } 148 | 149 | function create (tag, attributes, parent, ns, options) { 150 | var doc = options && options.document || document; 151 | if (parent) { 152 | if (parent.nodeType === 9) { 153 | doc = parent; 154 | parent = null; 155 | } else { 156 | doc = parent.ownerDocument || doc; 157 | } 158 | } 159 | 160 | // create an element 161 | var name = parseName.exec(tag), node; 162 | 163 | ns = name[1] || ns; 164 | if (ns) { 165 | node = doc.createElementNS(create.namespaces[ns], name[2] || 'div'); 166 | } else { 167 | node = doc.createElement(name[2] || 'div'); 168 | } 169 | if (name[0].length < tag.length) { 170 | // add selector's classes and ids 171 | tag.substring(name[0].length).replace(parseSelector, function (match) { 172 | switch (match.charAt(0)) { 173 | case '.': 174 | node.classList.add(match.substring(1)); 175 | break; 176 | case '#': 177 | node.id = match.substring(1); 178 | break; 179 | } 180 | return ''; 181 | }); 182 | } 183 | 184 | if (attributes) { 185 | create.setAttrs(node, attributes, options); 186 | } 187 | 188 | if (parent && parent.nodeType === 1) { 189 | parent.appendChild(node); 190 | } 191 | return node; 192 | } 193 | 194 | create.text = createText; 195 | create.allKeys = allKeys; 196 | create.setAttrs = setAttributes; 197 | create.setProps = setProperties; 198 | create.setData = setData; 199 | create.setStyle = setStyle; 200 | create.assignStyle = assignStyle; 201 | create.namespaces = namespaces; 202 | 203 | return create; 204 | }); 205 | -------------------------------------------------------------------------------- /tests/test-create.js: -------------------------------------------------------------------------------- 1 | define(['module', 'heya-unit', '../create'], function (module, unit, create) { 2 | 'use strict'; 3 | 4 | unit.add(module, [ 5 | function test_div (t) { 6 | var node = create('div'); 7 | eval(t.TEST('node.tagName === "DIV"')); 8 | eval(t.TEST('node.attributes.length === 0')); 9 | eval(t.TEST('node.classList.length == 0')); 10 | eval(t.TEST('node.innerHTML === ""')); 11 | }, 12 | function test_div_attr (t) { 13 | var node = create('div', {'data-abc': 12}); 14 | eval(t.TEST('node.tagName === "DIV"')); 15 | eval(t.TEST('node.attributes.length === 1')); 16 | eval(t.TEST('node.getAttribute("data-abc") === "12"')); 17 | eval(t.TEST('node.innerHTML === ""')); 18 | }, 19 | function test_div_attr_text (t) { 20 | var node = create('div', {'data-abc': 12, $: {innerHTML: 'Hello!'}}); 21 | eval(t.TEST('node.tagName === "DIV"')); 22 | eval(t.TEST('node.attributes.length === 1')); 23 | eval(t.TEST('node.getAttribute("data-abc") === "12"')); 24 | eval(t.TEST('node.innerHTML === "Hello!"')); 25 | }, 26 | function test_div_style_string_simple (t) { 27 | var node = create('div', {style: 'font-weight: bold'}); 28 | eval(t.TEST('node.tagName === "DIV"')); 29 | eval(t.TEST('node.style.fontWeight === "bold"')); 30 | }, 31 | function test_div_style_set_simple (t) { 32 | var node = create('div', {style: {'font-weight': 'bold'}}); 33 | eval(t.TEST('node.tagName === "DIV"')); 34 | eval(t.TEST('node.style.fontWeight === "bold"')); 35 | }, 36 | function test_div_style_assign_simple (t) { 37 | var node = create('div', {style: {$: {fontWeight: 'bold'}}}); 38 | eval(t.TEST('node.tagName === "DIV"')); 39 | eval(t.TEST('node.style.fontWeight === "bold"')); 40 | }, 41 | function test_div_style_string (t) { 42 | var node = create('div', {$: {style: 'font-weight: bold'}}); 43 | eval(t.TEST('node.tagName === "DIV"')); 44 | eval(t.TEST('node.style.fontWeight === "bold"')); 45 | }, 46 | function test_div_style_set (t) { 47 | var node = create('div', {$: {style: {'font-weight': 'bold'}}}); 48 | eval(t.TEST('node.tagName === "DIV"')); 49 | eval(t.TEST('node.style.fontWeight === "bold"')); 50 | }, 51 | function test_div_style_assign (t) { 52 | var node = create('div', {$: {style: {$: {fontWeight: 'bold'}}}}); 53 | eval(t.TEST('node.tagName === "DIV"')); 54 | eval(t.TEST('node.style.fontWeight === "bold"')); 55 | }, 56 | function test_ns (t) { 57 | var node = create('svg:path'); 58 | eval(t.TEST('node.tagName === "path"')); 59 | eval(t.TEST('node.namespaceURI === "http://www.w3.org/2000/svg"')); 60 | }, 61 | function test_className_simple (t) { 62 | var node = create('div', {className: 'a b'}); 63 | eval(t.TEST('node.classList.length == 2')); 64 | eval(t.TEST('node.classList.contains("a")')); 65 | eval(t.TEST('node.classList.contains("b")')); 66 | }, 67 | function test_className (t) { 68 | var node = create('div', {$: {className: 'a b'}}); 69 | eval(t.TEST('node.classList.length == 2')); 70 | eval(t.TEST('node.classList.contains("a")')); 71 | eval(t.TEST('node.classList.contains("b")')); 72 | }, 73 | function test_span_selector (t) { 74 | var node = create('span.a.b#x'); 75 | eval(t.TEST('node.tagName === "SPAN"')); 76 | eval(t.TEST('node.classList.length == 2')); 77 | eval(t.TEST('node.classList.contains("a")')); 78 | eval(t.TEST('node.classList.contains("b")')); 79 | eval(t.TEST('node.id === "x"')); 80 | }, 81 | function test_div_selector (t) { 82 | var node = create('.a.b#x'); 83 | eval(t.TEST('node.tagName === "DIV"')); 84 | eval(t.TEST('node.classList.length == 2')); 85 | eval(t.TEST('node.classList.contains("a")')); 86 | eval(t.TEST('node.classList.contains("b")')); 87 | eval(t.TEST('node.id === "x"')); 88 | }, 89 | function test_text (t) { 90 | var node = create.text('Hello!'); 91 | eval(t.TEST('node.nodeName === "#text"')); 92 | eval(t.TEST('node.nodeValue === "Hello!"')); 93 | }, 94 | { 95 | test: function test_event_attr_on (t) { 96 | var x = t.startAsync(); 97 | 98 | var node = create('div', {onclick: handler}); 99 | 100 | var event = document.createEvent('HTMLEvents'); 101 | event.initEvent('click', true, true); // event type, bubbling, cancelable 102 | node.dispatchEvent(event); 103 | 104 | function handler () { 105 | t.info('click!'); 106 | x.done(); 107 | } 108 | }, 109 | logs: ['click!'] 110 | }, 111 | { 112 | test: function test_event_attr (t) { 113 | var x = t.startAsync(); 114 | 115 | var node = create('div', {click: handler}); 116 | 117 | var event = document.createEvent('HTMLEvents'); 118 | event.initEvent('click', true, true); // event type, bubbling, cancelable 119 | node.dispatchEvent(event); 120 | 121 | function handler () { 122 | t.info('click!'); 123 | x.done(); 124 | } 125 | }, 126 | logs: ['click!'] 127 | }, 128 | { 129 | test: function test_event_prop_on (t) { 130 | var x = t.startAsync(); 131 | 132 | var node = create('div', {$: {onclick: handler}}); 133 | 134 | var event = document.createEvent('HTMLEvents'); 135 | event.initEvent('click', true, true); // event type, bubbling, cancelable 136 | node.dispatchEvent(event); 137 | 138 | function handler () { 139 | t.info('click!'); 140 | x.done(); 141 | } 142 | }, 143 | logs: ['click!'] 144 | }, 145 | { 146 | test: function test_event_prop (t) { 147 | var x = t.startAsync(); 148 | 149 | var node = create('div', {$: {onclick: handler}}); 150 | 151 | var event = document.createEvent('HTMLEvents'); 152 | event.initEvent('click', true, true); // event type, bubbling, cancelable 153 | node.dispatchEvent(event); 154 | 155 | function handler () { 156 | t.info('click!'); 157 | x.done(); 158 | } 159 | }, 160 | logs: ['click!'] 161 | } 162 | ]); 163 | 164 | return {}; 165 | }); 166 | -------------------------------------------------------------------------------- /tests/test-hyperscript.js: -------------------------------------------------------------------------------- 1 | define(['module', 'heya-unit', '../hyperscript'], function (module, unit, h) { 2 | 'use strict'; 3 | 4 | unit.add(module, [ 5 | function test_h (t) { 6 | // this test is taken verbatim from https://github.com/dominictarr/hyperscript#readme 7 | var node = h('div#page', 8 | h('div#header', 9 | h('h1.classy', 'h', {style: {'background-color': '#22f'}}) 10 | ), 11 | h('div#menu', {style: {'background-color': '#2f2'}}, 12 | h('ul', 13 | h('li', 'one'), 14 | h('li', 'two'), 15 | h('li', 'three') 16 | ) 17 | ), 18 | h('h2', 'content title', {style: {'background-color': '#f22'}}), 19 | h('p', "so it's just like a templating engine,\n", 20 | "but easy to use inline with javascript\n"), 21 | h('p', "the intension is for this to be used to create\n", 22 | "reusable, interactive html widgets. ") 23 | ); 24 | 25 | eval(t.TEST('node.tagName === "DIV"')); 26 | eval(t.TEST('node.id === "page"')); 27 | eval(t.TEST('node.querySelector("#header").tagName === "DIV"')); 28 | eval(t.TEST('node.querySelector("#menu").tagName === "DIV"')); 29 | eval(t.TEST('node.querySelectorAll("p").length === 2')); 30 | 31 | var h1 = node.querySelector('h1'), h2 = node.querySelector('h2'); 32 | 33 | eval(t.TEST('h1.classList.contains("classy")')); 34 | eval(t.TEST('h1.innerHTML === "h"')); 35 | eval(t.TEST('h2.innerHTML === "content title"')); 36 | eval(t.TEST('h1.style.backgroundColor')); 37 | eval(t.TEST('h2.style.backgroundColor')); 38 | 39 | var li = node.querySelectorAll('ul li'); 40 | eval(t.TEST('li.length === 3')); 41 | eval(t.TEST('li[0].innerHTML === "one"')); 42 | eval(t.TEST('li[1].innerHTML === "two"')); 43 | eval(t.TEST('li[2].innerHTML === "three"')); 44 | }, 45 | // the rest of tests are taken from https://github.com/dominictarr/hyperscript/blob/master/test/index.js 46 | function test_simple (t) { 47 | eval(t.TEST("h('h1').outerHTML === '

    '")); 48 | eval(t.TEST("h('h1', 'hello world').outerHTML === '

    hello world

    '")); 49 | }, 50 | function test_nested (t) { 51 | var node = h('div', 52 | h('h1', 'Title'), 53 | h('p', 'Paragraph') 54 | ); 55 | eval(t.TEST("node.outerHTML === '

    Title

    Paragraph

    '")); 56 | }, 57 | function test_nested_arrays (t) { 58 | var node = h('div', 59 | [h('h1', 'Title'), h('p', 'Paragraph')] 60 | ); 61 | eval(t.TEST("node.outerHTML === '

    Title

    Paragraph

    '")); 62 | }, 63 | /* 64 | function test_namespaces (t) { 65 | eval(t.TEST("h('myns:mytag').outerHTML === ''")); 66 | }, 67 | */ 68 | function test_id (t) { 69 | eval(t.TEST("h('div#frame').outerHTML === '
    '")); 70 | }, 71 | function test_id (t) { 72 | eval(t.TEST("h('div.panel').outerHTML === '
    '")); 73 | }, 74 | function test_default_element (t) { 75 | eval(t.TEST("h('.panel').outerHTML === '
    '")); 76 | eval(t.TEST("h('#frame').outerHTML === '
    '")); 77 | }, 78 | function test_set_props (t) { 79 | var a = h('a', {href: 'http://google.com'}); 80 | eval(t.TEST("a.href === 'http://google.com/'")); 81 | var checkbox = h('input', {name: 'yes', type: 'checkbox'}); 82 | eval(t.TEST("checkbox.outerHTML === ''")); 83 | }, 84 | /* 85 | test('registers event handlers', function(t){ 86 | var onClick = spy() 87 | var p = h('p', {onclick: onClick}, 'something') 88 | simu.click(p) 89 | t.assert(onClick.called) 90 | t.end() 91 | }) 92 | */ 93 | function test_set_styles (t) { 94 | var div = h('div', {style: {'color': 'red'}}); 95 | eval(t.TEST("div.style.color === 'red'")); 96 | }, 97 | function test_set_styles_as_text (t) { 98 | var div = h('div', {style: 'color: red'}); 99 | eval(t.TEST("div.style.color === 'red'")); 100 | }, 101 | /* 102 | test('sets data attributes', function(t){ 103 | var div = h('div', {'data-value': 5}) 104 | t.equal(div.getAttribute('data-value'), '5') // failing for IE9 105 | t.end() 106 | }) 107 | */ 108 | function test_primitives_as_text (t) { 109 | var e = h('p', true, false, 4, new Date('Mon Jan 15 2001'), /hello/); 110 | t.test(e.outerHTML.match(/

    truefalse4Mon Jan 15.+2001.*\/hello\/<\/p>/)); 111 | }, 112 | /* 113 | test('observable content', function(t){ 114 | var title = o() 115 | title('Welcome to HyperScript!') 116 | var h1 = h('h1', title) 117 | t.equal(h1.outerHTML, '

    Welcome to HyperScript!

    ') 118 | title('Leave, creep!') 119 | t.equal(h1.outerHTML, '

    Leave, creep!

    ') 120 | t.end() 121 | }) 122 | 123 | test('observable property', function(t){ 124 | var checked = o() 125 | checked(true) 126 | var checkbox = h('input', {type: 'checkbox', checked: checked}) 127 | t.equal(checkbox.checked, true) 128 | checked(false) 129 | t.equal(checkbox.checked, false) 130 | t.end() 131 | }) 132 | 133 | test('observable style', function(t){ 134 | var color = o() 135 | color('red') 136 | var div = h('div', {style: {'color': color}}) 137 | t.equal(div.style.color, 'red') 138 | color('blue') 139 | t.equal(div.style.color, 'blue') 140 | t.end() 141 | }) 142 | 143 | test('context basic', function(t){ 144 | var _h = h.context() 145 | var p = _h('p', 'hello') 146 | t.equal(p.outerHTML, '

    hello

    ') 147 | _h.cleanup() 148 | t.end() 149 | }) 150 | 151 | test('context cleanup removes observable listeners', function(t){ 152 | var _h = h.context() 153 | var text = o() 154 | text('hello') 155 | var color = o() 156 | color('red') 157 | var className = o() 158 | className('para') 159 | var p = _h('p', {style: {color: color}, className: className}, text) 160 | t.equal(p.outerHTML, '

    hello

    ') 161 | _h.cleanup() 162 | color('blue') 163 | text('world') 164 | className('section') 165 | t.equal(p.outerHTML, '

    hello

    ') 166 | t.end() 167 | }) 168 | 169 | test('context cleanup removes event handlers', function(t){ 170 | var _h = h.context() 171 | var onClick = spy() 172 | var button = _h('button', 'Click me!', {onclick: onClick}) 173 | _h.cleanup() 174 | simu.click(button) 175 | t.assert(!onClick.called, 'click listener was not triggered') 176 | t.end() 177 | }) 178 | */ 179 | function test_unicode (t) { 180 | eval(t.TEST("h('.⛄').outerHTML === '
    '")); 181 | eval(t.TEST("h('span#⛄').outerHTML === ''")); 182 | } 183 | ]); 184 | 185 | return {}; 186 | }); 187 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This library is available under *either* the terms of the modified BSD license 2 | *or* the Academic Free License version 2.1. As a recipient of this work, you 3 | may choose which license to receive this code under. No external contributions 4 | are allowed under licenses which are fundamentally incompatible with the AFL 5 | or BSD licenses that this library is distributed under. 6 | 7 | The text of the AFL and BSD licenses is reproduced below. 8 | 9 | ------------------------------------------------------------------------------- 10 | The "New" BSD License: 11 | ********************** 12 | 13 | Copyright (c) 2005-2012, Eugene Lazutkin 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 19 | * Redistributions of source code must retain the above copyright notice, this 20 | list of conditions and the following disclaimer. 21 | * Redistributions in binary form must reproduce the above copyright notice, 22 | this list of conditions and the following disclaimer in the documentation 23 | and/or other materials provided with the distribution. 24 | * Neither the name of Eugene Lazutkin nor the names of other contributors 25 | may be used to endorse or promote products derived from this software 26 | without specific prior written permission. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 29 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 32 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 34 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 36 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ------------------------------------------------------------------------------- 40 | The Academic Free License, v. 2.1: 41 | ********************************** 42 | 43 | This Academic Free License (the "License") applies to any original work of 44 | authorship (the "Original Work") whose owner (the "Licensor") has placed the 45 | following notice immediately following the copyright notice for the Original 46 | Work: 47 | 48 | Licensed under the Academic Free License version 2.1 49 | 50 | 1) Grant of Copyright License. Licensor hereby grants You a world-wide, 51 | royalty-free, non-exclusive, perpetual, sublicenseable license to do the 52 | following: 53 | 54 | a) to reproduce the Original Work in copies; 55 | 56 | b) to prepare derivative works ("Derivative Works") based upon the Original 57 | Work; 58 | 59 | c) to distribute copies of the Original Work and Derivative Works to the 60 | public; 61 | 62 | d) to perform the Original Work publicly; and 63 | 64 | e) to display the Original Work publicly. 65 | 66 | 2) Grant of Patent License. Licensor hereby grants You a world-wide, 67 | royalty-free, non-exclusive, perpetual, sublicenseable license, under patent 68 | claims owned or controlled by the Licensor that are embodied in the Original 69 | Work as furnished by the Licensor, to make, use, sell and offer for sale the 70 | Original Work and Derivative Works. 71 | 72 | 3) Grant of Source Code License. The term "Source Code" means the preferred 73 | form of the Original Work for making modifications to it and all available 74 | documentation describing how to modify the Original Work. Licensor hereby 75 | agrees to provide a machine-readable copy of the Source Code of the Original 76 | Work along with each copy of the Original Work that Licensor distributes. 77 | Licensor reserves the right to satisfy this obligation by placing a 78 | machine-readable copy of the Source Code in an information repository 79 | reasonably calculated to permit inexpensive and convenient access by You for as 80 | long as Licensor continues to distribute the Original Work, and by publishing 81 | the address of that information repository in a notice immediately following 82 | the copyright notice that applies to the Original Work. 83 | 84 | 4) Exclusions From License Grant. Neither the names of Licensor, nor the names 85 | of any contributors to the Original Work, nor any of their trademarks or 86 | service marks, may be used to endorse or promote products derived from this 87 | Original Work without express prior written permission of the Licensor. Nothing 88 | in this License shall be deemed to grant any rights to trademarks, copyrights, 89 | patents, trade secrets or any other intellectual property of Licensor except as 90 | expressly stated herein. No patent license is granted to make, use, sell or 91 | offer to sell embodiments of any patent claims other than the licensed claims 92 | defined in Section 2. No right is granted to the trademarks of Licensor even if 93 | such marks are included in the Original Work. Nothing in this License shall be 94 | interpreted to prohibit Licensor from licensing under different terms from this 95 | License any Original Work that Licensor otherwise would have a right to 96 | license. 97 | 98 | 5) This section intentionally omitted. 99 | 100 | 6) Attribution Rights. You must retain, in the Source Code of any Derivative 101 | Works that You create, all copyright, patent or trademark notices from the 102 | Source Code of the Original Work, as well as any notices of licensing and any 103 | descriptive text identified therein as an "Attribution Notice." You must cause 104 | the Source Code for any Derivative Works that You create to carry a prominent 105 | Attribution Notice reasonably calculated to inform recipients that You have 106 | modified the Original Work. 107 | 108 | 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that 109 | the copyright in and to the Original Work and the patent rights granted herein 110 | by Licensor are owned by the Licensor or are sublicensed to You under the terms 111 | of this License with the permission of the contributor(s) of those copyrights 112 | and patent rights. Except as expressly stated in the immediately proceeding 113 | sentence, the Original Work is provided under this License on an "AS IS" BASIS 114 | and WITHOUT WARRANTY, either express or implied, including, without limitation, 115 | the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR 116 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. 117 | This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No 118 | license to Original Work is granted hereunder except under this disclaimer. 119 | 120 | 8) Limitation of Liability. Under no circumstances and under no legal theory, 121 | whether in tort (including negligence), contract, or otherwise, shall the 122 | Licensor be liable to any person for any direct, indirect, special, incidental, 123 | or consequential damages of any character arising as a result of this License 124 | or the use of the Original Work including, without limitation, damages for loss 125 | of goodwill, work stoppage, computer failure or malfunction, or any and all 126 | other commercial damages or losses. This limitation of liability shall not 127 | apply to liability for death or personal injury resulting from Licensor's 128 | negligence to the extent applicable law prohibits such limitation. Some 129 | jurisdictions do not allow the exclusion or limitation of incidental or 130 | consequential damages, so this exclusion and limitation may not apply to You. 131 | 132 | 9) Acceptance and Termination. If You distribute copies of the Original Work or 133 | a Derivative Work, You must make a reasonable effort under the circumstances to 134 | obtain the express assent of recipients to the terms of this License. Nothing 135 | else but this License (or another written agreement between Licensor and You) 136 | grants You permission to create Derivative Works based upon the Original Work 137 | or to exercise any of the rights granted in Section 1 herein, and any attempt 138 | to do so except under the terms of this License (or another written agreement 139 | between Licensor and You) is expressly prohibited by U.S. copyright law, the 140 | equivalent laws of other countries, and by international treaty. Therefore, by 141 | exercising any of the rights granted to You in Section 1 herein, You indicate 142 | Your acceptance of this License and all of its terms and conditions. 143 | 144 | 10) Termination for Patent Action. This License shall terminate automatically 145 | and You may no longer exercise any of the rights granted to You by this License 146 | as of the date You commence an action, including a cross-claim or counterclaim, 147 | against Licensor or any licensee alleging that the Original Work infringes a 148 | patent. This termination provision shall not apply for an action alleging 149 | patent infringement by combinations of the Original Work with other software or 150 | hardware. 151 | 152 | 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this 153 | License may be brought only in the courts of a jurisdiction wherein the 154 | Licensor resides or in which Licensor conducts its primary business, and under 155 | the laws of that jurisdiction excluding its conflict-of-law provisions. The 156 | application of the United Nations Convention on Contracts for the International 157 | Sale of Goods is expressly excluded. Any use of the Original Work outside the 158 | scope of this License or after its termination shall be subject to the 159 | requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et 160 | seq., the equivalent laws of other countries, and international treaty. This 161 | section shall survive the termination of this License. 162 | 163 | 12) Attorneys Fees. In any action to enforce the terms of this License or 164 | seeking damages relating thereto, the prevailing party shall be entitled to 165 | recover its costs and expenses, including, without limitation, reasonable 166 | attorneys' fees and costs incurred in connection with such action, including 167 | any appeal of such action. This section shall survive the termination of this 168 | License. 169 | 170 | 13) Miscellaneous. This License represents the complete agreement concerning 171 | the subject matter hereof. If any provision of this License is held to be 172 | unenforceable, such provision shall be reformed only to the extent necessary to 173 | make it enforceable. 174 | 175 | 14) Definition of "You" in This License. "You" throughout this License, whether 176 | in upper or lower case, means an individual or a legal entity exercising rights 177 | under, and complying with all of the terms of, this License. For legal 178 | entities, "You" includes any entity that controls, is controlled by, or is 179 | under common control with you. For purposes of this definition, "control" means 180 | (i) the power, direct or indirect, to cause the direction or management of such 181 | entity, whether by contract or otherwise, or (ii) ownership of fifty percent 182 | (50%) or more of the outstanding shares, or (iii) beneficial ownership of such 183 | entity. 184 | 185 | 15) Right to Use. You may use the Original Work in all ways not otherwise 186 | restricted or conditioned by this License or by law, and Licensor promises not 187 | to interfere with or be responsible for such uses by You. 188 | 189 | This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved. 190 | Permission is hereby granted to copy and distribute this license without 191 | modification. This license may not be modified without the express written 192 | permission of its copyright owner. 193 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | ajv@^5.1.0: 6 | version "5.5.1" 7 | resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.1.tgz#b38bb8876d9e86bee994956a04e721e88b248eb2" 8 | dependencies: 9 | co "^4.6.0" 10 | fast-deep-equal "^1.0.0" 11 | fast-json-stable-stringify "^2.0.0" 12 | json-schema-traverse "^0.3.0" 13 | 14 | asn1@~0.2.3: 15 | version "0.2.3" 16 | resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" 17 | 18 | assert-plus@1.0.0, assert-plus@^1.0.0: 19 | version "1.0.0" 20 | resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" 21 | 22 | asynckit@^0.4.0: 23 | version "0.4.0" 24 | resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" 25 | 26 | aws-sign2@~0.7.0: 27 | version "0.7.0" 28 | resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" 29 | 30 | aws4@^1.6.0: 31 | version "1.6.0" 32 | resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" 33 | 34 | balanced-match@^1.0.0: 35 | version "1.0.0" 36 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 37 | 38 | bcrypt-pbkdf@^1.0.0: 39 | version "1.0.1" 40 | resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" 41 | dependencies: 42 | tweetnacl "^0.14.3" 43 | 44 | boom@4.x.x: 45 | version "4.3.1" 46 | resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" 47 | dependencies: 48 | hoek "4.x.x" 49 | 50 | boom@5.x.x: 51 | version "5.2.0" 52 | resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" 53 | dependencies: 54 | hoek "4.x.x" 55 | 56 | brace-expansion@^1.1.7: 57 | version "1.1.8" 58 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" 59 | dependencies: 60 | balanced-match "^1.0.0" 61 | concat-map "0.0.1" 62 | 63 | caseless@~0.12.0: 64 | version "0.12.0" 65 | resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" 66 | 67 | co@^4.6.0: 68 | version "4.6.0" 69 | resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" 70 | 71 | combined-stream@^1.0.5, combined-stream@~1.0.5: 72 | version "1.0.5" 73 | resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" 74 | dependencies: 75 | delayed-stream "~1.0.0" 76 | 77 | concat-map@0.0.1: 78 | version "0.0.1" 79 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 80 | 81 | concat-stream@1.6.0: 82 | version "1.6.0" 83 | resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" 84 | dependencies: 85 | inherits "^2.0.3" 86 | readable-stream "^2.2.2" 87 | typedarray "^0.0.6" 88 | 89 | core-util-is@1.0.2, core-util-is@~1.0.0: 90 | version "1.0.2" 91 | resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" 92 | 93 | cryptiles@3.x.x: 94 | version "3.1.2" 95 | resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" 96 | dependencies: 97 | boom "5.x.x" 98 | 99 | dashdash@^1.12.0: 100 | version "1.14.1" 101 | resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" 102 | dependencies: 103 | assert-plus "^1.0.0" 104 | 105 | debug@2.6.9: 106 | version "2.6.9" 107 | resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" 108 | dependencies: 109 | ms "2.0.0" 110 | 111 | delayed-stream@~1.0.0: 112 | version "1.0.0" 113 | resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" 114 | 115 | ecc-jsbn@~0.1.1: 116 | version "0.1.1" 117 | resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" 118 | dependencies: 119 | jsbn "~0.1.0" 120 | 121 | es6-promise@^4.0.3: 122 | version "4.1.1" 123 | resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.1.1.tgz#8811e90915d9a0dba36274f0b242dbda78f9c92a" 124 | 125 | extend@~3.0.1: 126 | version "3.0.1" 127 | resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" 128 | 129 | extract-zip@^1.6.5: 130 | version "1.6.6" 131 | resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.6.tgz#1290ede8d20d0872b429fd3f351ca128ec5ef85c" 132 | dependencies: 133 | concat-stream "1.6.0" 134 | debug "2.6.9" 135 | mkdirp "0.5.0" 136 | yauzl "2.4.1" 137 | 138 | extsprintf@1.3.0: 139 | version "1.3.0" 140 | resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" 141 | 142 | extsprintf@^1.2.0: 143 | version "1.4.0" 144 | resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" 145 | 146 | fast-deep-equal@^1.0.0: 147 | version "1.0.0" 148 | resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" 149 | 150 | fast-json-stable-stringify@^2.0.0: 151 | version "2.0.0" 152 | resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" 153 | 154 | fd-slicer@~1.0.1: 155 | version "1.0.1" 156 | resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65" 157 | dependencies: 158 | pend "~1.2.0" 159 | 160 | forever-agent@~0.6.1: 161 | version "0.6.1" 162 | resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" 163 | 164 | form-data@~2.3.1: 165 | version "2.3.1" 166 | resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" 167 | dependencies: 168 | asynckit "^0.4.0" 169 | combined-stream "^1.0.5" 170 | mime-types "^2.1.12" 171 | 172 | fs-extra@^1.0.0: 173 | version "1.0.0" 174 | resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950" 175 | dependencies: 176 | graceful-fs "^4.1.2" 177 | jsonfile "^2.1.0" 178 | klaw "^1.0.0" 179 | 180 | fs.realpath@^1.0.0: 181 | version "1.0.0" 182 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 183 | 184 | getpass@^0.1.1: 185 | version "0.1.7" 186 | resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" 187 | dependencies: 188 | assert-plus "^1.0.0" 189 | 190 | glob@^7.0.0: 191 | version "7.1.2" 192 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" 193 | dependencies: 194 | fs.realpath "^1.0.0" 195 | inflight "^1.0.4" 196 | inherits "2" 197 | minimatch "^3.0.4" 198 | once "^1.3.0" 199 | path-is-absolute "^1.0.0" 200 | 201 | graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: 202 | version "4.1.11" 203 | resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" 204 | 205 | har-schema@^2.0.0: 206 | version "2.0.0" 207 | resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" 208 | 209 | har-validator@~5.0.3: 210 | version "5.0.3" 211 | resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" 212 | dependencies: 213 | ajv "^5.1.0" 214 | har-schema "^2.0.0" 215 | 216 | hasha@^2.2.0: 217 | version "2.2.0" 218 | resolved "https://registry.yarnpkg.com/hasha/-/hasha-2.2.0.tgz#78d7cbfc1e6d66303fe79837365984517b2f6ee1" 219 | dependencies: 220 | is-stream "^1.0.1" 221 | pinkie-promise "^2.0.0" 222 | 223 | hawk@~6.0.2: 224 | version "6.0.2" 225 | resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" 226 | dependencies: 227 | boom "4.x.x" 228 | cryptiles "3.x.x" 229 | hoek "4.x.x" 230 | sntp "2.x.x" 231 | 232 | heya-globalize@^1.2.1: 233 | version "1.2.1" 234 | resolved "https://registry.yarnpkg.com/heya-globalize/-/heya-globalize-1.2.1.tgz#03ed1c99c02c849a0de46a4246baf8f4d681eedd" 235 | dependencies: 236 | glob "^7.0.0" 237 | minimist "^1.2.0" 238 | mkdirp "^0.5.1" 239 | 240 | heya-ice@>=0.1: 241 | version "0.1.11" 242 | resolved "https://registry.yarnpkg.com/heya-ice/-/heya-ice-0.1.11.tgz#5d6da59c60b59c7023a83470fb6e9771d7705849" 243 | 244 | heya-unify@>=0.2: 245 | version "0.2.5" 246 | resolved "https://registry.yarnpkg.com/heya-unify/-/heya-unify-0.2.5.tgz#16c34fd426c44eeb32f89cab234daaaf29afc49b" 247 | dependencies: 248 | heya-ice ">=0.1" 249 | 250 | heya-unit@^0.3.0: 251 | version "0.3.0" 252 | resolved "https://registry.yarnpkg.com/heya-unit/-/heya-unit-0.3.0.tgz#797478208c819d4c5b7fe356ac4c1b84eebbb9b7" 253 | dependencies: 254 | heya-ice ">=0.1" 255 | heya-unify ">=0.2" 256 | 257 | hoek@4.x.x: 258 | version "4.2.0" 259 | resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" 260 | 261 | http-signature@~1.2.0: 262 | version "1.2.0" 263 | resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" 264 | dependencies: 265 | assert-plus "^1.0.0" 266 | jsprim "^1.2.2" 267 | sshpk "^1.7.0" 268 | 269 | inflight@^1.0.4: 270 | version "1.0.6" 271 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 272 | dependencies: 273 | once "^1.3.0" 274 | wrappy "1" 275 | 276 | inherits@2, inherits@^2.0.3, inherits@~2.0.3: 277 | version "2.0.3" 278 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 279 | 280 | is-stream@^1.0.1: 281 | version "1.1.0" 282 | resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" 283 | 284 | is-typedarray@~1.0.0: 285 | version "1.0.0" 286 | resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" 287 | 288 | isarray@~1.0.0: 289 | version "1.0.0" 290 | resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" 291 | 292 | isexe@^2.0.0: 293 | version "2.0.0" 294 | resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" 295 | 296 | isstream@~0.1.2: 297 | version "0.1.2" 298 | resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" 299 | 300 | jsbn@~0.1.0: 301 | version "0.1.1" 302 | resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" 303 | 304 | json-schema-traverse@^0.3.0: 305 | version "0.3.1" 306 | resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" 307 | 308 | json-schema@0.2.3: 309 | version "0.2.3" 310 | resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" 311 | 312 | json-stringify-safe@~5.0.1: 313 | version "5.0.1" 314 | resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" 315 | 316 | jsonfile@^2.1.0: 317 | version "2.4.0" 318 | resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" 319 | optionalDependencies: 320 | graceful-fs "^4.1.6" 321 | 322 | jsprim@^1.2.2: 323 | version "1.4.1" 324 | resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" 325 | dependencies: 326 | assert-plus "1.0.0" 327 | extsprintf "1.3.0" 328 | json-schema "0.2.3" 329 | verror "1.10.0" 330 | 331 | kew@^0.7.0: 332 | version "0.7.0" 333 | resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b" 334 | 335 | klaw@^1.0.0: 336 | version "1.3.1" 337 | resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" 338 | optionalDependencies: 339 | graceful-fs "^4.1.9" 340 | 341 | mime-db@~1.30.0: 342 | version "1.30.0" 343 | resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" 344 | 345 | mime-types@^2.1.12, mime-types@~2.1.17: 346 | version "2.1.17" 347 | resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" 348 | dependencies: 349 | mime-db "~1.30.0" 350 | 351 | minimatch@^3.0.4: 352 | version "3.0.4" 353 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 354 | dependencies: 355 | brace-expansion "^1.1.7" 356 | 357 | minimist@0.0.8: 358 | version "0.0.8" 359 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" 360 | 361 | minimist@^1.2.0: 362 | version "1.2.0" 363 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" 364 | 365 | mkdirp@0.5.0: 366 | version "0.5.0" 367 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12" 368 | dependencies: 369 | minimist "0.0.8" 370 | 371 | mkdirp@^0.5.1: 372 | version "0.5.1" 373 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" 374 | dependencies: 375 | minimist "0.0.8" 376 | 377 | ms@2.0.0: 378 | version "2.0.0" 379 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" 380 | 381 | oauth-sign@~0.8.2: 382 | version "0.8.2" 383 | resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" 384 | 385 | once@^1.3.0: 386 | version "1.4.0" 387 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 388 | dependencies: 389 | wrappy "1" 390 | 391 | path-is-absolute@^1.0.0: 392 | version "1.0.1" 393 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 394 | 395 | pend@~1.2.0: 396 | version "1.2.0" 397 | resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" 398 | 399 | performance-now@^2.1.0: 400 | version "2.1.0" 401 | resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" 402 | 403 | phantomjs-prebuilt@^2.1.16: 404 | version "2.1.16" 405 | resolved "https://registry.yarnpkg.com/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz#efd212a4a3966d3647684ea8ba788549be2aefef" 406 | dependencies: 407 | es6-promise "^4.0.3" 408 | extract-zip "^1.6.5" 409 | fs-extra "^1.0.0" 410 | hasha "^2.2.0" 411 | kew "^0.7.0" 412 | progress "^1.1.8" 413 | request "^2.81.0" 414 | request-progress "^2.0.1" 415 | which "^1.2.10" 416 | 417 | pinkie-promise@^2.0.0: 418 | version "2.0.1" 419 | resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" 420 | dependencies: 421 | pinkie "^2.0.0" 422 | 423 | pinkie@^2.0.0: 424 | version "2.0.4" 425 | resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" 426 | 427 | process-nextick-args@~1.0.6: 428 | version "1.0.7" 429 | resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" 430 | 431 | progress@^1.1.8: 432 | version "1.1.8" 433 | resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" 434 | 435 | punycode@^1.4.1: 436 | version "1.4.1" 437 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" 438 | 439 | qs@~6.5.1: 440 | version "6.5.1" 441 | resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" 442 | 443 | readable-stream@^2.2.2: 444 | version "2.3.3" 445 | resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" 446 | dependencies: 447 | core-util-is "~1.0.0" 448 | inherits "~2.0.3" 449 | isarray "~1.0.0" 450 | process-nextick-args "~1.0.6" 451 | safe-buffer "~5.1.1" 452 | string_decoder "~1.0.3" 453 | util-deprecate "~1.0.1" 454 | 455 | request-progress@^2.0.1: 456 | version "2.0.1" 457 | resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-2.0.1.tgz#5d36bb57961c673aa5b788dbc8141fdf23b44e08" 458 | dependencies: 459 | throttleit "^1.0.0" 460 | 461 | request@^2.81.0: 462 | version "2.83.0" 463 | resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" 464 | dependencies: 465 | aws-sign2 "~0.7.0" 466 | aws4 "^1.6.0" 467 | caseless "~0.12.0" 468 | combined-stream "~1.0.5" 469 | extend "~3.0.1" 470 | forever-agent "~0.6.1" 471 | form-data "~2.3.1" 472 | har-validator "~5.0.3" 473 | hawk "~6.0.2" 474 | http-signature "~1.2.0" 475 | is-typedarray "~1.0.0" 476 | isstream "~0.1.2" 477 | json-stringify-safe "~5.0.1" 478 | mime-types "~2.1.17" 479 | oauth-sign "~0.8.2" 480 | performance-now "^2.1.0" 481 | qs "~6.5.1" 482 | safe-buffer "^5.1.1" 483 | stringstream "~0.0.5" 484 | tough-cookie "~2.3.3" 485 | tunnel-agent "^0.6.0" 486 | uuid "^3.1.0" 487 | 488 | safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: 489 | version "5.1.1" 490 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" 491 | 492 | sntp@2.x.x: 493 | version "2.1.0" 494 | resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" 495 | dependencies: 496 | hoek "4.x.x" 497 | 498 | sshpk@^1.7.0: 499 | version "1.13.1" 500 | resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" 501 | dependencies: 502 | asn1 "~0.2.3" 503 | assert-plus "^1.0.0" 504 | dashdash "^1.12.0" 505 | getpass "^0.1.1" 506 | optionalDependencies: 507 | bcrypt-pbkdf "^1.0.0" 508 | ecc-jsbn "~0.1.1" 509 | jsbn "~0.1.0" 510 | tweetnacl "~0.14.0" 511 | 512 | string_decoder@~1.0.3: 513 | version "1.0.3" 514 | resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" 515 | dependencies: 516 | safe-buffer "~5.1.0" 517 | 518 | stringstream@~0.0.5: 519 | version "0.0.5" 520 | resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" 521 | 522 | throttleit@^1.0.0: 523 | version "1.0.0" 524 | resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" 525 | 526 | tough-cookie@~2.3.3: 527 | version "2.3.3" 528 | resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" 529 | dependencies: 530 | punycode "^1.4.1" 531 | 532 | tunnel-agent@^0.6.0: 533 | version "0.6.0" 534 | resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" 535 | dependencies: 536 | safe-buffer "^5.0.1" 537 | 538 | tweetnacl@^0.14.3, tweetnacl@~0.14.0: 539 | version "0.14.5" 540 | resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" 541 | 542 | typedarray@^0.0.6: 543 | version "0.0.6" 544 | resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" 545 | 546 | util-deprecate@~1.0.1: 547 | version "1.0.2" 548 | resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" 549 | 550 | uuid@^3.1.0: 551 | version "3.1.0" 552 | resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" 553 | 554 | verror@1.10.0: 555 | version "1.10.0" 556 | resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" 557 | dependencies: 558 | assert-plus "^1.0.0" 559 | core-util-is "1.0.2" 560 | extsprintf "^1.2.0" 561 | 562 | which@^1.2.10: 563 | version "1.3.0" 564 | resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" 565 | dependencies: 566 | isexe "^2.0.0" 567 | 568 | wrappy@1: 569 | version "1.0.2" 570 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 571 | 572 | yauzl@2.4.1: 573 | version "2.4.1" 574 | resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005" 575 | dependencies: 576 | fd-slicer "~1.0.1" 577 | --------------------------------------------------------------------------------