UNPKG

rdf-dataset-fragmenter

Version:
19 lines 695 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ValueModifierRegexReplaceGroup = void 0; const rdf_data_factory_1 = require("rdf-data-factory"); const DF = new rdf_data_factory_1.DataFactory(); /** * A value modifier that applies the given regex on the value and replaces it with the first group match. */ class ValueModifierRegexReplaceGroup { regex; constructor(regex) { this.regex = new RegExp(regex, 'u'); } apply(value) { return DF.literal(value.value.replace(this.regex, '$1')); } } exports.ValueModifierRegexReplaceGroup = ValueModifierRegexReplaceGroup; //# sourceMappingURL=ValueModifierRegexReplaceGroup.js.map