Skip to content

Commit

Permalink
Merge pull request #1 from OmgImAlexis/master
Browse files Browse the repository at this point in the history
Adds proper ESM and CJS support
  • Loading branch information
richardtallent committed Nov 20, 2018
2 parents b29d35e + a7d486a commit e0e882a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from "vue";

export const stateMerge = function(state, value, propName, ignoreNull) {
export const stateMerge = (state, value, propName, ignoreNull) => {
if (
Object.prototype.toString.call(value) === "[object Object]" &&
(propName == null || state.hasOwnProperty(propName))
Expand All @@ -13,3 +13,5 @@ export const stateMerge = function(state, value, propName, ignoreNull) {
}
if (!ignoreNull || value !== null) Vue.set(state, propName, value);
};

export default stateMerge;
3 changes: 3 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* eslint-disable-next-line no-global-assign */
require = require('esm')(module);
module.exports = require('./index.js');
13 changes: 9 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
{
"name": "vue-object-merge",
"version": "0.1.5",
"description":
"Utility function for merging an object into a reactive object in Vue",
"main": "index.js",
"version": "0.1.6",
"description": "Utility function for merging an object into a reactive object in Vue",
"main": "main.js",
"module": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Richard Tallent <richard@tallent.us> (https://www.tallent.us)",
"keywords": ["vue", "vuejs", "vuex", "merge", "deep assign"],
"keywords": [
"vue",
"vuejs",
"vuex",
"merge",
"deep assign"
],
"repository": "https://github.com/richardtallent/vue-object-merge",
"license": "MIT",
"dependencies": {
"vue": "^2.5.13"
"vue": "2.5.17",
"esm": "3.0.84"
},
"prettier": {
"useTabs": true,
Expand Down

0 comments on commit e0e882a

Please sign in to comment.