Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sofa-hessian-node

Package Overview
Dependencies
Maintainers
4
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sofa-hessian-node - npm Package Compare versions

Comparing version 1.7.0 to 1.7.1

7

History.md
1.7.1 / 2020-03-30
==================
**fixes**
* [[`5bf7db4`](http://github.com/sofastack/sofa-hessian-node/commit/5bf7db4cdb26f2a092b71e3649e955b59293689f)] - fix: fix some generic case (#26) (killa <<killa123@126.com>>)
* [[`7a46513`](http://github.com/sofastack/sofa-hessian-node/commit/7a4651303702610d3f2e372d56b3b52357e6441e)] - fix: fix array generic type should start with [ (#25) (killa <<killa123@126.com>>)
1.7.0 / 2020-02-25

@@ -3,0 +10,0 @@ ==================

25

lib/compile.js

@@ -82,10 +82,15 @@ 'use strict';

if (Array.isArray(attr.generic)) {
parseGenericTypeVar(attr.generic, info, attr);
attr.generic = parseGenericTypeVar(attr.generic, info, attr);
}
if (has(attr, 'typeAliasIndex') && Array.isArray(info.generic)) {
attr.type = info.generic[attr.typeAliasIndex].type;
if (info.generic[attr.typeAliasIndex].generic) {
attr.generic = info.generic[attr.typeAliasIndex].generic;
const refType = info.generic[attr.typeAliasIndex];
attr.type = refType.type;
if (refType.generic) {
attr.generic = refType.generic;
}
attr.isArray = refType.isArray;
attr.isMap = refType.isMap;
attr.isEnum = refType.isEnum;
attr.arrayDepth = refType.arrayDepth;
}

@@ -104,9 +109,7 @@ const uniqueId = utils.normalizeUniqId(attr, version);

function parseGenericTypeVar(generic, info) {
const newGeneric = [];
for (const genericItem of generic) {
let newType = genericItem;
if (genericItem.typeVar === true && has(genericItem, 'typeAliasIndex') && Array.isArray(info.generic)) {
genericItem.type = info.generic[genericItem.typeAliasIndex].type;
if (info.generic[genericItem.typeAliasIndex].generic) {
genericItem.generic = info.generic[genericItem.typeAliasIndex].generic;
}
newType = Object.create(null, Object.getOwnPropertyDescriptors(info.generic[genericItem.typeAliasIndex]));
}

@@ -116,5 +119,7 @@

if (Array.isArray(genericItem.generic)) {
parseGenericTypeVar(genericItem.generic, info);
newType.generic = parseGenericTypeVar(genericItem.generic, info);
}
newGeneric.push(newType);
}
return newGeneric;
}

@@ -121,0 +126,0 @@

7

lib/utils.js

@@ -10,3 +10,8 @@ 'use strict';

for (const item of type.generic) {
str += ('#' + item.type + normalizeGeneric(item));
str += '#';
if (item.isArray) {
let arrayDepth = item.arrayDepth || 1;
while (arrayDepth--) str += '[';
}
str += (item.type + normalizeGeneric(item));
}

@@ -13,0 +18,0 @@ return str;

{
"name": "sofa-hessian-node",
"version": "1.7.0",
"version": "1.7.1",
"description": "An internal improved version of Hessian powered by Ant Financial.",

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

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