Comparing version 1.2.0 to 1.2.1
@@ -0,1 +1,11 @@ | ||
<a name="1.2.1"></a> | ||
## [1.2.1](https://github.com/mljs/matrix/compare/v1.2.0...v1.2.1) (2016-07-07) | ||
### Bug Fixes | ||
* do not use rest parameters ([2c4502e](https://github.com/mljs/matrix/commit/2c4502e)) | ||
<a name="1.2.0"></a> | ||
@@ -2,0 +12,0 @@ # [1.2.0](https://github.com/mljs/matrix/compare/v1.1.5...v1.2.0) (2016-07-07) |
{ | ||
"name": "ml-matrix", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Matrix manipulation and computation library", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -1341,6 +1341,6 @@ 'use strict'; | ||
var inplaceMethodWithArgs = ` | ||
(function %name%(...args) { | ||
(function %name%(%args%) { | ||
for (var i = 0; i < this.rows; i++) { | ||
for (var j = 0; j < this.columns; j++) { | ||
this[i][j] = %method%(this[i][j], ...args); | ||
this[i][j] = %method%(this[i][j], %args%); | ||
} | ||
@@ -1353,5 +1353,5 @@ } | ||
var staticMethodWithArgs = ` | ||
(function %name%(matrix, ...args) { | ||
(function %name%(matrix, %args%) { | ||
var newMatrix = new Matrix(matrix); | ||
return newMatrix.%name%(...args); | ||
return newMatrix.%name%(%args%); | ||
}) | ||
@@ -1411,9 +1411,13 @@ `; | ||
var methodsWithArgs = [ | ||
['Math.pow', 'pow'] | ||
['Math.pow', 1, 'pow'] | ||
]; | ||
for (var methodWithArg of methodsWithArgs) { | ||
var inplaceMethWithArgs = eval(fillTemplateFunction(inplaceMethodWithArgs, {name: methodWithArg[1], method: methodWithArg[0]})); | ||
var staticMethWithArgs = eval(fillTemplateFunction(staticMethodWithArgs, {name: methodWithArg[1]})); | ||
for (var i = 1; i < methodWithArg.length; i++) { | ||
var args = 'arg0'; | ||
for (var i = 1; i < methodWithArg[1]; i++) { | ||
args += `, arg${i}`; | ||
} | ||
var inplaceMethWithArgs = eval(fillTemplateFunction(inplaceMethodWithArgs, {name: methodWithArg[2], method: methodWithArg[0], args: args})); | ||
var staticMethWithArgs = eval(fillTemplateFunction(staticMethodWithArgs, {name: methodWithArg[2], args: args})); | ||
for (var i = 2; i < methodWithArg.length; i++) { | ||
Matrix.prototype[methodWithArg[i]] = inplaceMethWithArgs; | ||
@@ -1420,0 +1424,0 @@ Matrix[methodWithArg[i]] = staticMethWithArgs; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96417
2913