File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { TextEditor, Grammar } from "atom";
2
2
import * as path from "path" ;
3
3
import { promises } from "fs" ;
4
4
const { readFile } = promises ;
5
- import _ from "lodash" ;
6
5
import type { HydrogenCellType } from "./hydrogen" ;
7
6
8
7
import { remote } from "electron" ;
@@ -42,7 +41,7 @@ export function ipynbOpener(uri: string) {
42
41
*/
43
42
export function importNotebook ( event ?: CustomEvent ) {
44
43
// Use selected filepath if called from tree-view context menu
45
- const filenameFromTreeView = _ . get ( event , " target.dataset.path" ) ;
44
+ const filenameFromTreeView = event . target . dataset ? .path ;
46
45
47
46
if ( filenameFromTreeView && path . extname ( filenameFromTreeView ) === ".ipynb" ) {
48
47
return _loadNotebook (
@@ -265,8 +264,8 @@ function getGrammarForFileExtension(ext: string): Grammar | null | undefined {
265
264
}
266
265
ext = ext . startsWith ( "." ) ? ext . slice ( 1 ) : ext ;
267
266
const grammars = atom . grammars . getGrammars ( ) ;
268
- return _ . find ( grammars , ( grammar ) => {
269
- return _ . includes ( grammar . fileTypes , ext ) ;
267
+ return grammars . find ( ( grammar ) => {
268
+ return grammar . fileTypes . includes ( ext ) ;
270
269
} ) ;
271
270
}
272
271
You can’t perform that action at this time.
0 commit comments