diff --git a/.all-contributorsrc b/.all-contributorsrc index 01948560b..38bcc285f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -343,6 +343,16 @@ "contributions": [ "bug" ] + }, + { + "login": "wayfarer3130", + "name": "Bill Wallace", + "avatar_url": "https://avatars.githubusercontent.com/u/27778909?v=4", + "profile": "https://github.com/wayfarer3130", + "contributions": [ + "code", + "doc" + ] } ], "contributorsPerLine": 7 diff --git a/README.md b/README.md index f066fbc14..a3d60ea8f 100755 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![Build Status][build-badge]][build] [![Coverage Status][coverage-badge]][coverage] -[![All Contributors](https://img.shields.io/badge/all_contributors-34-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-35-orange.svg?style=flat-square)](#contributors) [![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] @@ -164,7 +164,7 @@ Thanks goes to these people ([emoji key][emojis]): | [Gustavo AndrΓ© Lelis
Gustavo AndrΓ© Lelis](https://github.com/galelis)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=galelis "Code") | [Kofifus
Kofifus](https://github.com/kofifus)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=kofifus "Code") [πŸ”§](#tool-kofifus "Tools") [πŸ›](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3Akofifus "Bug reports") | [AloΓ―s Dreyfus
AloΓ―s Dreyfus](http://www.linkedin.com/in/alois-dreyfus/)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=adreyfus "Code") | [Tim Leslie
Tim Leslie](http://www.timl.id.au)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=timleslie "Code") | [diego0020
diego0020](https://github.com/diego0020)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=diego0020 "Code") | [Evren Ozkan
Evren Ozkan](https://github.com/evren217)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=evren217 "Code") | [Salvador Daniel Pelayo
Salvador Daniel Pelayo](https://github.com/daniel2101)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=daniel2101 "Code") | | [Juan Narvaez
Juan Narvaez](https://github.com/jdnarvaez)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=jdnarvaez "Code") | [Mike
Mike](https://github.com/mikehazell)
[πŸ“–](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mikehazell "Documentation") [πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mikehazell "Code") [⚠️](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mikehazell "Tests") | [Sangkeun Kim
Sangkeun Kim](http://sisobus.com)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=sisobus "Code") [πŸ’¬](#question-sisobus "Answering Questions") | [Victor Saase
Victor Saase](https://github.com/vsaase)
[πŸ€”](#ideas-vsaase "Ideas, Planning, & Feedback") | [Michael Wasser
Michael Wasser](http://www.mikewasser.com)
[πŸ“–](https://github.com/cornerstonejs/cornerstoneTools/commits?author=untoldone "Documentation") | [Amandeep Singh
Amandeep Singh](https://github.com/singhArmani)
[πŸ–‹](#content-singhArmani "Content") | [Madison Dickson
Madison Dickson](http://mix3dstudios.com)
[πŸ“–](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mix3d "Documentation") | | [Kevin Lee Drum
Kevin Lee Drum](https://github.com/kevinleedrum)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=kevinleedrum "Code") | [Makarand Bauskar
Makarand Bauskar](https://github.com/mmbauskar)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mbauskar "Code") | [Biharck Araujo
Biharck Araujo](http://www.biharck.com.br)
[πŸ’‘](#example-biharck "Examples") [πŸ“–](https://github.com/cornerstonejs/cornerstoneTools/commits?author=biharck "Documentation") | [Devon Bernard
Devon Bernard](https://www.linkedin.com/in/devonbernard)
[πŸ“–](https://github.com/cornerstonejs/cornerstoneTools/commits?author=DevonBernard "Documentation") | [Karl-Heinrich
Karl-Heinrich](https://github.com/Karl-Heinrich)
[πŸ›](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3AKarl-Heinrich "Bug reports") [πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Karl-Heinrich "Code") [⚠️](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Karl-Heinrich "Tests") | [counterxing
counterxing](https://blog.xingbofeng.com/)
[πŸ›](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3Axingbofeng "Bug reports") [πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=xingbofeng "Code") | [Jorge Lopes
Jorge Lopes](https://github.com/jlopes90)
[πŸ’¬](#question-jlopes90 "Answering Questions") | -| [Gabriel Garrido
Gabriel Garrido](http://garrido.io)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Ggpsv "Code") | [ASVBPREAUBV
ASVBPREAUBV](https://github.com/ASVBPREAUBV)
[πŸ“–](https://github.com/cornerstonejs/cornerstoneTools/commits?author=ASVBPREAUBV "Documentation") | [frolic06
frolic06](https://github.com/frolic06)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=frolic06 "Code") | [codepage949
codepage949](https://github.com/codepage949)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=codepage949 "Code") | [Asherah Connor
Asherah Connor](https://kivikakk.ee)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=kivikakk "Code") | [Ikko Ashimine
Ikko Ashimine](https://bandism.net/)
[πŸ›](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3Aeltociear "Bug reports") | +| [Gabriel Garrido
Gabriel Garrido](http://garrido.io)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Ggpsv "Code") | [ASVBPREAUBV
ASVBPREAUBV](https://github.com/ASVBPREAUBV)
[πŸ“–](https://github.com/cornerstonejs/cornerstoneTools/commits?author=ASVBPREAUBV "Documentation") | [frolic06
frolic06](https://github.com/frolic06)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=frolic06 "Code") | [codepage949
codepage949](https://github.com/codepage949)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=codepage949 "Code") | [Asherah Connor
Asherah Connor](https://kivikakk.ee)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=kivikakk "Code") | [Ikko Ashimine
Ikko Ashimine](https://bandism.net/)
[πŸ›](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3Aeltociear "Bug reports") | [Bill Wallace
Bill Wallace](https://github.com/wayfarer3130)
[πŸ’»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=wayfarer3130 "Code") [πŸ“–](https://github.com/cornerstonejs/cornerstoneTools/commits?author=wayfarer3130 "Documentation") | This project follows the [all-contributors][all-contributors] specification. diff --git a/src/stackTools/stackPrefetch.js b/src/stackTools/stackPrefetch.js index ebab9df84..44188948b 100755 --- a/src/stackTools/stackPrefetch.js +++ b/src/stackTools/stackPrefetch.js @@ -40,32 +40,20 @@ function range(lowEnd, highEnd) { return arr; } -const max = function(arr) { - return Math.max.apply(null, arr); -}; - -const min = function(arr) { - return Math.min.apply(null, arr); -}; - function nearestIndex(arr, x) { // Return index of nearest values in array // http://stackoverflow.com/questions/25854212/return-index-of-nearest-values-in-an-array - const l = []; - const h = []; - - arr.forEach(function(v) { + let low = 0; + let high = arr.length - 1; + arr.forEach((v, idx) => { if (v < x) { - l.push(v); + low = Math.max(idx, low); } else if (v > x) { - h.push(v); + high = Math.min(idx, high); } }); - return { - low: arr.indexOf(max(l)), - high: arr.indexOf(min(h)), - }; + return { low, high }; } function prefetch(element) { diff --git a/src/util/uuidv4.js b/src/util/uuidv4.js index aa9d2f7ce..19ddd7433 100644 --- a/src/util/uuidv4.js +++ b/src/util/uuidv4.js @@ -1,7 +1,7 @@ export default function uuidv4() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { - let r = (Math.random() * 16) | 0, - v = c == 'x' ? r : (r & 0x3) | 0x8; + const r = (Math.random() * 16) | 0; // eslint-disable-line no-bitwise + const v = c === 'x' ? r : (r & 0x3) | 0x8; // eslint-disable-line no-bitwise return v.toString(16); });