Skip to content

Commit

Permalink
Target es5 and switch from find to filter
Browse files Browse the repository at this point in the history
  • Loading branch information
alex3165 committed Feb 8, 2017
1 parent 5ba2483 commit ec97fb7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ export default class ReactMapboxGl extends React.Component<Props & Events, State
const didFitBoundsUpdate = (
fitBounds !== nextProps.fitBounds || // Check for reference equality
nextProps.fitBounds.length !== (fitBounds && fitBounds.length) || // Added element
!!fitBounds.find((c, i) => { // Check for equality
!!fitBounds.filter((c, i) => { // Check for equality
const nc = nextProps.fitBounds && nextProps.fitBounds[i];
return c[0] !== (nc && nc[0]) || c[1] !== (nc && nc[1]);
})
})[0]
);

if (didFitBoundsUpdate) {
Expand Down
2 changes: 1 addition & 1 deletion src/util/diff.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const reduce = require('reduce-object'); // tslint:disable-line

const find = (obj: any, predicate: (...args: any[]) => boolean) => (
Object.keys(obj).find((key) => predicate(obj[key], key))
Object.keys(obj).filter((key) => predicate(obj[key], key))[0]
);

const diff = (obj1: any, obj2: any) => (
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"outDir": "lib",
"module": "commonjs",
"target": "es6",
"target": "es5",
"sourceMap": true,
"moduleResolution": "node",
"rootDirs": ["src"],
Expand Down

0 comments on commit ec97fb7

Please sign in to comment.