ytsearcher
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -118,3 +118,3 @@ 'use strict'; | ||
nextPage ( newOptions = this.options ) { | ||
newOptions = Object.assign(newOptions||{}, this.options); | ||
newOptions = Object.assign({}, newOptions, this.options); | ||
return new Promise( async (res, rej) => { | ||
@@ -124,3 +124,3 @@ if(!this.nextPageToken) res(null); | ||
try{ | ||
res( await this.search(Object.assign({}, newOptions||this.options, {pageToken: this.nextPageToken})) ); | ||
res( await this.search(Object.assign( newOptions, {pageToken: this.nextPageToken})) ); | ||
}catch(err){ | ||
@@ -142,3 +142,3 @@ rej(err); | ||
prevPage ( newOptions = {} ) { | ||
newOptions = Object.assign(newOptions||{}, this.options); | ||
newOptions = Object.assign({}, newOptions, this.options); | ||
return new Promise( async (res, rej) => { | ||
@@ -148,3 +148,3 @@ if(!this.prevPageToken) res(null); | ||
try{ | ||
res( await this.search(Object.assign({}, newOptions||this.options, {pageToken: this.prevPageToken})) ); | ||
res( await this.search(Object.assign(newOptions, {pageToken: this.prevPageToken})) ); | ||
}catch(err){ | ||
@@ -151,0 +151,0 @@ rej(err); |
@@ -44,3 +44,3 @@ 'use strict'; | ||
Object.defineProperty( this, _protectkey, { | ||
value: typeof apiKey.revealkey ==='boolean'?!apiKey.revealkey:true, | ||
value: typeof apiKey.revealkey ==='boolean'? (!apiKey.revealkey):true, | ||
} ); | ||
@@ -62,3 +62,3 @@ | ||
get key () { | ||
return this[_protectkey]?_key.get(this):undefined; | ||
return this[_protectkey]?undefined:_key.get(this); | ||
} | ||
@@ -65,0 +65,0 @@ |
{ | ||
"name": "ytsearcher", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A nodejs package that provides an easy-to-use promise-based system of getting youtube search results", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,2 +16,9 @@ # YTSearcher | ||
By default the api key will be irretrievable. To enable access to `searcher.key` create the object like so: | ||
const searcher2 = new YTSearcher( { | ||
key: apiKey, | ||
revealkey: true, | ||
} ); | ||
**To Perform Searches** | ||
@@ -37,5 +44,5 @@ | ||
// A YTSearch has a built in page flipper. | ||
result.nextPage(); | ||
result.prevPage(); | ||
// A YTSearch has a built in page flipper, which will update the properties of YTSearch, including `first`. These will return null when the last and first page have been hit (respectively). | ||
await result.nextPage(); | ||
await result.prevPage(); | ||
@@ -42,0 +49,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1079229
51