@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
33 lines • 1.41 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlowrAnalyzerJupyterFilePlugin = void 0;
const semver_1 = require("semver");
const flowr_analyzer_file_plugin_1 = require("../flowr-analyzer-file-plugin");
const built_in_source_1 = require("../../../../dataflow/internal/process/functions/call/built-in/built-in-source");
const flowr_jupyter_file_1 = require("../files/flowr-jupyter-file");
const IpynbPattern = /\.ipynb$/i;
/**
* The plugin provides support for Jupyter (`.ipynb`) files
*/
class FlowrAnalyzerJupyterFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
name = 'ipynb-file-plugin';
description = 'Parses Jupyter files';
version = new semver_1.SemVer('0.1.0');
pattern;
/**
* Creates a new instance of the Jupyter file plugin.
* @param filePattern - The pattern to identify Jupyter files, see {@link IpynbPattern} for the default pattern.
*/
constructor(filePattern = IpynbPattern) {
super();
this.pattern = filePattern;
}
applies(file) {
return this.pattern.test((0, built_in_source_1.platformBasename)(file.toString()));
}
process(_ctx, arg) {
return flowr_jupyter_file_1.FlowrJupyterFile.from(arg);
}
}
exports.FlowrAnalyzerJupyterFilePlugin = FlowrAnalyzerJupyterFilePlugin;
//# sourceMappingURL=flowr-analyzer-jupyter-file-plugin.js.map