Adding moment to js execution

This commit is contained in:
Satbir 2019-12-17 18:07:12 +05:30
parent cf5fcfe9c6
commit b6e7a5758a

View File

@ -1,4 +1,5 @@
import RealmExecutor from "./RealmExecutor";
import moment from "moment-timezone";
export type JSExecutorGlobal = Record<string, object>;
export interface JSExecutor {
@ -41,6 +42,7 @@ class JSExecutionManager {
this.currentExecutor = realmExecutor;
this.registerLibrary("_", window._);
this.registerLibrary("moment", moment);
}
evaluateSync(jsSrc: string, data: JSExecutorGlobal) {
return this.currentExecutor.execute(jsSrc, data);