Skip to content

Commit

Permalink
Code style and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Zlobin committed Aug 11, 2016
1 parent ef84b5c commit 947b2ab
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 40 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"comma-dangle": [2, "never"],
"no-param-reassign": 0,
"prefer-rest-params": 0,
"no-underscore-dangle": 0
"no-underscore-dangle": 0,
"no-void": 0,
"no-mixed-operators": 0
}
}
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "es-ajax",
"description": "Ajax (fetch or xhr2) with promises - an useful JavaScript library for convenient work with ajax requests in a browser.",
"version": "1.1.5",
"version": "1.1.6",
"main": "src/index.js",
"files": [
"src",
Expand Down Expand Up @@ -38,34 +38,34 @@
],
"license": "MIT",
"dependencies": {
"es-middleware": "^1.1.1",
"object-hash": "^1.1.2",
"qs": "^6.2.0"
"es-middleware": "^1.1.3",
"object-hash": "^1.1.4",
"qs": "^6.2.1"
},
"devDependencies": {
"babel-cli": "^6.9.0",
"babel-core": "^6.9.0",
"babel-cli": "^6.11.4",
"babel-core": "^6.13.2",
"babel-loader": "^6.2.4",
"babel-plugin-transform-export-extensions": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-polyfill": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-2": "^6.5.0",
"eslint": "^2.10.2",
"eslint-config-airbnb": "^9.0.1",
"eslint-loader": "^1.3.0",
"eslint-plugin-import": "^1.9.0",
"eslint-plugin-jsx-a11y": "^1.2.2",
"eslint-plugin-react": "^5.1.1",
"expect": "^1.20.1",
"karma": "^0.13.22",
"karma-mocha": "^1.0.1",
"karma-phantomjs-launcher": "^1.0.0",
"babel-polyfill": "^6.13.0",
"babel-preset-es2015": "^6.13.2",
"babel-preset-stage-2": "^6.13.0",
"eslint": "^3.2.2",
"eslint-config-airbnb": "^10.0.0",
"eslint-loader": "^1.5.0",
"eslint-plugin-import": "^1.12.0",
"eslint-plugin-jsx-a11y": "^2.1.0",
"eslint-plugin-react": "^6.0.0",
"expect": "^1.20.2",
"karma": "^1.1.2",
"karma-mocha": "^1.1.1",
"karma-phantomjs-launcher": "^1.0.1",
"karma-sinon": "^1.0.5",
"karma-webpack": "^1.7.0",
"mocha": "^2.5.3",
"phantomjs-prebuilt": "^2.1.7",
"sinon": "^1.17.4",
"karma-webpack": "^1.8.0",
"mocha": "^3.0.2",
"phantomjs-prebuilt": "^2.1.11",
"sinon": "^1.17.5",
"webpack": "^1.13.1"
},
"engines": {
Expand Down
11 changes: 6 additions & 5 deletions src/ajax.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import guid from './utils/guid';
import factory from './utils/factory';
import { contentTypes } from './utils/content-types';
import objectHash from 'object-hash';
import { is } from './utils/is';
import Middleware from 'es-middleware';

import guid from './utils/guid';
import factory from './utils/factory';
import contentTypes from './utils/content-types';
import is from './utils/is';

const _requests = new Set();
const _meta = new Map();
const mw = new Middleware();
let _timeout = 0;

export function ajax(url, parameters = {}) {
export default function ajax(url, parameters = {}) {
const defaults = {
isSingleton: false,
api: 'xhr', // xhr || fetch
Expand Down
6 changes: 4 additions & 2 deletions src/driver/fetch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* global fetch, Headers */

import XhrAbstract from './xhr-abstract';
import internal from './utils/internal';
import { methods } from './utils/methods';
import { is } from '../utils/is';
import methods from './utils/methods';
import is from '../utils/is';

export default class FetchDriver extends XhrAbstract {
constructor(url, request = {}, headers = {}) {
Expand Down
2 changes: 1 addition & 1 deletion src/driver/utils/methods.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const methods = {
export default {
head: 'HEAD',
options: 'OPTIONS',
get: 'GET',
Expand Down
4 changes: 2 additions & 2 deletions src/driver/xhr-abstract.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { methods } from './utils/methods';
import methods from './utils/methods';
import internal from './utils/internal';
import methodsOverride from './utils/methods-override';
import { is } from '../utils/is';
import is from '../utils/is';

export default class XhrAbstract {
constructor(/* url, request = {}, headers = {} */) {
Expand Down
6 changes: 4 additions & 2 deletions src/driver/xhr.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* global XMLHttpRequest */

import qs from 'qs';
import internal from './utils/internal';
import XhrAbstract from './xhr-abstract';
import { rejectInterface, resolveInterface } from './utils/resolve-reject-interface';
import { methods } from './utils/methods';
import methods from './utils/methods';
import asObject from './utils/as-object';
import { is } from '../utils/is';
import is from '../utils/is';

export default class XhrDriver extends XhrAbstract {
constructor(url, request = {}, headers = {}) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./ajax').ajax;
module.exports = require('./ajax').default;
2 changes: 1 addition & 1 deletion src/utils/content-types.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const contentTypes = {
export default {
text: 'text/plain',
html: 'text/html',
json: 'application/json'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/is.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const is = {
export default {
_undefined(value) {
return value === void 0;
},
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (isProduction) {
}

module.exports = {
devtool: !isProduction ? 'cheap-source-map' : 'eval',
devtool: isProduction ? 'cheap-source-map' : 'eval',
entry: './src/index.js',
watch: false,
output: {
Expand Down

0 comments on commit 947b2ab

Please sign in to comment.