Skip to content

Commit

Permalink
Merge pull request #91 from ArkhamCookie/add-ands
Browse files Browse the repository at this point in the history
Added '&' seperating options for when more than one is used
  • Loading branch information
ArkhamCookie authored Nov 17, 2023
2 parents 4ee4172 + 052d1db commit 14d1b26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/word/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export async function audio(word, {
if (!(typeof useCanonical === 'boolean')) {
throw new Error('"useCanonical" must be a boolean')
}
endpoint = endpoint + 'useCanonical=' + useCanonical
endpoint = endpoint + '&' + 'useCanonical=' + useCanonical
}

if (limit) {
if (!(typeof limit === 'number')) {
throw new Error('"limit" must be a number')
}
endpoint = endpoint + 'limit=' + limit
endpoint = endpoint + '&' + 'limit=' + limit
}

endpoint = endpoint + '&' + wordnik.key
Expand Down
8 changes: 4 additions & 4 deletions lib/word/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@ export async function examples(word, {
if (!(typeof includeDuplicates === 'boolean')) {
throw new Error('"includeDuplicates" must be a boolean')
}
endpoint = endpoint + 'includeDuplicates=' + includeDuplicates
endpoint = endpoint + '&' + 'includeDuplicates=' + includeDuplicates
}

if (useCanonical) {
if (!(typeof useCanonical === 'boolean')) {
throw new Error('"useCanonical" must be a boolean')
}
endpoint = endpoint + 'useCanonical=' + useCanonical
endpoint = endpoint + '&' + 'useCanonical=' + useCanonical
}

if (skip) {
if (!(typeof skip === 'number')) {
throw new Error('"skip" must be a number')
}
endpoint = endpoint + 'skip=' + skip
endpoint = endpoint + '&' + 'skip=' + skip
}

if (limit) {
if (!(typeof limit === 'number')) {
throw new Error('"limit" must be a number')
}
endpoint = endpoint + 'limit=' + limit
endpoint = endpoint + '&' + 'limit=' + limit
}

endpoint = endpoint + '&' + wordnik.key
Expand Down
2 changes: 1 addition & 1 deletion lib/word/topExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function topExample(word, useCanonical) {
wordnik.base + wordnik.version + wordnik.target

if (useCanonical === true) {
endpoint = endpoint + 'useCanonical=true'
endpoint = endpoint + '&' + 'useCanonical=true' + '&'
}

endpoint = endpoint + '&' + wordnik.key
Expand Down

0 comments on commit 14d1b26

Please sign in to comment.