Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

numjs

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

numjs - npm Package Compare versions

Comparing version 0.12.0 to 0.12.1

2

gruntfile.js

@@ -98,4 +98,4 @@ 'use strict';

grunt.registerTask('test', ['simplemocha:full', 'browserify', 'karma:dist', 'uglify', 'karma:min']);
grunt.registerTask('travis', ['exec:test-semistandard', 'simplemocha:full', 'karma:dist', 'karma:min']);
grunt.registerTask('travis', ['simplemocha:full', 'karma:dist', 'karma:min']);
grunt.registerTask('doc', ['jsdoc', 'gh-pages']);
};
{
"name": "numjs",
"version": "0.12.0",
"version": "0.12.1",
"description": "Like NumPy, in JavaScript",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -232,4 +232,4 @@ 'use strict';

* Gives a new shape to the array without changing its data.
* @param {Array} shape
* @returns {NdArray}
* @param {Array|number} The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.
* @returns {NdArray} a new view object if possible, a copy otherwise,
*/

@@ -240,2 +240,5 @@ NdArray.prototype.reshape = function (shape) {

}
if (arguments.length === 1 && _.isNumber(shape) && shape === -1) {
shape = [_.shapeSize(this.shape)];
}
if (arguments.length === 1 && _.isNumber(shape)) {

@@ -247,2 +250,7 @@ shape = [shape];

}
if (shape.filter(function (s) { return s === -1; }).length > 1) {
throw new errors.ValueError('can only specify one unknown dimension');
}
var currentShapeSize = _.shapeSize(shape);
shape = shape.map(function (s) { return s === -1 ? -1 * this.size / currentShapeSize : s; }.bind(this));
if (this.size !== _.shapeSize(shape)) {

@@ -249,0 +257,0 @@ throw new errors.ValueError('total size of new array must be unchanged');

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