Skip to content

Commit 37d2a39

Browse files
chrisbobbegnprice
authored andcommitted
internalLinks [nfc]: Comment on stream-operand parser needing stream data
1 parent 6eaabeb commit 37d2a39

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils/internalLinks.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export const decodeHashComponent = (string: string): string => {
7070
*
7171
* Return null if the operand doesn't match any known stream.
7272
*/
73+
// Why does this parser need stream data? Because the operand formats
74+
// ("new" and "old") collide, and in choosing which format to apply, we
75+
// want to know if one or the other would give a real stream we know
76+
// about. Also, we can't get a stream ID from an "old"-format operand
77+
// without a mapping from stream names to IDs.
7378
const parseStreamOperand = (operand, streamsById, streamsByName): null | number => {
7479
// "New" (2018) format: ${stream_id}-${stream_name} .
7580
const match = /^([\d]+)(?:-.*)?$/.exec(operand);

0 commit comments

Comments
 (0)