New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hecom/constantgroup

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hecom/constantgroup - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

.idea/constantgroup.iml

2

package.json
{
"name": "@hecom/constantgroup",
"version": "1.2.4",
"version": "1.2.5",
"description": "Constant Group Management",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -5,5 +5,11 @@ import * as Specials from 'specials';

const SUB_PATH = 'constantGroup';
const instance = Specials.getInstance();
const config = {
readFile: null,
writeFile: null,
};
export default {
init: _init,
load: _load,

@@ -16,2 +22,7 @@ loadIfInvalid: _loadIfInvalid,

function _init({readFile, writeFile}) {
config.readFile = readFile;
config.writeFile = writeFile;
}
function _clear() {

@@ -21,12 +32,33 @@ instance.clearStorage();

function _load(constantId) {
return Network.post({groupName: constantId}, Foundation.URL.ConstantGroupList)
.then((result) => {
const data = _generateTree(result.data);
_setNecessaryField(data);
_set(constantId, data);
return data;
function _processResultData(constantId, resultData) {
const data = _generateTree(resultData);
_setNecessaryField(data);
_set(constantId, data);
return data;
}
function _requestConstantGroup(constantId) {
const { writeFile } = config;
return Network.post({groupName: constantId}, Foundation.URL.ConstantGroupList).then((result) => {
return writeFile(constantId, result.data, SUB_PATH).then(() => {
return _processResultData(constantId, result.data);
});
});
}
function _load(constantId) {
const { readFile } = config;
if (!readFile) {
throw new Error('ConstantGroup is not init. Please call ConstantGroup.init first');
}
return readFile(constantId, SUB_PATH).then((resultData) => {
if (resultData) {
_requestConstantGroup(constantId);
return _processResultData(constantId, resultData);
} else {
return _requestConstantGroup(constantId);
}
});
}
function _loadIfInvalid(constantId) {

@@ -33,0 +65,0 @@ if (_isValid(constantId)) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc