Skip to content

Commit

Permalink
Merge branch 'release-0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevel committed Nov 4, 2017
2 parents 4bf0a9b + f85ddfb commit 18b4364
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## 0.6.0
- modify webpack config to add source maps support
- modify readme to include downloads and dependencies badges
- modify code to use better comparison for undefined
- modify `package.json` to update dependencies

## 0.5.0
- modify document readme to add version and license badges

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Youtube Search Google API
[![Build Status](https://travis-ci.org/webdevel/youtube-search-google-api.svg?branch=master)](https://travis-ci.org/webdevel/youtube-search-google-api)
[![Coverage Status](https://coveralls.io/repos/github/webdevel/youtube-search-google-api/badge.svg?branch=master)](https://coveralls.io/github/webdevel/youtube-search-google-api?branch=master)
[![Version](https://img.shields.io/npm/v/youtube-search-google-api.svg?)](https://www.npmjs.com/package/youtube-search-google-api)
[![Version](https://img.shields.io/npm/v/youtube-search-google-api.svg)](https://www.npmjs.com/package/youtube-search-google-api)
[![License](http://img.shields.io/badge/license-MIT-blue.svg?)](LICENSE)
[![Downloads](https://img.shields.io/npm/dt/youtube-search-google-api.svg)](https://www.npmjs.org/package/youtube-search-google-api)
[![Dependencies](https://img.shields.io/david/webdevel/youtube-search-google-api.svg)](https://david-dm.org/webdevel/youtube-search-google-api)

YouTube Search Google API for [Node.js]. Search for YouTube videos, channels, playlists and live events via Google API for [Node.js].

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "youtube-search-google-api",
"version": "0.5.0",
"version": "0.6.0",
"description": "YouTube Search Google API for Node.js. Search for YouTube videos, channels, playlists and live events via Google API for Node.js.",
"main": "dist/youtube-search.js",
"module": "lib/entry.js",
Expand Down Expand Up @@ -35,9 +35,9 @@
"esdoc-standard-plugin": "^1.0.0",
"mocha": "^4.0.1",
"ncp": "^2.0.0",
"nyc": "^11.2.1",
"nyc": "^11.3.0",
"rimraf": "^2.6.2",
"sinon": "^4.0.1",
"sinon": "^4.1.1",
"sinon-chai": "^2.14.0",
"uglifyjs-webpack-plugin": "^1.0.1",
"webpack": "^3.8.1"
Expand Down Expand Up @@ -82,7 +82,7 @@
"doc": "rimraf docs/* && esdoc",
"test": "cross-env NODE_ENV=test nyc --reporter=text mocha --require babel-register --timeout 9000",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"webpack": "rimraf dist/* && webpack --env.production --env.NODE_ENV=production",
"webpack": "rimraf dist/* && webpack --env.production --env.NODE_ENV=production --define process.env.NODE_ENV=\"'production'\"",
"webpack:dev": "webpack --env.development --env.NODE_ENV=development"
},
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion src/DefaultClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class DefaultClient extends Client {
* @return {Handler} Handles requests
*/
get handler() {
if (typeof this._handler === 'undefined') {
if (undefined === this._handler) {
this._handler = new XHRHandler()
}
return this._handler
Expand Down
2 changes: 1 addition & 1 deletion src/HTTPHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class HTTPHandler extends Handler {
* @return {function} HTTP client
*/
get client() {
if (typeof this._client === 'undefined') {
if (undefined === this._client) {
this._client = require('request')
}
return this._client
Expand Down
12 changes: 6 additions & 6 deletions src/SearchRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class SearchRequest extends Request {
* @return {String} HTTP method: GET, POST...
*/
get method() {
if (typeof this._method === 'undefined') {
if (undefined === this._method) {
this._method = this.specs.method
}
return this._method
Expand All @@ -30,7 +30,7 @@ export default class SearchRequest extends Request {
* @return {String} URL
*/
get url() {
if (typeof this._url === 'undefined') {
if (undefined === this._url) {
this._url = `${this.specs.uri}${this.query}`
}
return this._url
Expand Down Expand Up @@ -67,7 +67,7 @@ export default class SearchRequest extends Request {
const key = keys[index]
let param = find(params, { 'name': key })

if (typeof param === 'undefined') {
if (undefined === param) {
result = false
throw new Error('Invalid query parameter name specified: ' + key)

Expand All @@ -87,7 +87,7 @@ export default class SearchRequest extends Request {
} else if (typeof param.values[0] !== 'string' && typeof param.values[0] !== 'number') {

let value = find(param.values, { 'value': query[key]})
if (typeof value === 'undefined') {
if (undefined === value) {
result = false
throw new Error(`Invalid query parameter value for ${key} specified: ${query[key]}`)
}
Expand Down Expand Up @@ -118,7 +118,7 @@ export default class SearchRequest extends Request {
* @return {Object} Container of query parameters
*/
get queryParameters() {
if (typeof this._queryParameters === 'undefined') {
if (undefined === this._queryParameters) {
this._queryParameters = {
part: 'snippet'
}
Expand All @@ -140,7 +140,7 @@ export default class SearchRequest extends Request {
* @return {Object} YouTube Search API specification
*/
get specs() {
if (typeof this._specs === 'undefined') {
if (undefined === this._specs) {
this._specs = searchSpec
}
return this._specs
Expand Down
4 changes: 2 additions & 2 deletions src/XHRHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class XHRHandler extends Handler {
* @return {function} XHR client
*/
get client() {
if (typeof this._client === 'undefined') {
if (undefined === this._client) {
this._client = require('xhr')
}
return this._client
Expand All @@ -48,7 +48,7 @@ export default class XHRHandler extends Handler {
* @return {Handler} Successor to delegate request if desired
*/
get successor() {
if (typeof this._successor === 'undefined') {
if (undefined === this._successor) {
this._successor = new HTTPHandler()
}
return this._successor
Expand Down
2 changes: 1 addition & 1 deletion src/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class YouTube {
* @return {Client} Client to invoke requests
*/
get client() {
if (typeof this._client === 'undefined') {
if (undefined === this._client) {
this._client = new DefaultClient()
}
return this._client
Expand Down
6 changes: 5 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ const targetDir = path.resolve(__dirname, 'dist')

module.exports = env => {

// initialize for development environment
let filename = '[name].js', plugins = []
let sourceMap = 'inline-source-map'

if (env.production) {

sourceMap = 'source-map'
filename = '[name].min.js'
plugins.push(
new UglifyJSPlugin({
Expand Down Expand Up @@ -48,6 +51,7 @@ module.exports = env => {
}
]
},
plugins: plugins
plugins: plugins,
devtool: sourceMap
}
}

0 comments on commit 18b4364

Please sign in to comment.