@wemap/positioning 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -81,5 +81,5 @@
81
81
  "lint": "eslint --ext .js,.jsx --quiet src",
82
82
  "test": "mocha -r esm \"src/**/*.spec.js\""
83
83
  },
84
- "version": "2.3.2"
84
+ "version": "2.3.4"
85
85
  }
package/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import InclinationProvider from './providers/computed/InclinationProvider';
1
+ import InclinationProvider from './providers/others/InclinationProvider';
2
2
  import PositioningHandler from './PositioningHandler';
3
3
  import EventType from './events/EventType';
4
4
  import { ProvidersName } from './providers/ProvidersList';
@@ -3,6 +3,7 @@ import {
3
3
  Browser, BrowserUtils
4
4
  } from '@wemap/utils';
5
5
 
6
+ import isnumber from 'lodash.isnumber';
6
7
  import Provider from '../Provider';
7
8
  import EventType from '../../events/EventType';
8
9
  import MissingAccelerometerError from '../../errors/MissingAccelerometerError';
@@ -129,7 +130,7 @@ class ImuProvider extends Provider {
129
130
  x, y, z
130
131
  } = e.accelerationIncludingGravity;
131
132
 
132
- if (x && y && z) {
133
+ if (isnumber(x) && isnumber(y) && isnumber(z)) {
133
134
  acc = [x, y, z];
134
135
 
135
136
  if (BrowserUtils.name === Browser.SAFARI) {
@@ -161,7 +162,7 @@ class ImuProvider extends Provider {
161
162
  alpha, beta, gamma
162
163
  } = e.rotationRate;
163
164
 
164
- if (alpha && beta && gamma) {
165
+ if (isnumber(alpha) && isnumber(beta) && isnumber(gamma)) {
165
166
  gyr = [deg2rad(alpha), deg2rad(beta), deg2rad(gamma)];
166
167
  }
167
168
  }