From 789fb4f7e54b9f45b2287446cd2866e3effc94e7 Mon Sep 17 00:00:00 2001 From: Dave Eddy Date: Fri, 4 Sep 2015 20:33:31 -0400 Subject: [PATCH] slug asserts --- lib/common.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/common.js b/lib/common.js index 8732322..0aaf85a 100644 --- a/lib/common.js +++ b/lib/common.js @@ -321,6 +321,10 @@ function normShortId(s) { * to use for caching */ function slug(o) { + assert.object(o, 'o'); + assert.string(o.account, 'o.account'); + assert.string(o.url, 'o.url'); + var acct = o.account.replace(/[@]/g, '_'); var url = o.url.replace(/^https?:\/\//, ''); var s = format('%s@%s', acct, url).replace(/[!#$%\^&\*:'"\?\/\\\.]/g, '_');