Socket
Socket
Sign inDemoInstall

elem-dataset

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

src/index.js

11

dist/index.js

@@ -1,6 +0,2 @@

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.elemDataset = factory());
}(this, (function () { 'use strict';
'use strict';

@@ -21,3 +17,3 @@ // <3 Modernizr

var index = useNative() ? nativeDataset : function (element) {
module.exports = useNative() ? nativeDataset : function (element) {
var map = {};

@@ -63,4 +59,1 @@ var attributes = element.attributes;

return index;
})));

@@ -1,1 +0,1 @@

(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):e.elemDataset=t()})(this,function(){"use strict";function e(){var e=document.createElement("div");e.setAttribute("data-a-b","c");return Boolean(e.dataset&&e.dataset.aB==="c")}function t(e){return e.dataset}var n=e()?t:function(e){var t={};var n=e.attributes;function r(){return this.value}function a(e,t){if(typeof t==="undefined"){this.removeAttribute(e)}else{this.setAttribute(e,t)}}for(var i=0,u=n.length;i<u;i++){var o=n[i];if(o){var f=o.name;if(f.indexOf("data-")===0){var d=f.slice(5).replace(/-./g,function(e){return e.charAt(1).toUpperCase()});var c=o.value;Object.defineProperty(t,d,{enumerable:true,get:r.bind({value:c||""}),set:a.bind(e,f)})}}}return t};return n});
"use strict";function useNative(){var e=document.createElement("div");e.setAttribute("data-a-b","c");return Boolean(e.dataset&&e.dataset.aB==="c")}function nativeDataset(e){return e.dataset}module.exports=useNative()?nativeDataset:function(e){var t={};var a=e.attributes;function r(){return this.value}function n(e,t){if(typeof t==="undefined"){this.removeAttribute(e)}else{this.setAttribute(e,t)}}for(var i=0,u=a.length;i<u;i++){var s=a[i];if(s){var v=s.name;if(v.indexOf("data-")===0){var o=v.slice(5).replace(/-./g,function(e){return e.charAt(1).toUpperCase()});var c=s.value;Object.defineProperty(t,o,{enumerable:true,get:r.bind({value:c||""}),set:n.bind(e,v)})}}}return t};
{
"name": "elem-dataset",
"version": "1.1.0",
"version": "1.1.1",
"description": "Simple HTMLElement.dataset ponyfill",

@@ -27,3 +27,3 @@ "license": "MIT",

"build": "npm test && npm run bundle && npm run minify",
"bundle": "node_modules/.bin/rollup -c",
"bundle": "node_modules/.bin/babel src/index.js > dist/index.js",
"minify": "node_modules/.bin/uglifyjs dist/index.js > dist/index.min.js -m",

@@ -34,7 +34,5 @@ "test": "xo && ava"

"ava": "*",
"babel-preset-es2015-rollup": "^1.2.0",
"babel-cli": "^6.16.0",
"babel-preset-es2015": "^6.14.0",
"jsdom": "^9.6.0",
"rollup": "^0.36.1",
"rollup-plugin-babel": "^2.6.1",
"rollup-plugin-commonjs": "^5.0.4",
"uglify-js": "^2.7.3",

@@ -45,3 +43,3 @@ "xo": "*"

"presets": [
"es2015-rollup"
"es2015"
]

@@ -48,0 +46,0 @@ },

@@ -9,3 +9,3 @@ 'use strict';

const dataset = require('./index.js');
const dataset = require('./src/index.js');

@@ -12,0 +12,0 @@ const hasOwnProperty = Object.prototype.hasOwnProperty;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc