Skip to content

Commit

Permalink
Add dist
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptex committed Apr 2, 2018
1 parent f462fa2 commit 9235451
Show file tree
Hide file tree
Showing 6 changed files with 1,829 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/env", "@babel/stage-2"]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ typings/
# dotenv environment variables file
.env

# Misc
.DS_Store
43 changes: 43 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addListener = exports.multiple = exports.single = exports.byID = void 0;

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }

function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }

var doc = document;
var win = window;

var byID = function byID(id) {
return doc.getElementById(id);
};

exports.byID = byID;

var single = function single(selector) {
return doc.querySelector(selector);
};

exports.single = single;

var multiple = function multiple(selector) {
return _toConsumableArray(doc.querySelectorAll(selector));
};

exports.multiple = multiple;

var addListener = function addListener(element, eventType, callback, shouldBubble) {
element.addEventListener(eventType, function (event) {
callback(event);
}, shouldBubble);
};

exports.addListener = addListener;
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "@three11/dom-helpers",
"version": "0.1.0",
"description": "Helper functions for faster DOM scripting",
"main": "dist/index.js",
"scripts": {
"build": "babel src -d dist"
},
"repository": {
"type": "git",
"url": "git+https://github.com/three11/dom-helpers.git"
},
"keywords": [
"DOM",
"Helpers",
"JavaScript",
"ES2017"
],
"authors": [
{
"name": "Three 11 Ltd",
"email": "[email protected]",
"role": "Developer"
},
{
"name": "Alexander Panayotov",
"email": "[email protected]",
"role": "Developer"
},
{
"name": "Atanas Atanasov",
"email": "[email protected]",
"role": "Developer"
}
],
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/three11/dom-helpers/issues"
},
"homepage": "https://github.com/three11/dom-helpers#readme",
"devDependencies": {
"@babel/cli": "^7.0.0-beta.42",
"@babel/core": "^7.0.0-beta.42",
"@babel/preset-env": "^7.0.0-beta.42",
"@babel/preset-stage-2": "^7.0.0-beta.42"
}
}
File renamed without changes.
Loading

0 comments on commit 9235451

Please sign in to comment.