Browse Source

Merge pull request #405 from pelias/greenkeeper-update-all

Update all dependencies 🌴
pull/411/head
Julian Simioni 9 years ago
parent
commit
47e4beaea7
  1. 2
      helper/adminFields.js
  2. 10
      helper/geojsonify.js
  3. 4
      helper/labelGenerator.js
  4. 30
      package.json
  5. 2
      sanitiser/_boundary_country.js
  6. 2
      sanitiser/_categories.js
  7. 2
      sanitiser/_details.js
  8. 2
      sanitiser/_flag_bool.js
  9. 4
      sanitiser/_groups.js
  10. 12
      sanitiser/_ids.js
  11. 4
      sanitiser/_source.js
  12. 6
      sanitiser/_targets.js
  13. 2
      sanitiser/_text.js

2
helper/adminFields.js

@ -32,7 +32,7 @@ function getAvailableAdminFields(schema, expectedFields, logger) {
// check if expected fields are actually in current schema
var available = expectedFields.filter(function (field) {
return _.contains( actualFields, field );
return _.includes( actualFields, field );
});
if (available.length === 0) {

10
helper/geojsonify.js

@ -35,10 +35,10 @@ function lookupSource(src) {
*/
function lookupLayer(src) {
if (src._type === 'geoname') {
if (_.contains(src.category, 'admin')) {
if (_.contains(src.category, 'admin:city')) { return 'locality'; }
if (_.contains(src.category, 'admin:admin1')) { return 'region'; }
if (_.contains(src.category, 'admin:admin2')) { return 'county'; }
if (_.includes(src.category, 'admin')) {
if (_.includes(src.category, 'admin:city')) { return 'locality'; }
if (_.includes(src.category, 'admin:admin1')) { return 'region'; }
if (_.includes(src.category, 'admin:admin2')) { return 'county'; }
return 'neighbourhood'; // this could also be 'local_admin'
}
@ -46,7 +46,7 @@ function lookupLayer(src) {
if (src.address) { return 'address'; }
}
if (_.contains(type_mapping.types, src._type)) {
if (_.includes(type_mapping.types, src._type)) {
return type_mapping.type_to_layer[src._type];
}

4
helper/labelGenerator.js

@ -16,7 +16,7 @@ module.exports = function( record ){
var buildOutput = function(parts, schemaArr, record) {
for (var i=0; i<schemaArr.length; i++) {
var fieldValue = record[schemaArr[i]];
if (check.unemptyString(fieldValue) && !_.contains(parts, fieldValue)) {
if (check.nonEmptyString(fieldValue) && !_.includes(parts, fieldValue)) {
parts.push( fieldValue );
return parts;
}
@ -29,7 +29,7 @@ module.exports = function( record ){
}
// de-dupe outputs
labelParts = _.unique( labelParts );
labelParts = _.uniq( labelParts );
return labelParts.join(', ').trim();
};

30
package.json

@ -36,42 +36,42 @@
},
"dependencies": {
"addressit": "git://github.com/dianashk/addressit.git#temp",
"async": "^0.9.0",
"check-types": "^3.3.1",
"async": "^1.5.2",
"check-types": "^6.0.0",
"cluster2": "git://github.com/missinglink/cluster2.git#node_zero_twelve",
"express": "^4.8.8",
"express-http-proxy": "^0.6.0",
"extend": "2.0.1",
"extend": "3.0.0",
"geojson": "^0.3.0",
"geojson-extent": "^0.3.1",
"geolib": "^2.0.18",
"geopipes-elasticsearch-backend": "^0.2.0",
"iso3166-1": "^0.2.3",
"lodash": "^3.10.1",
"lodash": "^4.3.0",
"markdown": "0.5.0",
"morgan": "1.5.2",
"morgan": "1.6.1",
"pelias-config": "^1.0.1",
"pelias-esclient": "0.0.25",
"pelias-esclient": "1.0.0",
"pelias-logger": "^0.0.8",
"pelias-query": "^5.0.0",
"pelias-schema": "1.0.0",
"pelias-suggester-pipeline": "2.0.2",
"stats-lite": "^1.0.3",
"through2": "0.6.5"
"pelias-schema": "2.0.0",
"pelias-suggester-pipeline": "2.0.4",
"stats-lite": "1.0.3",
"through2": "2.0.1"
},
"devDependencies": {
"ciao": "^0.6.0",
"istanbul": "^0.3.13",
"istanbul": "^0.4.2",
"jshint": "^2.5.6",
"nsp": "^0.3.0",
"precommit-hook": "3.0.0",
"nsp": "^2.2.0",
"precommit-hook": "^3.0.0",
"proxyquire": "^1.4.0",
"tap-dot": "1.0.4",
"tape": "^2.13.4"
"tape": "^4.4.0"
},
"pre-commit": [
"lint",
"validate",
"test"
]
}
}

2
sanitiser/_boundary_country.js

@ -13,7 +13,7 @@ function sanitize(raw, clean) {
if (check.assigned(country)){
// must be valid string
if (!check.unemptyString(country)) {
if (!check.nonEmptyString(country)) {
messages.errors.push('boundary.country is not a string');
}

2
sanitiser/_categories.js

@ -11,7 +11,7 @@ function sanitize( raw, clean ){
clean.categories = [];
// if categories string has been set
if( check.unemptyString( raw.categories ) ){
if( check.nonEmptyString( raw.categories ) ){
// map input categories to valid format
clean.categories = raw.categories.split(',')

2
sanitiser/_details.js

@ -22,7 +22,7 @@ function sanitize( raw, clean ){
// be lenient with 'truthy' values
function isTruthy(val) {
if( check.string( val ) ){
return _.contains( ['true', '1'], val );
return _.includes( ['true', '1'], val );
}
return val === 1 || val === true;

2
sanitiser/_flag_bool.js

@ -44,7 +44,7 @@ function sanitize( raw, clean, opts ){
* @returns {boolean}
*/
function isTruthy(val) {
return _.contains( ['true', '1', 1, true], val );
return _.includes( ['true', '1', 1, true], val );
}
module.exports = setup;

4
sanitiser/_groups.js

@ -10,7 +10,7 @@ var _ = require('lodash');
* returns true if all are present, false if none are present, throws an exception otherwise
*/
function optional_group(object, keys) {
var contained_in_object = _.contains.bind(null, Object.keys(object));
var contained_in_object = _.includes.bind(null, Object.keys(object));
if (keys.every(contained_in_object)) {
return true;
@ -26,7 +26,7 @@ function optional_group(object, keys) {
* An error will be thrown if any of the keys are missing from the object
*/
function required_group(object, keys) {
var contained_in_object = _.contains.bind(null, Object.keys(object));
var contained_in_object = _.includes.bind(null, Object.keys(object));
if (keys.every(contained_in_object)) {
return true;

12
sanitiser/_ids.js

@ -30,17 +30,17 @@ function sanitizeId(rawId, messages) {
var id = parts.slice(2).join(ID_DELIM);
// check if any parts of the gid are empty
if (_.contains([source, layer, id], '')) {
if (_.includes([source, layer, id], '')) {
messages.errors.push( formatError(rawId) );
return;
}
if (!_.contains(type_mapping.sources, source)) {
if (!_.includes(type_mapping.sources, source)) {
messages.errors.push( targetError(source, type_mapping.sources) );
return;
}
if (!_.contains(type_mapping.layers, layer)) {
if (!_.includes(type_mapping.layers, layer)) {
messages.errors.push( targetError(layer, type_mapping.layers) );
return;
}
@ -63,7 +63,7 @@ function sanitize( raw, clean ){
// error & warning messages
var messages = { errors: [], warnings: [] };
if (!check.unemptyString( raw.ids )) {
if (!check.nonEmptyString( raw.ids )) {
messages.errors.push( lengthError);
return messages;
}
@ -72,10 +72,10 @@ function sanitize( raw, clean ){
var rawIds = raw.ids.split(',');
// deduplicate
rawIds = _.unique(rawIds);
rawIds = _.uniq(rawIds);
// ensure all elements are valid non-empty strings
if (!rawIds.every(check.unemptyString)) {
if (!rawIds.every(check.nonEmptyString)) {
messages.errors.push( lengthError );
}

4
sanitiser/_source.js

@ -16,12 +16,12 @@ function sanitize( raw, clean ) {
// default case (no layers specified in GET params)
// don't even set the from_layers key in this case
if( check.unemptyString( raw.source ) ){
if( check.nonEmptyString( raw.source ) ){
var sources = raw.source.split(',');
var invalid_sources = sources.filter(function(source) {
return !_.contains( ALL_SOURCES, source );
return !_.includes( ALL_SOURCES, source );
});
if( invalid_sources.length > 0 ){

6
sanitiser/_targets.js

@ -24,11 +24,11 @@ function sanitize( raw, clean, opts ) {
var targetsString = raw[opts.paramName];
// trim whitespace
if( check.unemptyString( targetsString ) ){
if( check.nonEmptyString( targetsString ) ){
targetsString = targetsString.trim();
// param must be a valid non-empty string
if( !check.unemptyString( targetsString ) ){
if( !check.nonEmptyString( targetsString ) ){
messages.errors.push(
opts.paramName + ' parameter cannot be an empty string. Valid options: ' + opts.targetMapKeysString
);
@ -61,7 +61,7 @@ function sanitize( raw, clean, opts ) {
}, []);
// dedupe in case aliases expanded to common things or user typed in duplicates
clean.types[typesKey] = _.unique(clean.types[typesKey]);
clean.types[typesKey] = _.uniq(clean.types[typesKey]);
}
}

2
sanitiser/_text.js

@ -8,7 +8,7 @@ function sanitize( raw, clean ){
var messages = { errors: [], warnings: [] };
// invalid input 'text'
if( !check.unemptyString( raw.text ) ){
if( !check.nonEmptyString( raw.text ) ){
messages.errors.push('invalid param \'text\': text length, must be >0');
}

Loading…
Cancel
Save