Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
downloadStyle() {
const tokenStyle = format(stripAccessTokens(style.replaceAccessTokens(this.props.mapStyle)));
const blob = new Blob([tokenStyle], {type: "application/json;charset=utf-8"});
let exportName;
if(this.props.mapStyle.name) {
exportName = Slugify(this.props.mapStyle.name, '_')
} else {
exportName = this.props.mapStyle.id
}
saveAs(blob, exportName + ".json");
}