Skip to content

Commit

Permalink
Fix 88 - remove individual modules; make CommonJS compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
clintandrewhall committed Aug 24, 2018
1 parent de62441 commit a6dfd5d
Show file tree
Hide file tree
Showing 24 changed files with 539 additions and 1,084 deletions.
5 changes: 4 additions & 1 deletion .babelrc
@@ -1,6 +1,9 @@
{
"comments": false,
"plugins": ["transform-object-rest-spread"],
"plugins": [
"transform-object-rest-spread",
"add-module-exports"
],
"presets": [
[
"env",
Expand Down
4 changes: 2 additions & 2 deletions __tests__/checkins-test.js
Expand Up @@ -2,7 +2,7 @@
import dotenv from 'dotenv';
dotenv.config();

import { Foursquare } from './../src';
import Foursquare from './../src';

const env = ((process.env: any): { [string]: string });
const {
Expand All @@ -15,7 +15,7 @@ const {
VERSION,
} = env;

const Checkins = Foursquare.Checkins({
const { Checkins } = Foursquare({
foursquare: {
mode: 'foursquare',
version: VERSION,
Expand Down
4 changes: 2 additions & 2 deletions __tests__/lists-test.js
Expand Up @@ -3,7 +3,7 @@
import dotenv from 'dotenv';
dotenv.config();

import { Foursquare } from './../src';
import Foursquare from './../src';

const env = ((process.env: any): { [string]: string });
const {
Expand All @@ -18,7 +18,7 @@ const {
VERSION,
} = env;

const Lists = Foursquare.Lists({
const { Lists } = Foursquare({
foursquare: {
mode: 'foursquare',
version: VERSION,
Expand Down
4 changes: 2 additions & 2 deletions __tests__/photos-test.js
Expand Up @@ -2,7 +2,7 @@
import dotenv from 'dotenv';
dotenv.config();

import { Foursquare } from './../src';
import Foursquare from './../src';

const env = ((process.env: any): { [string]: string });
const {
Expand All @@ -14,7 +14,7 @@ const {
VERSION,
} = env;

const Photos = Foursquare.Photos({
const { Photos } = Foursquare({
foursquare: {
mode: 'foursquare',
version: VERSION,
Expand Down
4 changes: 2 additions & 2 deletions __tests__/tips-test.js
Expand Up @@ -2,7 +2,7 @@
import dotenv from 'dotenv';
dotenv.config();

import { Foursquare } from './../src';
import Foursquare from './../src';

const env = ((process.env: any): { [string]: string });
const {
Expand All @@ -14,7 +14,7 @@ const {
VERSION,
} = env;

const Tips = Foursquare.Tips({
const { Tips } = Foursquare({
foursquare: {
mode: 'foursquare',
version: VERSION,
Expand Down
4 changes: 2 additions & 2 deletions __tests__/users-test.js
Expand Up @@ -2,7 +2,7 @@
import dotenv from 'dotenv';
dotenv.config();

import { Foursquare } from './../src';
import Foursquare from './../src';

const env = ((process.env: any): { [string]: string });
const {
Expand All @@ -15,7 +15,7 @@ const {
VERSION,
} = env;

const Users = Foursquare.Users({
const { Users } = Foursquare({
foursquare: {
mode: 'foursquare',
version: VERSION,
Expand Down
4 changes: 2 additions & 2 deletions __tests__/venues-test.js
Expand Up @@ -2,7 +2,7 @@
import dotenv from 'dotenv';
dotenv.config();

import { Foursquare } from './../src';
import Foursquare from './../src';

const env = ((process.env: any): { [string]: string });
const {
Expand All @@ -21,7 +21,7 @@ const NE = { lat: '39.063281', long: '-94.566989' };
const SW = { lat: '39.028485', long: '-94.607845' };
const LOCATION = { lat: '39.052310', long: '-94.589761' };

const Venues = Foursquare.Venues({
const {Venues} = Foursquare({
foursquare: {
mode: 'foursquare',
version: VERSION,
Expand Down
4 changes: 3 additions & 1 deletion dist/checkins.js
Expand Up @@ -163,4 +163,6 @@ var _mergeDeep2 = _interopRequireDefault(_mergeDeep);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

module.exports = exports['default'];
4 changes: 3 additions & 1 deletion dist/core.js
Expand Up @@ -285,4 +285,6 @@ _winston2.default.addColors({

var loggerFormat = printf(function (info) {
return `${info.timestamp} ${info.level}: [${info.label}] ${info.message}`;
});
});

module.exports = exports['default'];
18 changes: 7 additions & 11 deletions dist/index.js
Expand Up @@ -3,7 +3,10 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Foursquare = undefined;

var _babelPolyfill = require('babel-polyfill');

var _babelPolyfill2 = _interopRequireDefault(_babelPolyfill);

var _querystring = require('querystring');

Expand Down Expand Up @@ -57,15 +60,6 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a

var version = '07102018';

var Foursquare = exports.Foursquare = {
Checkins: _checkins2.default,
Lists: _lists2.default,
Photos: _photos2.default,
Tips: _tips2.default,
Users: _users2.default,
Venues: _venues2.default
};

exports.default = function () {
var getAccessToken = function () {
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(providedParams) {
Expand Down Expand Up @@ -177,4 +171,6 @@ exports.default = function () {
getAccessToken,
getAuthClientRedirectUrl
};
};
};

module.exports = exports['default'];

0 comments on commit a6dfd5d

Please sign in to comment.