@aneuhold/core-ts-lib 1.1.7 → 1.1.8

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.
@@ -10,5 +10,10 @@ export default class StringService {
10
10
  * if there is no extension
11
11
  */
12
12
  static getFileNameExtension(fileName: string): string | undefined;
13
+ /**
14
+ * Strips JSON comments from the provided JSON string. Only `//` comments
15
+ * are supported at the moment.
16
+ */
17
+ static stripJsonComments: (jsonString: string) => string;
13
18
  }
14
19
  //# sourceMappingURL=StringService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StringService.d.ts","sourceRoot":"","sources":["../../src/services/StringService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAGlE"}
1
+ {"version":3,"file":"StringService.d.ts","sourceRoot":"","sources":["../../src/services/StringService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIjE;;;OAGG;IACH,MAAM,CAAC,iBAAiB,eAAgB,MAAM,YAG5C;CACH"}
@@ -14,5 +14,13 @@ class StringService {
14
14
  static getFileNameExtension(fileName) {
15
15
  return fileName.split('.').pop();
16
16
  }
17
+ /**
18
+ * Strips JSON comments from the provided JSON string. Only `//` comments
19
+ * are supported at the moment.
20
+ */
21
+ static stripJsonComments = (jsonString) => {
22
+ const commentRegex = /\/\/(.*)/g;
23
+ return jsonString.replace(commentRegex, '');
24
+ };
17
25
  }
18
26
  exports.default = StringService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aneuhold/core-ts-lib",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "A core library for all of my TypeScript projects",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",