Lint fixes

This commit is contained in:
vjrj 2017-12-15 17:42:45 +01:00
parent c5f2c63579
commit eef1fd85f0
4 changed files with 16 additions and 6 deletions

View file

@ -1,3 +1,5 @@
/* eslint-disable prefer-arrow-callback */
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check'; import { check } from 'meteor/check';
import Documents from '../Documents'; import Documents from '../Documents';

View file

@ -1,3 +1,5 @@
/* eslint-disable prefer-arrow-callback */
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import FireAlerts from '../FireAlerts'; import FireAlerts from '../FireAlerts';

View file

@ -1,15 +1,19 @@
/* eslint-disable prefer-arrow-callback */
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import Subscriptions from '../Subscriptions';
import Perlin from 'loms.perlin'; import Perlin from 'loms.perlin';
import Subscriptions from '../Subscriptions';
Perlin.seed(Math.random()); Perlin.seed(Math.random());
Meteor.publishTransformed('userSubsToFires', function () { Meteor.publishTransformed('userSubsToFires', function transform() {
// https://en.wikipedia.org/wiki/Location_obfuscation // https://en.wikipedia.org/wiki/Location_obfuscation
// https://en.wikipedia.org/wiki/Decimal_degrees#Precision // https://en.wikipedia.org/wiki/Decimal_degrees#Precision
// https://gis.stackexchange.com/questions/27792/what-simple-effective-techniques-for-obfuscating-points-are-available // https://gis.stackexchange.com/questions/27792/what-simple-effective-techniques-for-obfuscating-points-are-available
return Subscriptions.find().serverTransform(function (doc) { return Subscriptions.find().serverTransform(function transformDoc(odoc) {
var location = doc.location; const doc = odoc;
// Destructuring gives me an error: "Cannot destructure property `location` of 'undefined'"
const location = doc.location;
/* doc.lat = location.lat; /* doc.lat = location.lat;
* doc.lon = location.lon; */ * doc.lon = location.lon; */
if (location) { if (location) {
@ -17,8 +21,8 @@ Meteor.publishTransformed('userSubsToFires', function () {
doc.lon = Math.round(location.lon * 10) / 10; doc.lon = Math.round(location.lon * 10) / 10;
} }
// console.log(`[${doc.lat}, ${doc.lon}]`); // console.log(`[${doc.lat}, ${doc.lon}]`);
var noiseBase = Perlin.perlin2(doc.lat, doc.lon); const noiseBase = Perlin.perlin2(doc.lat, doc.lon);
var noise = Math.abs(noiseBase / 3); const noise = Math.abs(noiseBase / 3);
// console.log(`Noise ${noise}, abs: ${Math.abs(noise)}`); // console.log(`Noise ${noise}, abs: ${Math.abs(noise)}`);
doc.lat += noise; doc.lat += noise;
doc.lon += noise; doc.lon += noise;

View file

@ -1,3 +1,5 @@
/* eslint-disable prefer-arrow-callback */
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
// import '../Users'; // import '../Users';