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

parse-ini-string

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-ini-string - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

18

build/src/index.js

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

var trimReg = /(^\s+)|\s+$/g;
var stripQuoteReg = /\\"/g;
var isArray = Array.isArray;

@@ -25,2 +26,3 @@

var stripQuote = function stripQuote(s) {
s = s.replace(stripQuoteReg, '"');
return s.substring(1, s.length - 1);

@@ -54,3 +56,3 @@ };

key = match[2];
value = value = match[3] ? match[4] || '' : '';
value = match[3] ? match[4] || '' : '';
if (key.length > 2 && key.slice(-2) === '[]') {

@@ -67,8 +69,2 @@ key = key.substring(0, key.length - 2);

}
switch (value) {
case 'true':
case 'false':
case 'null':
value = JSON.parse(value);
}
} else {

@@ -81,5 +77,11 @@ if (trim(line).slice(-1) === '"') {

if (isEnd) {
if (value.length && isQuoted(value)) {
if (isQuoted(value)) {
value = stripQuote(value);
}
switch (value) {
case 'true':
case 'false':
case 'null':
value = JSON.parse(value);
}
if (isArray(p[key])) {

@@ -86,0 +88,0 @@ p[key].push(value);

{
"name": "parse-ini-string",
"version": "0.0.0",
"version": "0.0.1",
"description": "PHP like parse-ini-string, support multi line",

@@ -5,0 +5,0 @@ "repository": "react-atomic/react-atomic-organism",

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