Skip to content

Commit c4a3849

Browse files
committed
chore(src): Remove babel
1 parent ec2ed59 commit c4a3849

File tree

3 files changed

+12
-27
lines changed

3 files changed

+12
-27
lines changed

package.json

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22
"name": "simple-reverse-geocoder",
33
"version": "1.1.0",
44
"description": "Get address from a point",
5-
"main": "lib",
5+
"main": "src",
66
"scripts": {
7-
"prepublish": "npm run build -s",
8-
"prebuild": "npm run lint -s && npm run clean -s",
9-
"build": "babel src --out-dir lib --source-maps",
107
"lint": "eslint src",
11-
"clean": "rimraf lib",
12-
"pretest": "npm run build -s",
13-
"test": "mocha --compilers js:babel-core/register"
8+
"test": "mocha"
149
},
1510
"engines": {
1611
"node": ">=0.12"
@@ -34,9 +29,6 @@
3429
"node-geocoder": "^3.8.0"
3530
},
3631
"devDependencies": {
37-
"babel-cli": "^6.6.0",
38-
"babel-core": "^6.6.0",
39-
"babel-preset-es2015": "^6.6.0",
4032
"chai": "^3.5.0",
4133
"eslint": "2.12.0",
4234
"mocha": "^2.4.5",
@@ -50,9 +42,6 @@
5042
"mocha": true
5143
},
5244
"extends": "eslint:recommended",
53-
"parserOptions": {
54-
"sourceType": "module"
55-
},
5645
"rules": {
5746
"indent": [
5847
2,
@@ -72,10 +61,5 @@
7261
]
7362
}
7463
},
75-
"babel": {
76-
"presets": [
77-
"es2015"
78-
]
79-
},
8064
"tonicExampleFilename": "example.js"
8165
}

src/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
22

3-
import nodeGeocoder from 'node-geocoder';
4-
import Promise from 'bluebird';
3+
const nodeGeocoder = require('node-geocoder');
4+
const Promise = require('bluebird');
55

66
let client;
77

8-
const setCache = (instance) => {
8+
const setCache = instance => {
99
client = instance;
1010
Promise.promisifyAll(Object.getPrototypeOf(client));
1111
};
@@ -22,10 +22,11 @@ const getReverse = (lat, lng) => {
2222
});
2323
};
2424

25-
const getCoordinates = (loc) => {
25+
const getCoordinates = loc => {
2626
return new Promise((resolve, reject) => {
2727
try {
28-
const [lng, lat] = loc.coordinates;
28+
const lng = loc.coordinates[0];
29+
const lat = loc.coordinates[1];
2930
resolve({lng: lng, lat: lat});
3031
} catch (err) {
3132
reject(err);
@@ -39,7 +40,7 @@ const getFromCache = (lat, lng) => {
3940
});
4041
};
4142

42-
const getAddress = (loc) => {
43+
const getAddress = loc => {
4344
return new Promise((resolve, reject) => {
4445
getCoordinates(loc).then(({lng, lat}) => {
4546
if (client) {

test/test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
import {expect} from 'chai';
4-
import redis from 'redis';
5-
import rg from '../lib';
3+
const expect = require('chai').expect;
4+
const redis = require('redis');
5+
const rg = require('../src');
66

77
describe('simple-reverse-geocoder', () => {
88
before(() => {

0 commit comments

Comments
 (0)