properties-file
Advanced tools
Comparing version 3.3.1 to 3.3.2
@@ -1,2 +0,2 @@ | ||
"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)}/** | ||
"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 _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)}/** | ||
* Object representing a property (key/value). | ||
@@ -31,10 +31,10 @@ */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. */ /** | ||
*/},{key:"findSeparator",value:function findSeparator(){// If the separator was already found, skip. | ||
if(!(this.hasNoKey||this.hasNoValue||this.separatorPosition)){for(var a=this.linesContent[0],b=0;b<this.linesContent.length;b++,a=this.linesContent[b]){var c;// If the character is not a separator, check the next one. | ||
if(/[\t\f :=]/.test(a)){// Check if the separator might be escaped. | ||
var d=b?this.linesContent.slice(0,b):"";if(0<d.length){var e=d.match(/*#__PURE__*/_wrapRegExp(/(\\+)$/,{backslashes:1}));if(null!==e&&void 0!==e&&e.groups){var f=!!(e.groups.backslashes.length%2);if(f)// If the separator is escaped, check the next character. | ||
continue}}var g="";this.separatorPosition=b;// Check if the separator starts with a whitespace. | ||
var h=this.linesContent.slice(b),i=h.match(/*#__PURE__*/_wrapRegExp(/^([\t\n\v\f\r ]+)/,{whitespace:1})),j=(null===i||void 0===i||null===(c=i.groups)||void 0===c?void 0:c.whitespace)||"";// All white-space characters, excluding non-breaking spaces. | ||
if(!(this.hasNoKey||this.hasNoValue||this.separatorPosition)){// Only match separators to avoid iterating all characters. | ||
var a,b=_createForOfIteratorHelper(this.linesContent.matchAll(/[\t\f :=]/g));try{for(b.s();!(a=b.n()).done;){var c,d=a.value,e=d.index,f=this.linesContent.slice(0,e),g=f.match(/*#__PURE__*/_wrapRegExp(/(\\+)$/,{backslashes:1}));// Check if the separator might be escaped. | ||
if(null!==g&&void 0!==g&&g.groups){var h=!!(g.groups.backslashes.length%2);if(h)// If the separator is escaped, check the next character. | ||
continue}var i="";this.separatorPosition=e;// Check if the separator starts with a whitespace. | ||
var j=this.linesContent.slice(e),k=j.match(/*#__PURE__*/_wrapRegExp(/^([\t\n\v\f\r ]+)/,{whitespace:1})),l=(null===k||void 0===k||null===(c=k.groups)||void 0===c?void 0:c.whitespace)||"";// All white-space characters, excluding non-breaking spaces. | ||
// If there is a whitespace, move to the next character. | ||
// Check if there is an equal or colon character. | ||
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}(); | ||
if(0<l.length&&(i+=l,j=j.slice(l.length)),/[:=]/.test(j[0])){var m;i+=j[0],j=j.slice(1);// If an equal or colon character was found, try to get trailing whitespace. | ||
var n=j.match(/*#__PURE__*/_wrapRegExp(/^([\t\n\v\f\r ]+)/,{whitespace:1})),o=(null===n||void 0===n||null===(m=n.groups)||void 0===m?void 0:m.whitespace)||"";i+=o}this.separatorLength=i.length,this.valuePosition=this.separatorPosition+this.separatorLength,this.separator=this.linesContent.slice(this.separatorPosition,this.separatorPosition+this.separatorLength),e||(this.hasNoKey=!0);break}}catch(a){b.e(a)}finally{b.f()}void 0===this.separatorPosition?this.hasNoValue=!0:0<this.newlinePositions.length&&this.newlinePositions[0]<this.separatorPosition&&(this.hasMultilineKey=!0)}}}]),a}(); |
{ | ||
"name": "properties-file", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"description": ".properties file parser, editor, formatter and Webpack loader.", | ||
@@ -85,3 +85,3 @@ "keywords": [ | ||
"eslint-plugin-prefer-arrow-functions": "3.1.4", | ||
"eslint-plugin-prettier": "5.0.0", | ||
"eslint-plugin-prettier": "5.0.1", | ||
"eslint-plugin-tsdoc": "0.2.17", | ||
@@ -88,0 +88,0 @@ "eslint-plugin-unicorn": "48.0.1", |
@@ -273,3 +273,3 @@ # properties-file | ||
- Java [Test Sandbox](https://codehs.com/sandbox/id/java-main-uSOlNK) | ||
- Java [Test Sandbox](https://codehs.com/sandbox/id/java-main-FObePj) | ||
- Java's `Properties` class [documentation](https://docs.oracle.com/javase/9/docs/api/java/util/Properties.html) | ||
@@ -276,0 +276,0 @@ - Java's `PropertyResourceBundle` [documentation](https://docs.oracle.com/javase/9/docs/api/java/util/PropertyResourceBundle.html) |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
66022
694