You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
fixed tests
This commit is contained in:
@ -12,51 +12,15 @@ import Joplin from './Joplin';
|
||||
export default class Global {
|
||||
|
||||
private joplin_: Joplin;
|
||||
// private requireWhiteList_: string[] = null;
|
||||
// private consoleWrapper_:any = null;
|
||||
|
||||
constructor(implementation: any, plugin: Plugin, store: any) {
|
||||
this.joplin_ = new Joplin(implementation.joplin, plugin, store);
|
||||
// this.consoleWrapper_ = this.createConsoleWrapper(plugin.id);
|
||||
this.joplin_ = new Joplin(implementation, plugin, store);
|
||||
}
|
||||
|
||||
// Wraps console calls to allow prefixing them with "Plugin PLUGIN_ID:"
|
||||
// private createConsoleWrapper(pluginId:string) {
|
||||
// const wrapper:any = {};
|
||||
|
||||
// for (const n in console) {
|
||||
// if (!console.hasOwnProperty(n)) continue;
|
||||
// wrapper[n] = (...args:any[]) => {
|
||||
// const newArgs = args.slice();
|
||||
// newArgs.splice(0, 0, `Plugin "${pluginId}":`);
|
||||
// return (console as any)[n](...newArgs);
|
||||
// };
|
||||
// }
|
||||
|
||||
// return wrapper;
|
||||
// }
|
||||
|
||||
get joplin(): Joplin {
|
||||
return this.joplin_;
|
||||
}
|
||||
|
||||
// private requireWhiteList(): string[] {
|
||||
// if (!this.requireWhiteList_) {
|
||||
// this.requireWhiteList_ = builtinModules.slice();
|
||||
// this.requireWhiteList_.push('fs-extra');
|
||||
// }
|
||||
// return this.requireWhiteList_;
|
||||
// }
|
||||
|
||||
// get console(): any {
|
||||
// return this.consoleWrapper_;
|
||||
// }
|
||||
|
||||
// require(filePath: string): any {
|
||||
// if (!this.requireWhiteList().includes(filePath)) throw new Error(`Path not allowed: ${filePath}`);
|
||||
// return require(filePath);
|
||||
// }
|
||||
|
||||
// To get webpack to work with Node module we need to set the parameter `target: "node"`, however
|
||||
// when setting this, the code generated by webpack will try to access the `process` global variable,
|
||||
// which won't be defined in the sandbox. So here we simply forward the variable, which makes it all work.
|
||||
@ -64,24 +28,4 @@ export default class Global {
|
||||
return process;
|
||||
}
|
||||
|
||||
// setTimeout(fn: Function, interval: number) {
|
||||
// return shim.setTimeout(() => {
|
||||
// fn();
|
||||
// }, interval);
|
||||
// }
|
||||
|
||||
// setInterval(fn: Function, interval: number) {
|
||||
// return shim.setInterval(() => {
|
||||
// fn();
|
||||
// }, interval);
|
||||
// }
|
||||
|
||||
// alert(message:string) {
|
||||
// return alert(message);
|
||||
// }
|
||||
|
||||
// confirm(message:string) {
|
||||
// return confirm(message);
|
||||
// }
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user