code: function checkLimit (limit, keys) {
    if (limit && typeof limit === 'string') limit = +limit;
    if (!limit || Number(limit) !== limit || limit % 1 !== 0 ||
        limit > keys.length)
      limit = keys.length;
    if (limit < 0) limit = 0;
    return limit;
  }
docs: Check that the limit parameter is withing range, or set defaults