@homebridge/hap-nodejs 2.1.7-beta.5 → 2.1.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkName.d.ts","sourceRoot":"","sources":["../../../src/lib/util/checkName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;GAIG;AAEH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"checkName.d.ts","sourceRoot":"","sources":["../../../src/lib/util/checkName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;GAIG;AAEH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAuBvG"}
|
|
@@ -7,10 +7,21 @@ exports.checkName = checkName;
|
|
|
7
7
|
* @private Private API
|
|
8
8
|
*/
|
|
9
9
|
function checkName(displayName, name, value) {
|
|
10
|
-
// Ensure the string starts and ends with a Unicode letter or number
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
// Ensure the string starts and ends with a Unicode letter or number.
|
|
11
|
+
// Allow letters, numbers, space-like characters, apostrophes, and
|
|
12
|
+
// common punctuation in the middle only.
|
|
13
|
+
// Use \p{Zs} instead of \p{Z} to avoid matching line and paragraph separators.
|
|
14
|
+
// Home app validation currently rejects names ending in apostrophes,
|
|
15
|
+
// including U+2019 (curly apostrophe), so the end character is restricted
|
|
16
|
+
// to a Unicode letter or number only.
|
|
17
|
+
if (typeof value === "string" &&
|
|
18
|
+
!/^[\p{L}\p{N}][\p{L}\p{N}\p{Zs}\u2019'&!._:;()/,-]*[\p{L}\p{N}]$/u.test(value)) {
|
|
19
|
+
console.warn("HAP-NodeJS WARNING: The accessory '" + displayName +
|
|
20
|
+
"' has an invalid '" + name +
|
|
21
|
+
"' characteristic ('" + value +
|
|
22
|
+
"'). Please ensure the name starts and ends with a letter or number. " +
|
|
23
|
+
"Only letters, numbers, spaces, apostrophes, and common punctuation " +
|
|
24
|
+
"are supported. Avoid emojis or unsupported symbols. This may prevent " +
|
|
14
25
|
"the accessory from being added in the Home App or cause unresponsiveness.");
|
|
15
26
|
}
|
|
16
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkName.js","sourceRoot":"","sources":["../../../src/lib/util/checkName.ts"],"names":[],"mappings":";;AAQA,
|
|
1
|
+
{"version":3,"file":"checkName.js","sourceRoot":"","sources":["../../../src/lib/util/checkName.ts"],"names":[],"mappings":";;AAQA,8BAuBC;AA7BD;;;;GAIG;AAEH,SAAgB,SAAS,CAAC,WAAmB,EAAE,IAAY,EAAE,KAAoC;IAE/F,qEAAqE;IACrE,kEAAkE;IAClE,yCAAyC;IACzC,+EAA+E;IAC/E,qEAAqE;IACrE,0EAA0E;IAC1E,sCAAsC;IACtC,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,CAAC,kEAAkE,CAAC,IAAI,CAAC,KAAK,CAAC,EAC/E,CAAC;QACD,OAAO,CAAC,IAAI,CACV,qCAAqC,GAAG,WAAW;YACnD,oBAAoB,GAAG,IAAI;YAC3B,qBAAqB,GAAG,KAAK;YAC7B,sEAAsE;YACtE,qEAAqE;YACrE,uEAAuE;YACvE,2EAA2E,CAC5E,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homebridge/hap-nodejs",
|
|
3
|
-
"version": "2.1.7
|
|
3
|
+
"version": "2.1.7",
|
|
4
4
|
"description": "HAP-NodeJS is a Node.js implementation of HomeKit Accessory Server.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"@types/jest": "^30.0.0",
|
|
72
72
|
"@types/node": "^25.9.1",
|
|
73
73
|
"@types/plist": "^3.0.5",
|
|
74
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
75
|
-
"@typescript-eslint/parser": "^8.
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^8.60.0",
|
|
75
|
+
"@typescript-eslint/parser": "^8.60.0",
|
|
76
76
|
"axios": "^1.16.1",
|
|
77
77
|
"commander": "^14.0.3",
|
|
78
78
|
"escape-html": "^1.0.3",
|