Fix tests

This commit is contained in:
pawkrol
2018-12-05 12:59:45 +01:00
parent f6e24ebb8e
commit 84f45b6af3
2 changed files with 24 additions and 1 deletions
+6 -1
View File
@@ -2578,7 +2578,8 @@ declare namespace math {
* @param object An object with functions to be imported.
* @param options An object with import options.
*/
import(object: object | Array<object>, options: ImportOptions);
import(object: ImportObject | ImportObject[], options: ImportOptions): void;
// TypeScript Version: 2.4
/**
* It may not exists - this is _only_ for import functionality.
@@ -4561,4 +4562,8 @@ declare namespace math {
silent?: boolean;
wrap?: boolean;
}
interface ImportObject {
[key: string]: any;
}
}
+18
View File
@@ -392,3 +392,21 @@ JSON serialization/deserialization
const parsed = JSON.parse(stringified, math.json.reviver);
parsed.bigNumber === math.bignumber('1.5'); // true
}
/*
Extend functionality with import
*/
{
const testFun = function() {
return 5;
};
math.import({
testFun,
value: 10
}, {});
math.testFun();
const a = math.value * 2;
}