New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-mixin-data-attributes

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-mixin-data-attributes - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

.babelrc

33

index.js

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

module.exports = {
mounted() {
const attributes = this.getDataAttributes();
Object.assign(this, attributes);
},
methods: {
getDataAttributes() {
if (!this.$el) {
return {};
}
if (this.$el.dataset) {
return this.$el.dataset;
}
// http://stackoverflow.com/a/5915585/5930258
return Array.from(this.$el.attributes).reduce((memo, attr) => {
if (/^data-/.test(attr.name)) {
const key = attr.name
.substr(5)
.replace(/-(.)/g, ($0, $1) => $1.toUpperCase());
memo[key] = attr.value;
}
return memo;
}, {});
},
},
};
module.exports = require('./dist').default;
{
"name": "vue-mixin-data-attributes",
"version": "1.0.2",
"version": "1.0.3",
"description": "Reads `data-` attributes from the element and assigns them to the Vue instance/component.",
"main": "index.js",
"module": "index.es2015.js",
"jsnext:main": "index.es2015.js",
"scripts": {
"test": "eslint index.js"
"build": "babel lib -d dist",
"test": "eslint lib"
},

@@ -21,2 +24,4 @@ "keywords": [

"devDependencies": {
"babel-cli": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"eslint": "^3.15.0",

@@ -23,0 +28,0 @@ "eslint-config-vi": "^5.0.0"

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc