diff --git a/index.js b/index.js index ab0ae1e7..19d689db 100644 --- a/index.js +++ b/index.js @@ -353,7 +353,8 @@ const createClient = (profile, userAgent, opt = {}) => { if (!Array.isArray(res.locL)) return [] const ctx = {profile, opt, common, res} - return res.locL.map(loc => profile.parseNearby(ctx, loc)) + const results = res.locL.map(loc => profile.parseNearby(ctx, loc)) + return Number.isInteger(opt.results) ? results.slice(0, opt.results) : results }) }