loadModule method

dynamic loadModule(
  1. String filepath,
  2. String filename
)

Implementation

dynamic loadModule(String filepath, String filename) {
  String? path = fileSystems.findPath(filepath, filename);
  if (path != null) {
    if (_requireCache.containsKey(path)) {
      return _requireCache[path];
    } else {
      String? code = fileSystems.loadCode(path);
      if (code != null) {
        return _requireCache[path] = runModule(code, path);
      }
    }
  }
  return js.JsObject.jsify({});
}