ssbc / ssb-ref

check if a string is a valid ssb-reference
MIT License
14 stars 10 forks source link

Fix normalizeChannel() #43

Closed christianbundy closed 4 years ago

christianbundy commented 4 years ago

Any time the constraints of normalizeChannel() are violated it returns undefined, which is rarely what we want.

This commit changes the behavior so that channels that can't be normalized return null, and channels that are too long become truncated. This should lower the prevelance of #undefined in user-facing applications.

See-also: https://github.com/ssb-js/ssb-ref/pull/33

arj03 commented 4 years ago

Sweet!