dijs / wiki

Wikipedia Interface for Node.js
MIT License
313 stars 62 forks source link

Adding API options to `findById` #60

Closed kper closed 6 years ago

kper commented 6 years ago

The function findById did not return the same object like page. The API options must be the same for consistency.

Before:

{ raw: { pageid: 68187, ns: 0, title: 'FC Barcelona' },
  html: [Function: html],
  content: [Function: content],
  summary: [Function: summary],
  images: [Function: images],
  references: [Function: references],
  links: [Function: links],
  categories: [Function: categories],
  coordinates: [Function: coordinates],
  info: [Function: q],
  backlinks: [Function: backlinks],
  rawImages: [Function: h],
  mainImage: [Function: mainImage],
  langlinks: [Function: langlinks],
  rawInfo: [Function: p] }

After:

{ raw: 
   { pageid: 68187,
     ns: 0,
     title: 'FC Barcelona',
     contentmodel: 'wikitext',
     pagelanguage: 'en',
     pagelanguagehtmlcode: 'en',
     pagelanguagedir: 'ltr',
     touched: '2017-10-10T06:06:26Z',
     lastrevid: 803940480,
     length: 150109,
     fullurl: 'https://en.wikipedia.org/wiki/FC_Barcelona',
     editurl: 'https://en.wikipedia.org/w/index.php?title=FC_Barcelona&action=edit',
     canonicalurl: 'https://en.wikipedia.org/wiki/FC_Barcelona' },
  html: [Function: html],
  content: [Function: content],
  summary: [Function: summary],
  images: [Function: images],
  references: [Function: references],
  links: [Function: links],
  categories: [Function: categories],
  coordinates: [Function: coordinates],
  info: [Function: q],
  backlinks: [Function: backlinks],
  rawImages: [Function: h],
  mainImage: [Function: mainImage],
  langlinks: [Function: langlinks],
  rawInfo: [Function: p] }
dijs commented 6 years ago

Good call. Can you fix the tests for this?

kper commented 6 years ago

Test should handle Issue #55 failed

kper commented 6 years ago

Can you rerun the CI job?

dijs commented 6 years ago

Running again.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 99.153% when pulling d5ea1f3a831579ff1e7379cd828c0039c1bb27e0 on kper:master into 7003a9a602e83207df0b1297d4c4aa1774b68a8c on dijs:master.

dijs commented 6 years ago

Published in v4.3.1