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

properties-file

Package Overview
Dependencies
Maintainers
1
Versions
110
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.22 to 3.2.23

8

lib/editor/index.js

@@ -1,4 +0,2 @@

"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.PropertiesEditor=exports.DEFAULT_SEPARATOR=exports.DEFAULT_COMMENT_DELIMITER=void 0;var _escape=require("../escape"),_properties=require("../properties");function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _possibleConstructorReturn(a,b){if(b&&("object"===_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}/** The default separator between keys and values. */var DEFAULT_SEPARATOR="=";/** The default character used as comment delimiter. */exports.DEFAULT_SEPARATOR="=";var DEFAULT_COMMENT_DELIMITER="#";/** Characters that can be used as key-value pair separators. */ /** Characters that can be used as comment delimiters. */ /** Options on the `Properties.insert` method. */ /** Options on the `Properties.insertComment` method. */ /** Options on the `Properties.update` method. */ /** Options on the `Properties.upsert` method. */exports.DEFAULT_COMMENT_DELIMITER="#";/**
* A .properties file editor.
*/var PropertiesEditor=/*#__PURE__*/function(a){/**
"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.PropertiesEditor=exports.DEFAULT_SEPARATOR=exports.DEFAULT_COMMENT_DELIMITER=void 0;var _escape=require("../escape"),_properties=require("../properties");function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _possibleConstructorReturn(a,b){if(b&&("object"===_typeof(b)||"function"==typeof b))return b;if(void 0!==b)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}/** The default separator between keys and values. */var DEFAULT_SEPARATOR=exports.DEFAULT_SEPARATOR="=",DEFAULT_COMMENT_DELIMITER=exports.DEFAULT_COMMENT_DELIMITER="#",PropertiesEditor=exports.PropertiesEditor=/*#__PURE__*/function(a){/**
* Create `PropertiesEditor` object.

@@ -72,2 +70,4 @@ *

* @returns True if the key was updated or inserted, otherwise false.
*/},{key:"upsert",value:function upsert(a,b,c){return this.keyLineNumbers[a]?this.update(a,{newValue:b,newComment:null===c||void 0===c?void 0:c.comment,commentDelimiter:null===c||void 0===c?void 0:c.commentDelimiter,separator:null===c||void 0===c?void 0:c.separator,escapeUnicode:null===c||void 0===c?void 0:c.escapeUnicode}):this.insert(a,b,c)}}]),b}(_properties.Properties);exports.PropertiesEditor=PropertiesEditor;
*/},{key:"upsert",value:function upsert(a,b,c){return this.keyLineNumbers[a]?this.update(a,{newValue:b,newComment:null===c||void 0===c?void 0:c.comment,commentDelimiter:null===c||void 0===c?void 0:c.commentDelimiter,separator:null===c||void 0===c?void 0:c.separator,escapeUnicode:null===c||void 0===c?void 0:c.escapeUnicode}):this.insert(a,b,c)}}]),b}(_properties.Properties);/** The default character used as comment delimiter. */ /** Characters that can be used as key-value pair separators. */ /** Characters that can be used as comment delimiters. */ /** Options on the `Properties.insert` method. */ /** Options on the `Properties.insertComment` method. */ /** Options on the `Properties.update` method. */ /** Options on the `Properties.upsert` method. */ /**
* A .properties file editor.
*/

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

* @return The escaped key.
*/var escapeKey=function(a){var b=!!(1<arguments.length&&arguments[1]!==void 0)&&arguments[1];return escapeContent(a,!0,b)};/**
*/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};/**
* Escape property value.

@@ -16,3 +19,3 @@ *

* @return The escaped value.
*/exports.escapeKey=escapeKey;var escapeValue=function(a){var b=!!(1<arguments.length&&arguments[1]!==void 0)&&arguments[1];return escapeContent(a,!1,b)};/**
*/ /**
* Escape the content from either key or value of a property.

@@ -25,5 +28,2 @@ *

* @returns The unescaped content.
*/exports.escapeValue=escapeValue;var 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};
*/

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Properties",{enumerable:!0,get:function get(){return _properties.Properties}}),exports.getProperties=void 0;var _properties=require("./properties"),getProperties=function(a){return new _properties.Properties(a).toObject()};/**
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Properties",{enumerable:!0,get:function get(){return _properties.Properties}}),exports.getProperties=void 0;var _properties=require("./properties"),getProperties=exports.getProperties=function(a){return new _properties.Properties(a).toObject()};/**
* A key-value pair object.

@@ -9,2 +9,2 @@ */ /**

* @returns A key/value object representing the content of a `.properties` file.
*/exports.getProperties=getProperties;
*/

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _=require(".."),webpackLoader=function(a){return"module.exports = ".concat(JSON.stringify((0,_.getProperties)(a)),";")},_default=webpackLoader;/**
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _=require(".."),webpackLoader=function(a){return"module.exports = ".concat(JSON.stringify((0,_.getProperties)(a)),";")},_default=exports.default=webpackLoader;/**
* Webpack file loader for `.properties` files.

@@ -7,2 +7,2 @@ *

* @returns A Webpack file loader string containing the content of a `.properties` file.
*/exports.default=_default;
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFirstEolCharacter=exports.Properties=exports.KeyCollisions=exports.DEFAULT_END_OF_LINE_CHARACTER=exports.BOM_CODE_POINT=exports.BOM=void 0;var _property=require("./property"),_propertyLine=require("./property-line");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d.return&&(k=d.return(),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c.return||c.return()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
* Byte-order mark.
*/var BOM="\uFEFF";exports.BOM="\uFEFF";var BOM_CODE_POINT="\uFEFF".codePointAt(0);/** The default end of line character. */exports.BOM_CODE_POINT=65279;var DEFAULT_END_OF_LINE_CHARACTER="\n";/**
* Get the first end of line (EOL) character from multiline content.
*
* @param content - The content of a `.properties` file.
*
* @returns The multiline content's first end of line (EOL) character.
*/exports.DEFAULT_END_OF_LINE_CHARACTER="\n";var getFirstEolCharacter=function(a){var b=a.indexOf("\n");return 0>b?void 0:"".concat("\r"===a[b-1]?"\r":"","\n")};/**
* A class representing the content of a .properties file.
*/exports.getFirstEolCharacter=getFirstEolCharacter;var Properties=/*#__PURE__*/function(){/**
*/var BOM=exports.BOM="\uFEFF",BOM_CODE_POINT=exports.BOM_CODE_POINT=BOM.codePointAt(0),DEFAULT_END_OF_LINE_CHARACTER=exports.DEFAULT_END_OF_LINE_CHARACTER="\n",getFirstEolCharacter=exports.getFirstEolCharacter=function(a){var b=a.indexOf("\n");return 0>b?void 0:"".concat("\r"===a[b-1]?"\r":"","\n")},Properties=exports.Properties=/*#__PURE__*/function(){/**
* Create `Properties` object.

@@ -40,7 +32,3 @@ *

* @returns The object in `.properties` format.
*/},{key:"format",value:function format(a){return"".concat(this.hasBom?BOM:"").concat(this.lines.join(a||this.eolCharacter))}}]),a}();/**
* Object associating keys with their line numbers.
*/exports.Properties=Properties;/**
* A class representing key within a .properties file that had collisions (more than one occurrence).
*/var KeyCollisions=/*#__PURE__*/function(){/** The key with collisions. */ /** The starting line numbers where collisions are found. */ /**
*/},{key:"format",value:function format(a){return"".concat(this.hasBom?BOM:"").concat(this.lines.join(a||this.eolCharacter))}}]),a}(),KeyCollisions=exports.KeyCollisions=/*#__PURE__*/function(){/** The key with collisions. */ /** The starting line numbers where collisions are found. */ /**
* Create a new key collision object.

@@ -52,2 +40,14 @@ *

* Get the number of the line from which the value will be used.
*/return _createClass(a,[{key:"getApplicableLineNumber",value:function getApplicableLineNumber(){return this.startingLineNumbers.slice(-1)[0]}}]),a}();exports.KeyCollisions=KeyCollisions;
*/return _createClass(a,[{key:"getApplicableLineNumber",value:function getApplicableLineNumber(){return this.startingLineNumbers.slice(-1)[0]}}]),a}();/** The default end of line character. */ /**
* Get the first end of line (EOL) character from multiline content.
*
* @param content - The content of a `.properties` file.
*
* @returns The multiline content's first end of line (EOL) character.
*/ /**
* A class representing the content of a .properties file.
*/ /**
* Object associating keys with their line numbers.
*/ /**
* A class representing key within a .properties file that had collisions (more than one occurrence).
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PropertyLine=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _wrapRegExp(){function a(b,c,e){var f=new RegExp(b,c);return d.set(f,e||d.get(b)),_setPrototypeOf(f,a.prototype)}function b(a,b){var c=d.get(b);return Object.keys(c).reduce(function(b,d){var e=c[d];if("number"==typeof e)b[d]=a[e];else{for(var f=0;void 0===a[e[f]]&&f+1<e.length;)f++;b[d]=a[e[f]]}return b},Object.create(null))}_wrapRegExp=function(b,c){return new a(b,void 0,c)};var c=RegExp.prototype,d=new WeakMap;return _inherits(a,RegExp),a.prototype.exec=function(a){var d=c.exec.call(this,a);if(d){d.groups=b(d,this);var e=d.indices;e&&(e.groups=b(e,this))}return d},a.prototype[Symbol.replace]=function(a,f){if("string"==typeof f){var g=d.get(this);return c[Symbol.replace].call(this,a,f.replace(/\$<([^>]+)>/g,function(a,b){var c=g[b];return"$"+(Array.isArray(c)?c.join("$"):c)}))}if("function"==typeof f){var h=this;return c[Symbol.replace].call(this,a,function(){var a=arguments;return"object"!=_typeof(a[a.length-1])&&(a=[].slice.call(a)).push(b(a,h)),f.apply(this,a)})}return c[Symbol.replace].call(this,a,f)},_wrapRegExp.apply(this,arguments)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
* Object representing a line from the content of .properties file.
*/var PropertyLine=/*#__PURE__*/_createClass(/** Is the line object a continuation from a previous line? */ /**
*/var PropertyLine=exports.PropertyLine=/*#__PURE__*/_createClass(/** Is the line object a continuation from a previous line? */ /**
* Create a new line object.

@@ -9,2 +9,2 @@ *

*/function c(a,b){if(_classCallCheck(this,c),_defineProperty(this,"isContinuing",!1),_defineProperty(this,"isBlank",!1),_defineProperty(this,"isComment",!1),this.content=a.trimStart(),this.isMultiline=b,0===this.content.length)this.isBlank=!0;else if(this.isMultiline||(this.isComment=!!/^[!#]/.test(this.content)),!this.isComment){// Otherwise, check if the line is continuing on the next line.
var d=this.content.match(/*#__PURE__*/_wrapRegExp(/(\\+)$/,{backslashes:1}));null!==d&&void 0!==d&&d.groups&&(this.isContinuing=!!(d.groups.backslashes.length%2),this.isContinuing&&(this.content=this.content.slice(0,-1)))}});exports.PropertyLine=PropertyLine;
var d=this.content.match(/*#__PURE__*/_wrapRegExp(/(\\+)$/,{backslashes:1}));null!==d&&void 0!==d&&d.groups&&(this.isContinuing=!!(d.groups.backslashes.length%2),this.isContinuing&&(this.content=this.content.slice(0,-1)))}});
"use strict";var _unescape=require("./unescape");Object.defineProperty(exports,"__esModule",{value:!0}),exports.Property=void 0;function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _wrapRegExp(){function a(b,c,e){var f=new RegExp(b,c);return d.set(f,e||d.get(b)),_setPrototypeOf(f,a.prototype)}function b(a,b){var c=d.get(b);return Object.keys(c).reduce(function(b,d){var e=c[d];if("number"==typeof e)b[d]=a[e];else{for(var f=0;void 0===a[e[f]]&&f+1<e.length;)f++;b[d]=a[e[f]]}return b},Object.create(null))}_wrapRegExp=function(b,c){return new a(b,void 0,c)};var c=RegExp.prototype,d=new WeakMap;return _inherits(a,RegExp),a.prototype.exec=function(a){var d=c.exec.call(this,a);if(d){d.groups=b(d,this);var e=d.indices;e&&(e.groups=b(e,this))}return d},a.prototype[Symbol.replace]=function(a,f){if("string"==typeof f){var g=d.get(this);return c[Symbol.replace].call(this,a,f.replace(/\$<([^>]+)>/g,function(a,b){var c=g[b];return"$"+(Array.isArray(c)?c.join("$"):c)}))}if("function"==typeof f){var h=this;return c[Symbol.replace].call(this,a,function(){var a=arguments;return"object"!=_typeof(a[a.length-1])&&(a=[].slice.call(a)).push(b(a,h)),f.apply(this,a)})}return c[Symbol.replace].call(this,a,f)},_wrapRegExp.apply(this,arguments)}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),b&&_setPrototypeOf(a,b)}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
* Object representing a property (key/value).
*/var Property=/*#__PURE__*/function(){/** The line number at which the property starts. */ /** The line number at which the property ends. */ /** The previous property object if it exists. */ /** The next property object if it exists. */ /**
*/var Property=exports.Property=/*#__PURE__*/function(){/** The line number at which the property starts. */ /** The line number at which the property ends. */ /** The previous property object if it exists. */ /** The next property object if it exists. */ /**
* Create a new property object.

@@ -39,2 +39,2 @@ *

if(0<j.length&&(g+=j,h=h.slice(j.length)),/[:=]/.test(h[0])){var k;g+=h[0],h=h.slice(1);// If an equal or colon character was found, try to get trailing whitespace.
var l=h.match(/*#__PURE__*/_wrapRegExp(/^([\t\n\v\f\r ]+)/,{whitespace:1})),m=(null===l||void 0===l||null===(k=l.groups)||void 0===k?void 0:k.whitespace)||"";g+=m}this.separatorLength=g.length,this.valuePosition=this.separatorPosition+this.separatorLength,this.separator=this.linesContent.slice(this.separatorPosition,this.separatorPosition+this.separatorLength),b||(this.hasNoKey=!0);break}}void 0===this.separatorPosition?this.hasNoValue=!0:0<this.newlinePositions.length&&this.newlinePositions[0]<this.separatorPosition&&(this.hasMultilineKey=!0)}}}]),a}();exports.Property=Property;
var l=h.match(/*#__PURE__*/_wrapRegExp(/^([\t\n\v\f\r ]+)/,{whitespace:1})),m=(null===l||void 0===l||null===(k=l.groups)||void 0===k?void 0:k.whitespace)||"";g+=m}this.separatorLength=g.length,this.valuePosition=this.separatorPosition+this.separatorLength,this.separator=this.linesContent.slice(this.separatorPosition,this.separatorPosition+this.separatorLength),b||(this.hasNoKey=!0);break}}void 0===this.separatorPosition?this.hasNoValue=!0:0<this.newlinePositions.length&&this.newlinePositions[0]<this.separatorPosition&&(this.hasMultilineKey=!0)}}}]),a}();

@@ -10,5 +10,5 @@ "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=function(a){for(var b="",c=a[0],d=0;d<a.length;d++,c=a[d])if("\\"===c){var e=a[d+1];switch(e){case"f":{b+="\f",d++;break}case"n":{b+="\n",d++;break}case"r":{b+="\r",d++;break}case"t":{b+="\t",d++;break}case"u":{// Unicode character.
*/var unescapeContent=exports.unescapeContent=function(a){for(var b="",c=a[0],d=0;d<a.length;d++,c=a[d])if("\\"===c){var e=a[d+1];switch(e){case"f":{b+="\f",d++;break}case"n":{b+="\n",d++;break}case"r":{b+="\r",d++;break}case"t":{b+="\t",d++;break}case"u":{// Unicode character.
var f=a.slice(d+2,d+6);if(!/[\da-f]{4}/i.test(f))// Code point can only be within Unicode's Multilingual Plane (BMP).
throw new Error("malformed escaped unicode characters '\\u".concat(f,"'"));b+=String.fromCodePoint(Number.parseInt(f,16)),d+=5;break}default:b+=e,d++}}else// When there is \, simply add the character.
b+=c;return b};exports.unescapeContent=unescapeContent;
b+=c;return b};
{
"name": "properties-file",
"version": "3.2.22",
"version": "3.2.23",
"description": ".properties file parser, editor, formatter and Webpack loader.",

@@ -66,10 +66,10 @@ "keywords": [

"devDependencies": {
"@babel/cli": "^7.22.15",
"@babel/core": "^7.22.20",
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.0",
"@babel/preset-env": "^7.22.20",
"@babel/preset-typescript": "7.22.15",
"@babel/preset-typescript": "7.23.0",
"@release-it/conventional-changelog": "7.0.2",
"@types/jest": "29.5.5",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
"babel-preset-minify": "^0.5.2",

@@ -83,3 +83,3 @@ "check-node-version": "^4.2.1",

"eslint-plugin-import": "2.28.1",
"eslint-plugin-jest": "27.4.0",
"eslint-plugin-jest": "27.4.2",
"eslint-plugin-json-files": "3.0.0",

@@ -94,3 +94,3 @@ "eslint-plugin-prefer-arrow-functions": "3.1.4",

"prettier-plugin-sh": "0.13.1",
"release-it": "16.1.5",
"release-it": "16.2.1",
"ts-jest": "29.1.1",

@@ -97,0 +97,0 @@ "ts-node": "10.9.1",

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