Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
GitanjaliChhetri committed Jan 30, 2023
1 parent 7db7807 commit 5bf7586
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
]
},
"scripts": {
"test": "standard 'src/*.js' && jest --silent",
"test": "standard \"src/**/*.js\" && jest --silent",
"build": "npm run webpack:bundle && npm run webpack:dynamic-import",
"prepublishOnly": "npm run build",
"generateStaticSite": "npm run build && cp -R ./dist ./examples",
"generateDocs": "jsdoc -c ./jsdoc_conf.json",
"fmt": "standard 'src/**/.js' --fix",
"lint": "standard 'src/**/*.js'",
"lint": "standard \"src/**/*.js\"",
"clean": "rm -rf ./dist ./node_modules",
"webpack:dynamic-import": "webpack --progress --config ./config/webpack/webpack-dynamic-import",
"webpack:bundle": "webpack --progress --config ./config/webpack/webpack-bundle",
Expand Down
14 changes: 7 additions & 7 deletions src/customError.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const errorTypes = {
VISUALIZATION: 'Visualization',
ENCODINGANDDECODING: 'Encoding/Decoding'
VISUALIZATION: 'Visualization',
ENCODINGANDDECODING: 'Encoding/Decoding'
}

class CustomError extends Error {
constructor(type, message) {
super();
this.message = message;
this.stack = new Error().stack;
constructor (type, message) {
super()
this.message = message
this.stack = new Error().stack
this.type = type
}
}

export {errorTypes, CustomError};
export { errorTypes, CustomError }
21 changes: 10 additions & 11 deletions src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { ZoomSlider, Zoom } from 'ol/control'
import { getCenter, getHeight, getWidth } from 'ol/extent'
import { defaults as defaultInteractions } from 'ol/interaction'
import dcmjs from 'dcmjs'
import {CustomError, errorTypes} from './customerror'
import { CustomError, errorTypes } from './customerror'

import {
AnnotationGroup,
Expand Down Expand Up @@ -726,7 +726,7 @@ const _updateOverviewMapSize = Symbol('updateOverviewMapSize')
class VolumeImageViewer {
/**
* Callback for intercepting errors.
*
*
* @callback errorInterceptor
* @param {CustomError} error - Error instance
*/
Expand Down Expand Up @@ -762,7 +762,7 @@ class VolumeImageViewer {
constructor (options) {
this[_options] = options

if(this[_options].errorInterceptor == null) {
if (this[_options].errorInterceptor == null) {
this[_options].errorInterceptor = error => {
throw error
}
Expand Down Expand Up @@ -4794,11 +4794,10 @@ class _NonVolumeImageViewer {
* should be included for correction of image colors.
*/
constructor (options) {

if(options.errorInterceptor == null){
options.errorInterceptor = error => {throw error}
if (options.errorInterceptor == null) {
options.errorInterceptor = error => { throw error }
}

// We also accept metadata in raw JSON format for backwards compatibility
if (options.metadata.SOPClassUID != null) {
this[_metadata] = options.metadata
Expand Down Expand Up @@ -4997,8 +4996,8 @@ class OverviewImageViewer extends _NonVolumeImageViewer {
* should be included for correction of image colors.
*/
constructor (options) {
if(options.errorInterceptor == null){
options.errorInterceptor = error => {throw error}
if (options.errorInterceptor == null) {
options.errorInterceptor = error => { throw error }
}

if (options.orientation === undefined) {
Expand Down Expand Up @@ -5029,8 +5028,8 @@ class LabelImageViewer extends _NonVolumeImageViewer {
* should be included for correction of image colors
*/
constructor (options) {
if(options.errorInterceptor == null){
options.errorInterceptor = error => {throw error}
if (options.errorInterceptor == null) {
options.errorInterceptor = error => { throw error }
}

if (options.orientation === undefined) {
Expand Down

0 comments on commit 5bf7586

Please sign in to comment.