Socket
Socket
Sign inDemoInstall

@phc/format

Package Overview
Dependencies
1
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.3 to 0.5.0

13

index.js

@@ -79,3 +79,3 @@ /* eslint-disable max-params,capitalized-comments,complexity,prefer-destructuring */

// Parameters Validation
if (typeof opts.params !== 'undefined' && typeof opts.raw === 'undefined') {
if (typeof opts.params !== 'undefined') {
if (typeof opts.params !== 'object' || opts.params === null) {

@@ -88,8 +88,9 @@ throw new TypeError('params must be an object');

}
// Convert Numbers into Numeric Strings
// Convert Numbers into Numeric Strings and Buffers into B64 encoded strings.
pk.forEach(k => {
opts.params[k] =
typeof opts.params[k] === 'number'
? opts.params[k].toString()
: opts.params[k];
if (typeof opts.params[k] === 'number') {
opts.params[k] = opts.params[k].toString();
} else if (Buffer.isBuffer(opts.params[k])) {
opts.params[k] = opts.params[k].toString('base64').split('=')[0];
}
});

@@ -96,0 +97,0 @@ const pv = objectValues(opts.params);

{
"name": "@phc/format",
"version": "0.4.3",
"version": "0.5.0",
"description": "PHC string format serializer/deserializer",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc