Socket
Socket
Sign inDemoInstall

timeline-map

Package Overview
Dependencies
14
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.2 to 1.3.0

4

package.json
{
"name": "timeline-map",
"version": "1.2.2",
"version": "1.3.0",
"description": "TimeLine Map Component from MapsForAll",

@@ -8,3 +8,3 @@ "main": "dist/TimeLineMap.js",

"build": "webpack --mode production",
"dev": "webpack --mode development --output-path ../webmap/node_modules/timeline-map/dist/ --watch",
"dev": "webpack --mode development --output-path ../maps4us/node_modules/timeline-map/dist/ --watch",
"test": "mocha -r ts-node/register --colors ./test/*.spec.ts --exit",

@@ -11,0 +11,0 @@ "lint": "eslint --ext .js,.ts src/",

@@ -46,4 +46,10 @@ import axios from 'axios';

export async function fetch(mapId: string): Promise<{markers: Marker[]; metaData: MetaData}> {
const response = await axios.get(`https://mapsforall-96ddd.firebaseio.com/publishedMaps/${mapId}.json`);
export async function fetch(
mapId: string,
incrementViewCount: boolean
): Promise<{markers: Marker[]; metaData: MetaData}> {
const response = await axios.get(
`https://us-central1-mapsforall-96ddd.cloudfunctions.net/getPublishedMap?` +
`mapId=${mapId}&incrementViewCount=${incrementViewCount.toString()}`
);
let {markers, persons, ...metaData} = response.data;

@@ -50,0 +56,0 @@ markers = markers ? markers : persons;

@@ -12,2 +12,3 @@ import {DateMode} from '../date/dateMode';

maxDate: Date;
viewCount?: number;
}

@@ -33,5 +33,5 @@ import {Marker} from './marker/marker';

public async create(): Promise<void> {
public async create(incrementViewCount = false): Promise<void> {
this.google = await fetchGoogle();
await this.getMapData();
await this.getMapData(incrementViewCount);
this.createMap();

@@ -63,4 +63,4 @@ this.createSlider();

private async getMapData(): Promise<void> {
({markers: this.markers, metaData: this.metaData} = await fetch(this.mapId));
private async getMapData(incrementViewCount: boolean): Promise<void> {
({markers: this.markers, metaData: this.metaData} = await fetch(this.mapId, incrementViewCount));
this.sendMetaData(this.metaData);

@@ -67,0 +67,0 @@ this.update(this.markers);

@@ -7,5 +7,5 @@ /* global describe, it, before */

it('should return markers', async () => {
const markers = await fetch('1512409330904');
const markers = await fetch('1512409330904', false);
expect(markers).to.not.be.empty;
});
});

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc