Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onSourceClick = () => {
const manager = getCurrentManager();
if (manager) {
const tModule = manager.resolveTranspiledModule(
sourceFileName.replace(location.origin, ''),
'/'
);
dispatch(
actions.editor.openModule(
// A module has a parent when it has been generated by a module,
// Vue is an example of this: SFC's generate submodules
tModule.module.parent
? tModule.module.parent.path
: tModule.module.path,
window.encodeURIComponent(sourceLineNumber || 1)
)
);
}
};
}
onSourceClick = () => {
const manager = getCurrentManager();
if (manager) {
const tModule = manager.resolveTranspiledModule(
sourceFileName.replace(location.origin, '').replace('file://', ''),
'/'
);
dispatch(
actions.editor.openModule(
// A module has a parent when it has been generated by a module,
// Vue is an example of this: SFC's generate submodules
tModule.module.parent
? tModule.module.parent.path
: tModule.module.path,
window.encodeURIComponent(sourceLineNumber || 1)
)
);
}
};
}
onClick={e => {
e.stopPropagation();
dispatch(actions.editor.openModule(file));
}}
/>
open() {
this.isCodeSandbox
? dispatch(actions.editor.openModule(this.url))
: window.open(this.url, '_github')
},
}
open() {
dispatch(actions.editor.openModule(this.url));
},
}
function viewElementSourceFunction(id: string, data: any) {
const { source } = data;
if (source) {
dispatch(actions.editor.openModule(source.fileName, source.lineNumber));
}
}
openFile = (path: string) => {
dispatch(actions.editor.openModule(path));
};