Comparing version 0.3.0 to 0.4.0
56
index.js
"use strict"; | ||
var _inherits = function (child, parent) { | ||
child.prototype = Object.create(parent && parent.prototype, { | ||
constructor: { | ||
value: child, | ||
enumerable: false, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
if (parent) child.__proto__ = parent; | ||
}; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var Arey = (function () { | ||
var _Array = Array; | ||
var Arey = function Arey(size) { | ||
_Array.call(this, size); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Arey = exports.Arey = (function (_Array) { | ||
_inherits(Arey, _Array); | ||
return Arey; | ||
})(); | ||
function Arey(size) { | ||
_classCallCheck(this, Arey); | ||
exports.Arey = Arey; | ||
return _possibleConstructorReturn(this, Object.getPrototypeOf(Arey).call(this, size)); | ||
} | ||
_createClass(Arey, null, [{ | ||
key: 'of', | ||
value: function of() { | ||
var _slice; | ||
Arey.of = function () { | ||
return [].slice.call(arguments); | ||
}; | ||
return (_slice = this.slice).call.apply(_slice, arguments); | ||
} | ||
}, { | ||
key: 'isArray', | ||
value: function isArray(arr) { | ||
// Array.isArray(arr) is false :/ | ||
return arr.constructor.name === 'Arey' || Object.prototype.toString.call(arr) === '[object Array]'; | ||
} | ||
}]); | ||
Arey.isArray = function (arr) { | ||
// Array.isArray(arr) is false :/ | ||
return arr.constructor.name === "Arey" || Object.prototype.toString.call(arr) === "[object Array]"; | ||
}; | ||
return Arey; | ||
})(Array); | ||
{ | ||
"name": "arey", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Experimental module that uses ES6 classes to extend `Array`", | ||
"main": "index.js", | ||
"scripts": { | ||
"prepublish": "6to5 index-es6.js > index.js" | ||
"prepublish": "babel index-es6.js > index.js" | ||
}, | ||
@@ -28,4 +28,5 @@ "repository": { | ||
"devDependencies": { | ||
"6to5": "^2.5.0" | ||
"babel-cli": "^6.3.17", | ||
"babel-preset-es2015": "^6.3.13" | ||
} | ||
} |
3121
31
2