Move stream-related uri helpers to hash_util.

This allows several modules to no longer need
to import `narrow` (or, in our current pre-import
world, to not have to use that global).

The broken dependencies are reflected in the node
tests, which should now run slightly faster.
This commit is contained in:
Steve Howell
2018-08-04 14:19:38 +00:00
committed by Tim Abbott
parent a4c2971b1e
commit ab26e27fef
9 changed files with 17 additions and 18 deletions

View File

@@ -55,6 +55,16 @@ exports.decode_operand = function (operator, operand) {
return operand;
};
exports.by_stream_uri = function (stream) {
return "#narrow/stream/" + exports.encode_stream_name(stream);
};
exports.by_stream_subject_uri = function (stream, subject) {
return "#narrow/stream/" + exports.encode_stream_name(stream) +
"/subject/" + exports.encodeHashComponent(subject);
};
return exports;
}());