Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/*
* Copyright 2018, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
const {isNil} = require('lodash');
const {set} = require('./ImmutableUtils');
const {colorToRgbaStr} = require('./ColorUtils');
const axios = require('axios');
const SLDParser = require('geostyler-sld-parser').default;
const StyleParsers = {
sld: new SLDParser()
};
/**
* checks if there is at least one attrbute in the object
* @param {object} style the object to use for filtering the list of attributes
* @param {string[]} attributes to use as filter list
* @return {boolean} the result of the check
*/
const isAttrPresent = (style = {}, attributes) => (attributes.filter(prop => !isNil(style[prop])).length > 0);
/**
* check if the style is assignable to an ol.Stroke style
* @param {object} style to check
* @param {string[]} attibutes of a stroke style
* @return {boolean} if the style is compatible with an ol.Stroke
*/