Skip to content

Commit

Permalink
Bump 2.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Feb 28, 2017
1 parent 3b13f2d commit 4833e50
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v2.4.3

* Better `tree/cursor.splice` ([@jrust](https://github.com/jrust)).

## v2.4.2

* Fixing monkey-related memory leak ([@jrust](https://github.com/jrust)).
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "baobab",
"main": "build/baobab.min.js",
"version": "2.4.2",
"version": "2.4.3",
"homepage": "https://github.com/Yomguithereal/baobab",
"author": {
"name": "Guillaume Plique",
Expand Down
17 changes: 8 additions & 9 deletions build/baobab.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Baobab
*
* Homepage: https://github.com/Yomguithereal/baobab
* Version: 2.4.2
* Version: 2.4.3
* Author: Yomguithereal (Guillaume Plique)
* License: MIT
*/
Expand Down Expand Up @@ -1146,7 +1146,7 @@ Baobab.helpers = helpers;
/**
* Version
*/
Baobab.VERSION = '2.4.2';
Baobab.VERSION = '2.4.3';
module.exports = exports['default'];

},{"./cursor":3,"./helpers":4,"./monkey":5,"./type":6,"./update":7,"./watcher":8,"emmett":1}],3:[function(require,module,exports){
Expand Down Expand Up @@ -2581,7 +2581,11 @@ function solveUpdate(affectedPaths, comparedPaths) {
*/

function splice(array, startIndex, nb) {
if (nb === undefined) nb = array.length - startIndex;else if (nb === null) nb = 0;else if (Number.isNaN(Number.parseInt(nb, 10))) throw new Error('argument nb ' + nb + ' can not be parsed into a number!');
for (var _len2 = arguments.length, elements = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
elements[_key2 - 3] = arguments[_key2];
}

if (nb === undefined && arguments.length === 2) nb = array.length - startIndex;else if (nb === null || nb === undefined) nb = 0;else if (isNaN(+nb)) throw new Error('argument nb ' + nb + ' can not be parsed into a number!');
nb = Math.max(0, nb);

// Solving startIndex
Expand All @@ -2591,11 +2595,6 @@ function splice(array, startIndex, nb) {
});

// Positive index

for (var _len2 = arguments.length, elements = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
elements[_key2 - 3] = arguments[_key2];
}

if (startIndex >= 0) return array.slice(0, startIndex).concat(elements).concat(array.slice(startIndex + nb));

// Negative index
Expand Down Expand Up @@ -3017,7 +3016,7 @@ type.primitive = function (target) {
*/
type.splicer = function (target) {
if (!type.array(target) || target.length < 1) return false;
if (target.length > 1 && Number.isNaN(Number.parseInt(target[1], 10))) return false;
if (target.length > 1 && isNaN(+target[1])) return false;

return anyOf(target[0], ['number', 'function', 'object']);
};
Expand Down
6 changes: 3 additions & 3 deletions build/baobab.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "baobab",
"version": "2.4.2",
"version": "2.4.3",
"description": "JavaScript persistent data tree with cursors.",
"main": "./dist/baobab.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/baobab.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,4 +591,4 @@ Baobab.helpers = helpers;
/**
* Version
*/
Baobab.VERSION = '2.4.2';
Baobab.VERSION = '2.4.3';

0 comments on commit 4833e50

Please sign in to comment.