simple-localstorage-data-service-stub
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -14,3 +14,8 @@ const getData = (url = '') => { | ||
const dataService = ({initialDataFile = 'data/initialData.json', savedDataFile = null, flushStorage = false}) => { | ||
const dataService = ( | ||
{ | ||
initialDataFile = 'data/initialData.json', | ||
savedDataFile = null, | ||
flushStorage = false | ||
} = {}) => { | ||
let data, resourceNames, actionNames, permissions; | ||
@@ -20,6 +25,6 @@ | ||
return new Promise((resolve, reject) => { | ||
try{ | ||
try { | ||
data = JSON.parse(r); | ||
resourceNames = data ? Object.keys(data) : []; | ||
actionNames = data ? Object.keys(actions): []; | ||
actionNames = data ? Object.keys(actions) : []; | ||
resolve(data) | ||
@@ -60,3 +65,4 @@ } catch (error) { | ||
initData().then(() => {}); | ||
initData().then(() => { | ||
}); | ||
@@ -137,3 +143,3 @@ const hasPermission = (resource, action) => permissions[resource]?.includes(action) || false; | ||
if (data) { | ||
const blob = new Blob([JSON.stringify(data)], { type: "text/json" }); | ||
const blob = new Blob([JSON.stringify(data)], {type: "text/json"}); | ||
const link = document.createElement("a"); | ||
@@ -140,0 +146,0 @@ |
{ | ||
"name": "simple-localstorage-data-service-stub", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "REST-API-esque stub service for frontend experiments", | ||
@@ -5,0 +5,0 @@ "main": "data-service.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6548
192