Socket
Socket
Sign inDemoInstall

@phc/format

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phc/format - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

17

index.js

@@ -28,6 +28,9 @@ /* eslint-disable max-params,capitalized-comments,complexity */

function objectKeys(object) {
/* istanbul ignore next */
return Object.keys(object);
}
function objectValues(object) {
/* istanbul ignore next */
if (typeof Object.values === 'function') return Object.values(object);
/* istanbul ignore next */
return objectKeys(object).map(k => object[k]);

@@ -134,13 +137,13 @@ }

if (typeof phcstr !== 'string') {
throw new TypeError('pchstr must be a string');
if (typeof phcstr !== 'string' || phcstr === '') {
throw new TypeError('pchstr must be a non-empty string');
}
if (phcstr[0] !== '$') {
throw new TypeError('pchstr must contain a $ as first char');
}
const fields = phcstr.split('$');
// Remove first empty $
fields.shift();
// Parse Fields
if (fields.length === 1) {
throw new TypeError('pchstr must contain at least one $ char');
}
// Remove first empty $
fields.shift();
let maxf = 5;

@@ -147,0 +150,0 @@ if (strict) maxf--;

{
"name": "@phc/format",
"version": "0.3.2",
"version": "0.3.3",
"description": "PHC string format serializer/deserializer",

@@ -17,3 +17,3 @@ "license": "MIT",

"keywords": [
"mfc",
"mcf",
"phc",

@@ -20,0 +20,0 @@ "modular",

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