get reid of mathjs dependency. not sure why i was using that evaluate function...

This commit is contained in:
Jason Wall 2020-08-06 16:41:07 -04:00
parent d7aa1e879e
commit b1014aae7d
3 changed files with 5 additions and 56 deletions

View File

@ -3542,11 +3542,6 @@
}
}
},
"complex.js": {
"version": "2.0.11",
"resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.0.11.tgz",
"integrity": "sha512-6IArJLApNtdg1P1dFtn3dnyzoZBEF0MwMnrfF1exSBRpZYoy4yieMkpZhQDC0uwctw48vii0CFVyHfpgZ/DfGw=="
},
"component": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/component/-/component-1.1.0.tgz",
@ -5522,11 +5517,6 @@
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=",
"dev": true
},
"escape-latex": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz",
"integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw=="
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
@ -6196,11 +6186,6 @@
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
"dev": true
},
"fraction.js": {
"version": "4.0.12",
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.12.tgz",
"integrity": "sha512-8Z1K0VTG4hzYY7kA/1sj4/r1/RWLBD3xwReT/RCrUCbzPszjNQCCsy3ktkU/eaEqX3MYa4pY37a52eiBlPMlhA=="
},
"fragment-cache": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
@ -7734,11 +7719,6 @@
"integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=",
"dev": true
},
"javascript-natural-sort": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
"integrity": "sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k="
},
"jest-worker": {
"version": "26.0.0",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.0.0.tgz",
@ -8510,21 +8490,6 @@
"resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz",
"integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg=="
},
"mathjs": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/mathjs/-/mathjs-7.1.0.tgz",
"integrity": "sha512-Km6PO2UR+COs5mru5auKQKi84GKBryuL5JDdKeAxAi0QV8mH/qwpZKLnzrycxBacQ/X/4Z4Kn+gtYc5gEeWsDQ==",
"requires": {
"complex.js": "^2.0.11",
"decimal.js": "^10.2.0",
"escape-latex": "^1.2.0",
"fraction.js": "^4.0.12",
"javascript-natural-sort": "^0.7.1",
"seed-random": "^2.2.0",
"tiny-emitter": "^2.1.0",
"typed-function": "^2.0.0"
}
},
"md5.js": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
@ -12116,11 +12081,6 @@
"ajv-keywords": "^3.4.1"
}
},
"seed-random": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz",
"integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ="
},
"select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
@ -13528,7 +13488,8 @@
"tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
"optional": true
},
"tiny-lr-fork": {
"version": "0.0.5",
@ -13799,11 +13760,6 @@
"mime-types": "~2.1.24"
}
},
"typed-function": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/typed-function/-/typed-function-2.0.0.tgz",
"integrity": "sha512-Hhy1Iwo/e4AtLZNK10ewVVcP2UEs408DS35ubP825w/YgSBK1KVLwALvvIG4yX75QJrxjCpcWkzkVRB0BwwYlA=="
},
"typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",

View File

@ -25,7 +25,6 @@
"@types/mathjs": "^6.0.5",
"angular2-uuid": "^1.1.1",
"component": "^1.1.0",
"mathjs": "^7.0.2",
"ngx-md": "^8.1.6",
"redux": "^4.0.5",
"reselect": "^4.0.0",

View File

@ -25,7 +25,6 @@ import {
import { Section, BibleReference } from '../common/bible-reference';
import { PageTitles, PageIcons } from '../constants';
import { createStateService } from '../common/state-service';
import * as math from 'mathjs';
import { UUID } from 'angular2-uuid';
import { StorageMap } from '@ngx-pwa/local-storage';
@ -750,16 +749,11 @@ export class AppService extends createStateService(reducer, initialState) {
if (j === 0) {
if (section.start.verse.indexOf('*') !== -1) {
// you sometimes use this as a shortcut to the last verse
// replace the * with the last verse, then eval the expression.
section.start.verse = section.start.verse.replace(
'*',
chapters[j].vss.length.toString()
);
start = math.evaluate(section.start.verse);
// replace the * with the last verse
// e.g jn 1:* - 3:4
// update the section and the ref.
section.start.verse = start.toString();
section.start.verse = chapters[j].vss.length.toString();
result.ref = BibleReference.toString(section);
} else {
start = parseInt(section.start.verse, 10);