properties-file 2.1.14 → 2.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,14 @@ var getProperties = function (content) {
24
24
  var line = lines_1[_i];
25
25
  lineNumber++;
26
26
  var propertyLine = new property_line_1.PropertyLine(line, !!property);
27
- if (!property) {
27
+ if (property) {
28
+ // Continue parsing an existing property.
29
+ property.addLine(propertyLine);
30
+ if (propertyLine.continues) {
31
+ continue;
32
+ }
33
+ }
34
+ else {
28
35
  // Check if the line is a new property.
29
36
  if (propertyLine.isComment || propertyLine.isBlank) {
30
37
  continue; // Skip line if its a comment or blank.
@@ -35,13 +42,6 @@ var getProperties = function (content) {
35
42
  continue; // Continue parsing the next line.
36
43
  }
37
44
  }
38
- else {
39
- // Continue parsing an existing property.
40
- property.addLine(propertyLine);
41
- if (propertyLine.continues) {
42
- continue;
43
- }
44
- }
45
45
  // If the line does not continue, add the property to the collection.
46
46
  property = properties.add(property);
47
47
  }
package/lib/index.d.ts CHANGED
@@ -7,6 +7,6 @@ export { PropertyLine } from './property-line';
7
7
  /**
8
8
  * A simple "key/value" object.
9
9
  */
10
- export declare type KeyValueObject = {
10
+ export type KeyValueObject = {
11
11
  [key: string]: string;
12
12
  };
@@ -30,7 +30,7 @@ export declare class Properties {
30
30
  /**
31
31
  * Object associating keys with their line numbers.
32
32
  */
33
- export declare type KeyLineNumbers = {
33
+ export type KeyLineNumbers = {
34
34
  [key: string]: number[];
35
35
  };
36
36
  /**
package/lib/property.js CHANGED
@@ -147,7 +147,7 @@ var Property = /** @class */ (function () {
147
147
  continue;
148
148
  }
149
149
  // Check if the delimiter might be escaped.
150
- var prefix = !position ? '' : this.linesContent.slice(0, position);
150
+ var prefix = position ? this.linesContent.slice(0, position) : '';
151
151
  if (prefix.length > 0) {
152
152
  var backslashMatch = prefix.match(/(?<backslashes>\\+)$/);
153
153
  if (backslashMatch === null || backslashMatch === void 0 ? void 0 : backslashMatch.groups) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "properties-file",
3
- "version": "2.1.14",
3
+ "version": "2.1.16",
4
4
  "description": ".properties file parser, JSON converter and Webpack loader.",
5
5
  "author": "Avansai (https://avansai.com)",
6
6
  "repository": {
@@ -53,27 +53,27 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@release-it/conventional-changelog": "^5.1.1",
56
- "@types/jest": "^29.2.2",
57
- "@typescript-eslint/eslint-plugin": "^5.42.1",
58
- "@typescript-eslint/parser": "^5.42.1",
56
+ "@types/jest": "^29.2.3",
57
+ "@typescript-eslint/eslint-plugin": "^5.45.0",
58
+ "@typescript-eslint/parser": "^5.45.0",
59
59
  "dotenv-cli": "^6.0.0",
60
- "eslint": "^8.27.0",
60
+ "eslint": "^8.28.0",
61
61
  "eslint-config-prettier": "^8.5.0",
62
62
  "eslint-import-resolver-node": "^0.3.6",
63
63
  "eslint-import-resolver-typescript": "^3.5.2",
64
64
  "eslint-plugin-import": "^2.26.0",
65
- "eslint-plugin-jest": "^27.1.5",
65
+ "eslint-plugin-jest": "^27.1.6",
66
66
  "eslint-plugin-prefer-arrow-functions": "^3.1.4",
67
67
  "eslint-plugin-prettier": "^4.2.1",
68
- "eslint-plugin-unicorn": "^44.0.2",
68
+ "eslint-plugin-unicorn": "^45.0.1",
69
69
  "jest": "^29.3.1",
70
- "prettier": "^2.7.1",
71
- "prettier-plugin-organize-imports": "^3.2.0",
70
+ "prettier": "^2.8.0",
71
+ "prettier-plugin-organize-imports": "^3.2.1",
72
72
  "prettier-plugin-sh": "^0.12.8",
73
73
  "release-it": "^15.5.0",
74
74
  "ts-jest": "^29.0.3",
75
75
  "ts-node": "^10.9.1",
76
- "typescript": "^4.8.4"
76
+ "typescript": "^4.9.3"
77
77
  },
78
78
  "engines": {
79
79
  "node": "^14.18.1 || >=16.0.0"