@live-change/framework
Advanced tools
Comparing version 0.4.39 to 0.4.40
@@ -1,2 +0,1 @@ | ||
const fs = require("fs") | ||
@@ -117,31 +116,2 @@ function typeName(type) { | ||
async function loadJson(jsonPath) { | ||
const text = await new Promise( (resolve, reject) => { | ||
fs.readFile(jsonPath, "utf8", (err, res) => { | ||
if(err) reject(err) | ||
resolve(res) | ||
}) | ||
}) | ||
return JSON.parse(text) | ||
} | ||
async function saveJson(jsonPath, data) { | ||
const text = JSON.stringify(data, null, " ") | ||
return await new Promise((resolve, reject) => { | ||
fs.writeFile(jsonPath, text, (err, res) => { | ||
if(err) reject(err) | ||
resolve(res) | ||
}) | ||
}) | ||
} | ||
async function exists(path) { | ||
return await new Promise((resolve, reject) => { | ||
fs.access(path, (err, res) => { | ||
if(err) resolve(false) | ||
resolve(true) | ||
}) | ||
}) | ||
} | ||
function getProperty(of, propertyName) { | ||
@@ -266,5 +236,5 @@ const path = propertyName.split('.') | ||
module.exports = { | ||
typeName, toJSON, setDifference, mapDifference, crudChanges, loadJson, saveJson, exists, | ||
typeName, toJSON, setDifference, mapDifference, crudChanges, | ||
getProperty, setProperty, getField, setField, isObject, mergeDeep, generateDefault, | ||
prefixRange, rangeProperties | ||
} |
{ | ||
"name": "@live-change/framework", | ||
"version": "0.4.39", | ||
"version": "0.4.40", | ||
"description": "Live Change Framework - ultimate solution for real time mobile/web apps", | ||
@@ -5,0 +5,0 @@ "main": "index.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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
172408
59
8
4666