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

@a-a-game-studio/aa-components

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@a-a-game-studio/aa-components - npm Package Compare versions

Comparing version 1.0.29 to 1.0.30

tests/test_validator_json.test.ts

28

lib/ModelValidatorSys/ModelValidatorTaskS.js

@@ -176,20 +176,26 @@ "use strict";

// Проверка на массив
if (Object(vJsonValue)) {
if (Array.isArray(vJsonValue) || vJsonValue === Object(vJsonValue)) {
sJsonValue = JSON.stringify(vJsonValue);
}
else {
sJsonValue = vJsonValue;
if (!Number(vJsonValue)) {
sJsonValue = vJsonValue;
}
}
sJsonValue = String(sJsonValue);
// Проверка строки на корректный JSON
try {
let obj = null;
obj = JSON.parse(sJsonValue);
if (obj) {
this.vValidatorSys.aResult[sKey] = sJsonValue;
bSuccess = true;
if (sJsonValue !== '') {
try {
let obj = null;
obj = JSON.parse(sJsonValue);
console.log('===value>', obj);
if (obj) {
this.vValidatorSys.aResult[sKey] = sJsonValue;
bSuccess = true;
}
}
catch (e) {
this.vValidatorSys.errorSys.errorEx(e, sKey + '_json_parse', sKey + ' - неверный формат json поля');
}
}
catch (e) {
this.vValidatorSys.errorSys.errorEx(e, sKey + '_json_parse', sKey + ' - неверный формат json поля');
}
}

@@ -196,0 +202,0 @@ return bSuccess;

{
"name": "@a-a-game-studio/aa-components",
"version": "1.0.29",
"version": "1.0.30",
"description": "node typescript base class",

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

@@ -223,21 +223,29 @@ import { ModelValidatorSys } from "..";

// Проверка на массив
if (Object(vJsonValue)) {
sJsonValue = JSON.stringify(vJsonValue);
if (Array.isArray(vJsonValue) || vJsonValue === Object(vJsonValue)) {
sJsonValue = JSON.stringify(vJsonValue);
} else {
sJsonValue = vJsonValue;
}
if(!Number(vJsonValue)){
sJsonValue = vJsonValue;
}
}
sJsonValue = String(sJsonValue);
// Проверка строки на корректный JSON
try {
let obj = null;
obj = JSON.parse(sJsonValue);
// Проверка строки на корректный JSON
if(sJsonValue !== ''){
try {
let obj = null;
obj = JSON.parse(sJsonValue);
console.log('===value>',obj);
if (obj) {
this.vValidatorSys.aResult[sKey] = sJsonValue;
if (obj) {
this.vValidatorSys.aResult[sKey] = sJsonValue;
bSuccess = true;
}
} catch (e) {
this.vValidatorSys.errorSys.errorEx(e, sKey + '_json_parse', sKey + ' - неверный формат json поля');
}
bSuccess = true;
}
} catch (e) {
this.vValidatorSys.errorSys.errorEx(e, sKey + '_json_parse', sKey + ' - неверный формат json поля');
}
}

@@ -244,0 +252,0 @@ }

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