mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
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:
@@ -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;
|
||||
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user