Comparing version 1.0.0 to 1.1.0
@@ -11,42 +11,21 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.attrobj = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
Object.keys(el.dataset).forEach(function (data) { | ||
if (data.startsWith(key) && data !== key) { | ||
var optionName = data.replace(key, ''); | ||
var isGlobal = false; | ||
try { | ||
for (var _iterator = Object.keys(el.dataset)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var data = _step.value; | ||
if (optionName.startsWith('Global')) { | ||
optionName = optionName.replace('Global', ''); | ||
isGlobal = true; | ||
} | ||
if (data.startsWith(key) && data !== key) { | ||
var optionName = data.replace(key, ''); | ||
var isGlobal = false; | ||
optionName = '' + optionName[0].toLowerCase() + optionName.slice(1); | ||
if (optionName.startsWith('Global')) { | ||
optionName = optionName.replace('Global', ''); | ||
isGlobal = true; | ||
} | ||
optionName = '' + optionName[0].toLowerCase() + optionName.slice(1); | ||
if (isGlobal) { | ||
values[optionName] = window[el.dataset[data]]; | ||
} else { | ||
values[optionName] = el.dataset[data]; | ||
} | ||
if (isGlobal) { | ||
values[optionName] = window[el.dataset[data]]; | ||
} else { | ||
values[optionName] = el.dataset[data]; | ||
} | ||
} | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return) { | ||
_iterator.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
}); | ||
@@ -53,0 +32,0 @@ return values; |
@@ -6,3 +6,3 @@ /* global window */ | ||
for (const data of Object.keys(el.dataset)) { | ||
Object.keys(el.dataset).forEach(data => { | ||
if (data.startsWith(key) && data !== key) { | ||
@@ -25,5 +25,5 @@ let optionName = data.replace(key, ''); | ||
} | ||
} | ||
}); | ||
return values; | ||
} |
{ | ||
"name": "attrobj", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Creates an object based on element attributes", | ||
"main": "lib/attrobj.js", | ||
"main": "dist/attrobj.js", | ||
"scripts": { | ||
"build": "browserify lib/attrobj.js -t [ babelify --presets [ es2015 ] ] -o dist/attrobj.js -s attrobj", | ||
"build:test": "browserify test/attrobj.test.js -t [ babelify --presets [ es2015 ] ] -o test/dist/test.js", | ||
"dev": "concurrently -r 'nswatch' 'static-server -p 8000'", | ||
"lint": "eslint . --ignore-pattern dist" | ||
"dev": "nswatch", | ||
"build": "mkdir -p dist && browserify lib/attrobj.js -t [ babelify --presets [ es2015 ] ] -o dist/attrobj.js -s attrobj", | ||
"test": "browserify -t [ babelify --presets [ es2015 ] ] test/attrobj.test.js | tape-run --browser phantomjs --render tap-spec", | ||
"lint": "eslint . --ignore-pattern dist", | ||
"prepublish": "npm run build" | ||
}, | ||
@@ -39,12 +40,16 @@ "watch": { | ||
"devDependencies": { | ||
"babel-preset-es2015": "^6.18.0", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babelify": "^7.3.0", | ||
"browserify": "^13.1.1", | ||
"concurrently": "^3.1.0", | ||
"eslint": "^3.9.1", | ||
"eslint-config-firstandthird": "^3.1.0", | ||
"eslint-plugin-import": "^2.1.0", | ||
"browserify": "^13.0.1", | ||
"concurrently": "^2.2.0", | ||
"core-js": "^2.4.1", | ||
"eslint": "^3.5.0", | ||
"eslint-config-firstandthird": "3.1.0", | ||
"eslint-plugin-import": "2.2.0", | ||
"nswatch": "^0.2.0", | ||
"phantomjs": "^2.1.7", | ||
"static-server": "^2.0.3", | ||
"tape": "^4.6.3" | ||
"tap-spec": "^4.1.1", | ||
"tape": "^4.6.2", | ||
"tape-run": "^2.1.5" | ||
}, | ||
@@ -51,0 +56,0 @@ "eslintConfig": { |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2
5036
14
6
50