Skip to content

Commit 544626d

Browse files
committed
jslint fixes
1 parent b182ee0 commit 544626d

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

lib/AppContext.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ export default class AppContext {
14461446
// Changes may include any key slots (not just foreign keys), but other
14471447
// slots are ignored.
14481448
let changed_keys = Object.fromEntries(Object.entries(key_vals)
1449-
.filter(([slot_name]) => changes.hasOwnProperty(slot_name))
1449+
.filter(([slot_name]) => Object.prototype.hasOwnProperty.call(changes, slot_name))
14501450
.map(([slot_name]) => ([slot_name, changes[slot_name].value]))
14511451
);
14521452

@@ -1519,7 +1519,7 @@ export default class AppContext {
15191519
// For all dependents, changes if any come from parent table(s).
15201520
// Parent field names are different though - via relations!
15211521
let parent_slot_name = key_mapping.foreign_slot;
1522-
if (parent_changes.hasOwnProperty(parent_slot_name)) {
1522+
if (Object.prototype.hasOwnProperty.call(parent_changes, parent_slot_name)) {
15231523
changed_dep_keys[slot_name] = parent_changes[parent_slot_name];
15241524
}
15251525
}

lib/Toolbar.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import 'bootstrap/js/dist/dropdown';
1616
import 'bootstrap/js/dist/modal';
1717
import '@selectize/selectize';
1818
import '@selectize/selectize/dist/css/selectize.bootstrap4.css';
19-
const nestedProperty = require('nested-property');
19+
import nestedProperty from 'nested-property';
2020
import {isEmpty, deleteEmptyKeyVals, isEmptyUnitVal, setJSON} from '../lib/utils/general';
2121
import YAML from 'yaml';
2222
import {
@@ -517,7 +517,7 @@ class Toolbar {
517517
if (!this.file_extensions.includes(ext)) {
518518
this.showError(
519519
'open',
520-
`Only ${acceptedExts.join(', ')} files are supported`
520+
`Only ${this.file_extensions.join(', ')} files are supported`
521521
);
522522
return;
523523
}
@@ -570,7 +570,6 @@ class Toolbar {
570570
}
571571
catch (error) {
572572
throw new Error('Invalid JSON data', error);
573-
return false;
574573
}
575574

576575
// Validate whether data file has minimum necessary Schema components.
@@ -676,7 +675,6 @@ class Toolbar {
676675
}
677676
catch (error) {
678677
throw new Error('Invalid spreadsheet data', error);
679-
return false;
680678
}
681679

682680
// First construct a set of data tables from input file's perspective
@@ -1017,9 +1015,10 @@ class Toolbar {
10171015
if (isEmpty(value_list))
10181016
return value;
10191017

1020-
if (!(value in value_list))
1018+
if (!(value in value_list)) {
10211019
console.warn(`${value} not in slot.sources`, value_list);
10221020
return value;
1021+
}
10231022

10241023
if (file_extension === 'json')
10251024
return value; // Why this case?

0 commit comments

Comments
 (0)