canjs / can-util

Essential utilities used by lots of CanJS's projects.
https://canjs.com/doc/can-util.html
MIT License
10 stars 8 forks source link

string.sub returns null when a value is null #396

Closed matthewp closed 6 years ago

matthewp commented 6 years ago
string.sub("/api/games/{id}", {id: undefined}, true);

returns undefined.

matthewp commented 6 years ago

Looks like this is intentional: https://github.com/canjs/can-util/blob/49cf550ec18c4e5d107e9e74cd1d37f10d05003a/js/string/string-test.js#L24