Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private substitute(operation: Algebra.Operation, bindings: Bindings): Algebra.Operation {
return Util.mapOperation(operation, {
path: (op: Algebra.Path, factory: Factory) => {
return {
recurse: false,
result: factory.createPath(
this.substituteSingle(op.subject, bindings),
op.predicate,
this.substituteSingle(op.object, bindings),
this.substituteSingle(op.graph, bindings),
),
};
},
pattern: (op: Algebra.Pattern, factory: Factory) => {
return {
recurse: false,
result: factory.createPattern(
this.substituteSingle(op.subject, bindings),