@sfirew/minecraft-motd-parser 1.1.4 → 1.1.5-dev.1

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.
package/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "@sfirew/minecraft-motd-parser",
3
3
  "description": "Minecraft Server MOTD Parser, can convert to html, json, text.",
4
- "version": "1.1.4",
4
+ "version": "1.1.5-dev.1",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "types/index.d.ts",
8
8
  "license": "MIT",
9
9
  "scripts": {
10
10
  "test": "jest",
11
+ "test:coverage": "jest --coverage",
12
+ "test:watch": "jest --watch",
13
+ "test:performance": "jest --testNamePattern=\"Performance test|Stress test\"",
14
+ "test:security": "jest --testNamePattern=\"Security Tests\"",
15
+ "test:all": "jest --coverage --verbose",
11
16
  "test-self": "ts-node ./src/test.ts",
12
17
  "build": "yarn build:dist && yarn build:declarations",
13
18
  "build:dist": "tsup --format cjs,esm",
package/types/utils.d.ts CHANGED
@@ -1,24 +1,31 @@
1
1
  import { motdJsonType } from "./types";
2
- export declare function isMotdJSONType(object: object): object is motdJsonType;
3
2
  /**
4
- *
5
- * replace all html tags to &...
3
+ * Base color code regex
4
+ */
5
+ export declare const baseColorCodeRegex: RegExp;
6
+ export declare function isMotdJSONType(object: any): object is motdJsonType;
7
+ /**
8
+ * Replace all HTML special characters with HTML entities
9
+ * Prevents HTML injection by safely encoding special characters
6
10
  */
7
11
  export declare function htmlStringFormatting(text: string): string;
8
12
  /**
9
- * clean html tags
13
+ * Clean HTML tags safely
14
+ *
15
+ * Safely removes HTML tags and prevents HTML injection vulnerabilities.
10
16
  *
11
- * @param text
12
- * example: `<span>hello world</span>`
17
+ * @param text - Input text that may contain HTML tags
18
+ * @example `<span>hello world</span>` → `hello world`
13
19
  *
14
- * result: `hello world`
20
+ * @returns Clean text without HTML tags
15
21
  */
16
22
  export declare function cleanHtmlTags(text: string): string;
17
23
  /**
18
- * clean motd codes
24
+ * Clean MOTD color codes
19
25
  *
20
- * Clean all codes from motd source string.
26
+ * Clean all formatting codes from MOTD source string.
21
27
  *
22
- * @param {string} text - motd string include tag § will remove
28
+ * @param {string} text - MOTD string with § formatting codes to be removed
29
+ * @returns {string} Text without MOTD formatting codes
23
30
  */
24
31
  export declare function cleanCodes(text: string): string;
package/jest.config.js DELETED
@@ -1,5 +0,0 @@
1
- /** @type {import('ts-jest').JestConfigWithTsJest} */
2
- module.exports = {
3
- preset: 'ts-jest',
4
- testEnvironment: 'node',
5
- };