From 01f698c9b35c009c8d917fbdc165ae14db92c22a Mon Sep 17 00:00:00 2001 From: zefie Date: Tue, 12 Aug 2025 18:40:06 -0400 Subject: [PATCH] even more testing --- zefie_wtvp_minisrv/app.js | 1 + .../includes/ServiceVault/http_pc/indexer.js | 2 +- zefie_wtvp_minisrv/test.js | 32 ++++++++++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index d53c4c7d..18f06d0d 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -6,6 +6,7 @@ const { WTVShared, clientShowAlert } = require(classPath + "WTVShared.js"); const wtvshared = new WTVShared(); // creates minisrv_config const fs = require('fs'); +const util = require('util'); const nunjucks = require('nunjucks'); const zlib = require('zlib'); const {serialize, unserialize} = require('php-serialize'); diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/http_pc/indexer.js b/zefie_wtvp_minisrv/includes/ServiceVault/http_pc/indexer.js index 7eb98a9f..98ca8a82 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/http_pc/indexer.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/http_pc/indexer.js @@ -3,7 +3,7 @@ try { let relativePath = request_headers.request_url; if (relativePath.indexOf('?') > -1) relativePath = relativePath.split('?')[0]; - while (relativePath.endsWith('/')) relativePath = relativePath.substring(0, relativePath.length - 1); + while (relativePath.endsWith('/')) relativePath = relativePath.slice(0, relativePath.length - 1); const dir = service_name + relativePath; const num_per_page = 25; diff --git a/zefie_wtvp_minisrv/test.js b/zefie_wtvp_minisrv/test.js index c907e726..f75adbd9 100644 --- a/zefie_wtvp_minisrv/test.js +++ b/zefie_wtvp_minisrv/test.js @@ -45,7 +45,37 @@ function checkScopeErrors(file) { "block-scoped-var": 2, "no-const-assign": 2, "prefer-const": 1, - "no-var": 1 + "no-var": 1, + "no-restricted-globals": [ + "warn", + { + "name": "escape", + "message": "escape() is deprecated. Use encodeURIComponent() instead." + }, + { + "name": "unescape", + "message": "unescape() is deprecated. Use decodeURIComponent() instead." + } + ], + "no-restricted-syntax": [ + "warn", + { + "selector": "CallExpression[callee.type='MemberExpression'][callee.property.name='substr']", + "message": "String.prototype.substr() is deprecated. Use String.prototype.slice() instead." + }, + { + "selector": "CallExpression[callee.name='substr']", + "message": "substr() is deprecated. Use slice() instead." + }, + { + "selector": "CallExpression[callee.type='MemberExpression'][callee.property.name='substring']", + "message": "substring() found, for continuity, please use String.prototype.slice() instead." + }, + { + "selector": "CallExpression[callee.name='substring']", + "message": "substring() found, for continuity, please use slice() instead." + } + ] } };