grpc-web-from-object
Advanced tools
Comparing version 2.1.0 to 2.1.1
# Changelog | ||
## [2.1.1](https://github.com/infodusha/grpc-web-from-object/compare/v2.1.0...v2.1.1) (2023-03-03) | ||
### Bug Fixes | ||
* do not throw when extra nested props ([380afcd](https://github.com/infodusha/grpc-web-from-object/commit/380afcd6147b24fe634618e49bf65f8957058639)) | ||
* do not throw when extra props ([82f7917](https://github.com/infodusha/grpc-web-from-object/commit/82f79179f7dd4ea7841f048cfd4896066f80dd1d)) | ||
## [2.1.0](https://github.com/infodusha/grpc-web-from-object/compare/v2.0.3...v2.1.0) (2023-02-05) | ||
@@ -4,0 +12,0 @@ |
@@ -29,3 +29,3 @@ "use strict"; | ||
else { | ||
validateMissingFactory(key, value); | ||
validateMissingFactory(instance, key, value); | ||
setValue(instance, key, value); | ||
@@ -43,5 +43,2 @@ } | ||
} | ||
else { | ||
throw new Error(`Extra property '${key}'`); | ||
} | ||
} | ||
@@ -61,6 +58,10 @@ function getSetter(key) { | ||
} | ||
function validateMissingFactory(key, value) { | ||
function validateMissingFactory(instance, key, value) { | ||
const setter = getSetter(key); | ||
if (!(setter in instance)) { | ||
return; | ||
} | ||
if (Array.isArray(value)) { | ||
for (const v of value) { | ||
validateMissingFactory(key, v); | ||
validateMissingFactory(instance, key, v); | ||
} | ||
@@ -67,0 +68,0 @@ return; |
{ | ||
"name": "grpc-web-from-object", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "fromObject method for grpc-web", | ||
@@ -5,0 +5,0 @@ "main": "lib/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
20515
89