Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Remove duplicate makeMap implementation #51

Merged
merged 1 commit into from
Jul 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/resolvers-cassandra/Messages/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const translatorService = require('../../clients/translator/MsftTranslator');
const cassandraConnector = require('../../clients/cassandra/CassandraConnector');
const featureServiceClient = require('../../clients/locations/FeatureServiceClient');
const withRunTime = require('../shared').withRunTime;
const makeMap = require('../../utils/collections').makeMap;

/**
* @typedef {type: string, coordinates: number[][], properties: {edges: string[], messageid: string, createdtime: string, sentiment: number, title: string, originalSources: string[], sentence: string, language: string, source: string, properties: {retweetCount: number, fatalaties: number, userConnecionCount: number, actor1: string, actor2: string, actor1Type: string, actor2Type: string, incidentType: string, allyActor1: string, allyActor2: string, title: string, link: string, originalSources: string[]}, fullText: string}} Feature
Expand Down Expand Up @@ -32,18 +33,6 @@ function cassandraRowToFeature(row) {
};
}

function makeMap(array, keyFunc, valueFunc) {
valueFunc = valueFunc || (x => x);

const map = {};
array.forEach(item => {
const key = keyFunc(item);
const value = valueFunc(item);
map[key] = value;
});
return map;
}

function makeDefaultClauses(args) {
let params = [];
const clauses = [];
Expand Down