New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

properties-file

Package Overview
Dependencies
Maintainers
1
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

properties-file - npm Package Compare versions

Comparing version 3.2.24 to 3.2.25

15

lib/escape/index.js

@@ -8,6 +8,13 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.escapeValue=exports.escapeKey=void 0;/**

* @return The escaped key.
*/var escapeKey=exports.escapeKey=function(a){var b=!!(1<arguments.length&&arguments[1]!==void 0)&&arguments[1];return escapeContent(a,!0,b)},escapeValue=exports.escapeValue=function(a){var b=!!(1<arguments.length&&arguments[1]!==void 0)&&arguments[1];return escapeContent(a,!1,b)},escapeContent=function(a,b,c){for(var d="",e=a[0],f=0;f<a.length;f++,e=a[f])switch(e){case" ":{d+=b||0===f?"\\ ":" ";break}// Backslash.
case"\\":{d+="\\\\";break}case"\f":{d+="\\f";break}case"\n":{d+="\\n";break}case"\r":{d+="\\r";break}case"\t":{d+="\\t";break}case"=":case":":case"#":case"!":{d+="\\".concat(e);break}default:{if(c){var g=e.codePointAt(0);// Can never be `undefined`.
if(32>g||126<g){d+="\\u".concat(g.toString(16).padStart(4,"0"));break}}// Non-escapable characters.
d+=e;break}}return d};/**
*/var escapeKey=exports.escapeKey=function(a){var b=!!(1<arguments.length&&arguments[1]!==void 0)&&arguments[1];return escapeContent(a,!0,b)},escapeValue=exports.escapeValue=function(a){var b=!!(1<arguments.length&&arguments[1]!==void 0)&&arguments[1];return escapeContent(a,!1,b)},escapeContent=function(a,b,c){return(// By using a regular expression we avoid iterating through all characters and improve performance.
a.replace(/[\s!#:=\\]|[^\u0020-\u007E]/g,function(d){switch(d){case" ":// Escape space if required, or if it's the first character.
return b||d===a[0]?"\\ ":" ";case"\\":// Backslash.
return"\\\\";case"\f":// Formfeed.
return"\\f";case"\n":// Newline.
return"\\n";case"\r":// Carriage return.
return"\\r";case"\t":// Tab.
return"\\t";case"=":case":":case"#":case"!":// =, :, # and !.
return"\\".concat(d);default:{if(c){var e=d.codePointAt(0);// Can never be `undefined`.
if(32>e||126<e)// Any character that is not in the range of ASCII printable characters.
return"\\u".concat(e.toString(16).padStart(4,"0"))}return d}}}))};/**
* Escape property value.

@@ -14,0 +21,0 @@ *

@@ -10,3 +10,4 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.unescapeContent=void 0;/**

* This exception is thrown if malformed escaped unicode characters are present.
*/var unescapeContent=exports.unescapeContent=function(a){return a.replace(/\\[^u]|\\u.{4}/g,function(a){var b=a.charAt(1);switch(b){case"f":// Formfeed.
*/var unescapeContent=exports.unescapeContent=function(a){return(// By using a regular expression we avoid iterating through all characters and improve performance.
a.replace(/\\[^u]|\\u.{4}/g,function(a){var b=a.charAt(1);switch(b){case"f":// Formfeed.
return"\f";case"n":// Newline.

@@ -17,2 +18,2 @@ return"\n";case"r":// Carriage return.

var c=a.slice(2,6);if(!/[\da-f]{4}/i.test(c))// Code point can only be within Unicode's Multilingual Plane (BMP).
throw new Error("malformed escaped unicode characters '\\u".concat(c,"'"));return String.fromCodePoint(Number.parseInt(c,16))}default:return b}})};
throw new Error("malformed escaped unicode characters '\\u".concat(c,"'"));return String.fromCodePoint(Number.parseInt(c,16))}default:return b}}))};
{
"name": "properties-file",
"version": "3.2.24",
"version": "3.2.25",
"description": ".properties file parser, editor, formatter and Webpack loader.",

@@ -5,0 +5,0 @@ "keywords": [

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