Skip to content

Commit 492db4a

Browse files
committed
Merge branch 'dev'
2 parents 98d4f4c + 2bdb29e commit 492db4a

File tree

7 files changed

+43
-20
lines changed

7 files changed

+43
-20
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules
22
npm-debug.log
3-
/lib
4-
/coverage
53
/.nyc_output
4+
/coverage
5+
/lib
6+
/releases

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
npm-debug.log
2-
/coverage
32
/.nyc_output
3+
/coverage
4+
/releases

dist/react-sortable.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*! react-sortablejs v0.7.0 | (c) 2016 Cheton Wu <[email protected]> | MIT | https://github.com/cheton/react-sortable */
12
(function webpackUniversalModuleDefinition(root, factory) {
23
if(typeof exports === 'object' && typeof module === 'object')
34
module.exports = factory(require("react"), require("react-dom"), require("sortablejs"));
@@ -119,15 +120,22 @@ return /******/ (function(modules) { // webpackBootstrap
119120
sources[_key - 1] = arguments[_key];
120121
}
121122

122-
sources.forEach(function (source) {
123-
for (var key in source) {
124-
if (source.hasOwnProperty(key)) {
125-
target[key] = source[key];
123+
if (target === undefined || target === null) {
124+
throw new TypeError('Cannot convert undefined or null to object');
125+
}
126+
127+
var output = Object(target);
128+
for (var index = 0; index < sources.length; index++) {
129+
var source = sources[index];
130+
if (source !== undefined && source !== null) {
131+
for (var key in source) {
132+
if (source.hasOwnProperty(key)) {
133+
output[key] = source[key];
134+
}
126135
}
127136
}
128-
});
129-
130-
return target;
137+
}
138+
return output;
131139
};
132140

133141
var SortableMixin = function SortableMixin() {

dist/react-sortable.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
"description": "A higher order React component for Sortable (https://github.com/RubaXa/Sortable).",
55
"main": "lib/index.js",
66
"scripts": {
7-
"prepublish": "npm run lint && npm run build && npm test && npm run lint",
7+
"prepublish": "npm run lint && npm run test && npm run build && npm run dist && npm run release",
88
"build": "babel ./src --out-dir ./lib",
99
"test": "./babel-tap --coverage test/*.js",
1010
"dist": "webpack; BUILD_ENV=dist webpack",
11+
"release": "mkdir -p releases; cp -f dist/react-sortable.js releases/react-sortable-${npm_package_version}.js; cp -f dist/react-sortable.min.js releases/react-sortable-${npm_package_version}.min.js",
1112
"lint": "eslint ./src",
1213
"lint:fix": "eslint --fix ./src",
1314
"precommit-check": "npm run lint",

src/index.jsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,22 @@ const getModelItems = (wrapperComponent) => {
2929
};
3030

3131
const extend = (target, ...sources) => {
32-
sources.forEach((source) => {
33-
for (let key in source) {
34-
if (source.hasOwnProperty(key)) {
35-
target[key] = source[key];
32+
if (target === undefined || target === null) {
33+
throw new TypeError('Cannot convert undefined or null to object');
34+
}
35+
36+
const output = Object(target);
37+
for (let index = 0; index < sources.length; index++) {
38+
const source = sources[index];
39+
if (source !== undefined && source !== null) {
40+
for (let key in source) {
41+
if (source.hasOwnProperty(key)) {
42+
output[key] = source[key];
43+
}
3644
}
3745
}
38-
});
39-
40-
return target;
46+
}
47+
return output;
4148
};
4249

4350
const SortableMixin = (options = defaultOptions) => (Component) => class extends React.Component {

webpack.config.babel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import path from 'path';
22
import webpack from 'webpack';
3+
import pkg from './package.json';
34

5+
const banner = pkg.name + ' v' + pkg.version + ' | (c) ' + new Date().getFullYear() + ' ' + pkg.author + ' | ' + pkg.license + ' | ' + pkg.homepage;
46
const env = process.env.BUILD_ENV;
5-
let plugins = [];
7+
let plugins = [
8+
new webpack.BannerPlugin(banner)
9+
];
610

711
if (env === 'dist') {
812
plugins = plugins.concat([

0 commit comments

Comments
 (0)