parse-ini-string
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -19,7 +19,8 @@ "use strict"; | ||
var bAndE = s.charAt(0) + '' + s.slice(-1); | ||
return bAndE === '""' || bAndE === "''"; | ||
var bAndE2 = s.charAt(0) + '' + s.slice(-2); | ||
return bAndE === '""' || bAndE === "''" || bAndE2 === '"";' || bAndE2 === "'';"; | ||
}; | ||
var stripQuote = function stripQuote(s) { | ||
return s.replace(stripQuoteReg, '"').substring(1, s.length - 1); | ||
return s.replace(stripQuoteReg, '"').substring(1, s.length - (s.slice(-1) === ';' ? 2 : 1)); | ||
}; | ||
@@ -34,7 +35,3 @@ | ||
if (n.charAt(0) === '"') { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
return n.charAt(0) === '"' ? true : false; | ||
}; | ||
@@ -79,6 +76,12 @@ | ||
} else { | ||
if (line.trim().slice(-1) === '"') { | ||
var lineTrim = line.trim(); | ||
if (lineTrim.slice(-1) === '"' || lineTrim.slice(-2) === '";') { | ||
isEnd = true; | ||
} | ||
if (!isEnd) { | ||
value += "\n"; | ||
} | ||
value += line; | ||
@@ -85,0 +88,0 @@ } |
@@ -13,7 +13,8 @@ var commentReg = /^\s*[;]/; | ||
var bAndE = s.charAt(0) + '' + s.slice(-1); | ||
return bAndE === '""' || bAndE === "''"; | ||
var bAndE2 = s.charAt(0) + '' + s.slice(-2); | ||
return bAndE === '""' || bAndE === "''" || bAndE2 === '"";' || bAndE2 === "'';"; | ||
}; | ||
var stripQuote = function stripQuote(s) { | ||
return s.replace(stripQuoteReg, '"').substring(1, s.length - 1); | ||
return s.replace(stripQuoteReg, '"').substring(1, s.length - (s.slice(-1) === ';' ? 2 : 1)); | ||
}; | ||
@@ -28,7 +29,3 @@ | ||
if (n.charAt(0) === '"') { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
return n.charAt(0) === '"' ? true : false; | ||
}; | ||
@@ -73,6 +70,12 @@ | ||
} else { | ||
if (line.trim().slice(-1) === '"') { | ||
var lineTrim = line.trim(); | ||
if (lineTrim.slice(-1) === '"' || lineTrim.slice(-2) === '";') { | ||
isEnd = true; | ||
} | ||
if (!isEnd) { | ||
value += "\n"; | ||
} | ||
value += line; | ||
@@ -79,0 +82,0 @@ } |
{ | ||
"name": "parse-ini-string", | ||
"version": "0.0.6", | ||
"description": "PHP like parse-ini-string, support multi line", | ||
"version": "0.0.7", | ||
"description": "PHP parse-ini-string like library, support multi line", | ||
"repository": "react-atomic/react-atomic-organism", | ||
@@ -24,5 +24,4 @@ "main": "./build/cjs/src/index.js", | ||
"build:es": "BABEL_ENV=es babel src -d build/es/src --root-mode upward", | ||
"build:test": "BABEL_ENV=build babel tests -d build/tests --root-mode upward", | ||
"prepublishOnly": "npm run test && npm run build", | ||
"test": "npm run build && npm run build:test && mocha 'build/tests/**/*.js'" | ||
"test": "npm run build && mocha 'build/cjs/**/__tests__/*.js'", | ||
"prepublishOnly": "npm run test && npm run build" | ||
}, | ||
@@ -29,0 +28,0 @@ "files": [ |
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
7898
6
249