hessian.js-1
Advanced tools
Comparing version 1.9.2 to 1.9.3
1.9.2 / 2020-09-17 | ||
1.9.3 / 2020-09-17 | ||
================== | ||
1.9.1 / 2020-09-17 | ||
**others** | ||
* [[`f995e3a`](http://code.alipay.com/hessian/hessian.js/commit/f995e3afb019956c1ad421573f90e488f27e2862)] - PullRequest: 2 fix: float32 accuracy issue (宗羽 <<xiaochen.gaoxc@antgroup.com>>) | ||
1.9.1 / 2020-05-08 | ||
================== | ||
**fixes** | ||
* [[`b92e433`](http://github.com/node-modules/hessian.js/commit/b92e4338afe435334a8486a285d9ecb13aada5a6)] - fix: float32 accuracy issue (#123) (zōng yǔ <<gxcsoccer@users.noreply.github.com>>) | ||
**others** | ||
* [[`acf313b`](http://code.alipay.com/hessian/hessian.js/commit/acf313b39e1f56632e67464d670947067f4554cf)] - PullRequest: 1 fix/security-issue (宗羽 <<xiaochen.gaoxc@antfin.com>>) | ||
@@ -11,0 +14,0 @@ 1.9.0 / 2018-11-02 |
@@ -77,2 +77,42 @@ /**! | ||
var REG_VALID_ID = /^([a-zA-Z_$][a-zA-Z\d_$]*)$/; | ||
function isValidIdentifier(str) { | ||
return REG_VALID_ID.test(str); | ||
} | ||
exports.isValidIdentifier = isValidIdentifier; | ||
exports.ensureValidIdentifier = function ensureValidIdentifier(str) { | ||
var isValid = isValidIdentifier(str); | ||
if (!isValid) { | ||
throw new Error('invalid identifier: ' + str); | ||
} | ||
return str; | ||
}; | ||
function isValidClassName(str) { | ||
if (!str) { | ||
return false; | ||
} | ||
var arr = str.split('.'); | ||
var len = arr.length; | ||
for (var i = 0; i < len; i++) { | ||
if (!isValidIdentifier(arr[i])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
exports.isValidClassName = isValidClassName; | ||
exports.ensureValidClassName = function ensureValidClassName(str) { | ||
var isValid = isValidClassName(str); | ||
if (!isValid) { | ||
throw new Error('invalid className: ' + str); | ||
} | ||
return str; | ||
}; | ||
/** | ||
@@ -79,0 +119,0 @@ * float32 may has accuracy issue |
@@ -486,3 +486,3 @@ /**! | ||
gen('var result = {'); | ||
gen(' $class: \'%s\',', classname); | ||
gen(' $class: \'%s\',', utils.ensureValidClassName(classname)); | ||
gen(' $: {'); | ||
@@ -496,3 +496,3 @@ for (var field of fields) { | ||
} | ||
gen(' %s: null,', field); | ||
gen(' %s: null,', utils.ensureValidIdentifier(field)); | ||
} | ||
@@ -506,3 +506,3 @@ gen(' },'); | ||
} else { | ||
gen('result.$.%s = decoder.read(withType);', field); | ||
gen('result.$.%s = decoder.read(withType);', utils.ensureValidIdentifier(field)); | ||
} | ||
@@ -509,0 +509,0 @@ } |
{ | ||
"name": "hessian.js-1", | ||
"version": "1.9.2", | ||
"version": "1.9.3", | ||
"description": "Hessian Serialization written by pure JavaScript, support all kind of types in Java.", | ||
@@ -12,3 +12,4 @@ "main": "index.js", | ||
"autod": "autod", | ||
"test": "make jshint && make test" | ||
"test": "make jshint && make test", | ||
"ci": "npm run test" | ||
}, | ||
@@ -42,2 +43,3 @@ "repository": { | ||
"devDependencies": { | ||
"@ali/ci": "^4.28.0", | ||
"autod": "^3.0.1", | ||
@@ -55,3 +57,7 @@ "beautify-benchmark": "^0.2.4", | ||
"node": ">= 0.12.0" | ||
}, | ||
"ci": { | ||
"type": "aci", | ||
"versions": "8, 10, 12, 14" | ||
} | ||
} |
@@ -28,2 +28,15 @@ hessian.js-1 | ||
## Badges | ||
[![TNPM version][tnpm-image]][tnpm-url] | ||
[![TNPM downloads][tnpm-downloads-image]][tnpm-url] | ||
[![install size][install-size-image]][install-size-url] | ||
![node >= 0.12.0](https://duing.alibaba-inc.com/img/label?key=node&value=%3E%3D%200.12.0&keyBgColor=505050&valueBgColor=51CA2A&size=12) | ||
[tnpm-image]: https://npm.alibaba-inc.com/badge/v/hessian.js-1.svg | ||
[tnpm-url]: https://npm.alibaba-inc.com/package/hessian.js-1 | ||
[tnpm-downloads-image]: https://npm.alibaba-inc.com/badge/d/hessian.js-1.svg | ||
-------------------- | ||
## Install | ||
@@ -30,0 +43,0 @@ |
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
96781
2623
434
10