Skip to content

Commit

Permalink
Merge pull request #179 from webitel/feature/code-faving-failed-popup
Browse files Browse the repository at this point in the history
refactor: saveAsJSON script refactored [WTEL-3894]
  • Loading branch information
dlohvinov authored Nov 20, 2023
2 parents 61b273d + d4c61cc commit 759384f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webitel/ui-sdk",
"version": "23.12.40",
"version": "23.12.41",
"private": false,
"scripts": {
"build": "vue-cli-service build --target lib --name ui-sdk ./src/install.js",
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/saveAsJSON.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { saveAs } from 'file-saver';

export const saveAsJSON = (name, content) => {
const saveAsJSON = (name, content) => {
const fileName = name.replace(/[ ,]+/g, '-');
const file = new Blob([JSON.stringify(content, null, 4)], { type: 'application/json' });
saveAs(file, fileName);
};

export default saveAsJSON;

0 comments on commit 759384f

Please sign in to comment.