Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pat310/google-trends-api
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.0
Choose a base ref
...
head repository: pat310/google-trends-api
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 11,713 additions and 1,784 deletions.
  1. +4 −0 .babelrc
  2. +15 −0 .codeclimate.yml
  3. +185 −0 .eslintrc
  4. +38 −2 .gitignore
  5. +41 −3 .npmignore
  6. +3 −3 .travis.yml
  7. +132 −0 CHANGES.md
  8. +21 −0 LICENSE
  9. +380 −437 README.md
  10. +1 −0 allCategories.txt
  11. +108 −75 examples.js
  12. +0 −3 index.js
  13. +9,524 −0 package-lock.json
  14. +45 −21 package.json
  15. +18 −0 src/api.js
  16. +27 −0 src/index.js
  17. +69 −0 src/request.js
  18. +0 −44 src/resources/callbacks.js
  19. +0 −514 src/resources/countryCodes.js
  20. +0 −37 src/resources/dateValidate.js
  21. +0 −31 src/resources/errorHandling.js
  22. +0 −48 src/resources/htmlParser.js
  23. +395 −0 src/utilities.js
  24. +0 −31 src/utils/allTopCharts.js
  25. +0 −32 src/utils/categoryTopCharts.js
  26. +0 −25 src/utils/hotTrends.js
  27. +0 −30 src/utils/hotTrendsDetail.js
  28. +0 −9 src/utils/index.js
  29. +0 −33 src/utils/top30in30.js
  30. +0 −30 src/utils/topRelated.js
  31. +0 −30 src/utils/trendData.js
  32. +105 −0 test/api.spec.js
  33. +0 −8 test/index.js
  34. +44 −0 test/index.spec.js
  35. +0 −40 test/resources/callbacks.test.js
  36. +0 −41 test/resources/countryCodes.test.js
  37. +0 −46 test/resources/dateValidate.test.js
  38. +0 −51 test/resources/errorHandling.test.js
  39. +0 −25 test/resources/htmlParser.test.js
  40. +0 −9 test/resources/index.js
  41. +508 −0 test/utilities.spec.js
  42. +0 −18 test/utils/allTopCharts.test.js
  43. +0 −21 test/utils/categoryTopCharts.test.js
  44. +0 −15 test/utils/hotTrends.test.js
  45. +0 −15 test/utils/hotTrendsDetail.test.js
  46. +0 −11 test/utils/index.js
  47. +0 −13 test/utils/top30in30.test.js
  48. +0 −18 test/utils/topRelated.test.js
  49. +0 −15 test/utils/trendData.test.js
  50. +50 −0 webpack.config.js
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["es2015"],
"plugins": ["babel-plugin-add-module-exports", "transform-es2015-destructuring", "transform-object-rest-spread" ]
}
15 changes: 15 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
engines:
# ... CONFIG CONTENT ...
eslint:
enabled: true
config:
languages:
- javascript
fixme:
enabled: true
ratings:
paths:
- "**.js"
- "**.jsx"
exclude_paths: ["lib", "webpack.config.js", "examples.js"]
185 changes: 185 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"ecmaFeatures": {
"globalReturn": true,
"jsx": true,
"modules": true
},

"env": {
"browser": true,
"es6": true,
"node": true
},

"globals": {
"document": false,
"escape": false,
"navigator": false,
"unescape": false,
"window": false,
"describe": true,
"before": true,
"it": true,
"expect": true,
"sinon": true
},

"parser": "babel-eslint",

"plugins": [

],

"rules": {
"block-scoped-var": 2,
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"camelcase": [2, { "properties": "always" }],
"comma-dangle": [2, "always-multiline"],
"comma-spacing": [2, { "before": false, "after": true }],
"comma-style": [2, "last"],
"complexity": 0,
"consistent-return": 2,
"consistent-this": 0,
"curly": [2, "multi-line"],
"default-case": 0,
"dot-location": [2, "property"],
"dot-notation": 0,
"eol-last": 2,
"eqeqeq": [2, "allow-null"],
"func-names": 0,
"func-style": 0,
"generator-star-spacing": [2, "both"],
"guard-for-in": 0,
"handle-callback-err": [2, "^(err|error|anySpecificError)$" ],
"indent": [2, 2, { "SwitchCase": 1 }],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"linebreak-style": 0,
"max-depth": 0,
"max-len": [2, 80, 4],
"max-nested-callbacks": 0,
"max-params": 0,
"max-statements": 0,
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
"newline-after-var": [2, "always"],
"new-parens": 2,
"no-alert": 0,
"no-array-constructor": 2,
"no-bitwise": 0,
"no-caller": 2,
"no-catch-shadow": 0,
"no-cond-assign": 2,
"no-console": 0,
"no-constant-condition": 0,
"no-continue": 0,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-div-regex": 0,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-else-return": 2,
"no-empty": 0,
"no-empty-character-class": 2,
"no-empty-label": 2,
"no-eq-null": 0,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": 0,
"no-extra-semi": 0,
"no-extra-strict": 0,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inline-comments": 0,
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 0,
"no-lonely-if": 0,
"no-loop-func": 0,
"no-mixed-requires": 0,
"no-mixed-spaces-and-tabs": [2, false],
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [2, { "max": 1 }],
"no-native-reassign": 2,
"no-negated-in-lhs": 2,
"no-nested-ternary": 0,
"no-new": 2,
"no-new-func": 2,
"no-new-object": 2,
"no-new-require": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-path-concat": 0,
"no-plusplus": 0,
"no-process-env": 0,
"no-process-exit": 0,
"no-proto": 2,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-reserved-keys": 0,
"no-restricted-modules": 0,
"no-return-assign": 2,
"no-script-url": 0,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow": 0,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-sparse-arrays": 2,
"no-sync": 0,
"no-ternary": 0,
"no-throw-literal": 2,
"no-trailing-spaces": 2,
"no-undef": 2,
"no-undef-init": 2,
"no-undefined": 0,
"no-underscore-dangle": 0,
"no-unneeded-ternary": 2,
"no-unreachable": 2,
"no-unused-expressions": 0,
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
"no-use-before-define": 2,
"no-var": 0,
"no-void": 0,
"no-warning-comments": 0,
"no-with": 2,
"one-var": 0,
"operator-assignment": 0,
"operator-linebreak": [2, "after"],
"padded-blocks": 0,
"quote-props": 0,
"quotes": [2, "single", "avoid-escape"],
"radix": 2,
"semi": [2, "always"],
"semi-spacing": 0,
"sort-vars": 0,
"space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, {"anonymous": "never", "named": "never"}],
"space-in-brackets": 0,
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-return-throw-case": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [2, "always"],
"strict": 0,
"use-isnan": 2,
"valid-jsdoc": 0,
"valid-typeof": 2,
"wrap-iife": [2, "any"],
"wrap-regex": 0,
"yoda": [2, "never"]
}
}
40 changes: 38 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
TODO.md
lib/

testFile.js

# ignore built files
lib

# ignore mac files
.DS_Store

# ignore webstorm files
.idea
44 changes: 41 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
test/
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

testFile.js
allCategories.txt

test
src
webpack.config.js
.travis.yml
TODO.md
src/
.codeclimate.yml
.eslintrc
.babelrc

# ignore mac files
.DS_Store
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- 4.2
- 0.12
after_script: "npm run test-cov && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
- "6"
after_success:
- npm run coveralls
Loading