tiny-essentials 1.16.2 → 1.17.0
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/dist/legacy/crypto/decrypt.cjs +1 -0
- package/dist/legacy/crypto/decrypt.d.mts +1 -0
- package/dist/legacy/crypto/decrypt.mjs +1 -0
- package/dist/legacy/crypto/encrypt.cjs +1 -0
- package/dist/legacy/crypto/encrypt.d.mts +1 -0
- package/dist/legacy/crypto/encrypt.mjs +1 -0
- package/dist/legacy/get/decimalColor.cjs +1 -0
- package/dist/legacy/get/decimalColor.d.mts +1 -0
- package/dist/legacy/get/decimalColor.mjs +1 -0
- package/dist/legacy/get/pagination.cjs +1 -0
- package/dist/legacy/get/pagination.d.mts +1 -0
- package/dist/legacy/get/pagination.mjs +1 -0
- package/dist/legacy/get/queryUrlByName.cjs +1 -0
- package/dist/legacy/get/queryUrlByName.d.mts +1 -0
- package/dist/legacy/get/queryUrlByName.mjs +1 -0
- package/dist/legacy/get/queryUrlJSON.cjs +1 -0
- package/dist/legacy/get/queryUrlJSON.d.mts +1 -0
- package/dist/legacy/get/queryUrlJSON.mjs +1 -0
- package/dist/legacy/get/super_string_filter.cjs +1 -0
- package/dist/legacy/get/super_string_filter.d.mts +1 -0
- package/dist/legacy/get/super_string_filter.mjs +1 -0
- package/dist/legacy/get/versionCheck.cjs +1 -0
- package/dist/legacy/get/versionCheck.d.mts +1 -0
- package/dist/legacy/get/versionCheck.mjs +1 -0
- package/dist/legacy/http/HTTP-1.0.cjs +2 -0
- package/dist/legacy/http/HTTP-1.0.mjs +2 -0
- package/dist/legacy/http/auth.cjs +1 -0
- package/dist/legacy/http/auth.d.mts +1 -0
- package/dist/legacy/http/auth.mjs +1 -0
- package/dist/legacy/http/check_domain.cjs +11 -0
- package/dist/legacy/http/check_domain.d.mts +3 -0
- package/dist/legacy/http/check_domain.mjs +11 -0
- package/dist/legacy/http/csrfTokenAnalyze.cjs +1 -0
- package/dist/legacy/http/csrfTokenAnalyze.d.mts +1 -0
- package/dist/legacy/http/csrfTokenAnalyze.mjs +1 -0
- package/dist/legacy/http/domainValidator.cjs +1 -0
- package/dist/legacy/http/domainValidator.d.mts +1 -0
- package/dist/legacy/http/domainValidator.mjs +1 -0
- package/dist/legacy/http/errorsCallback.cjs +1 -0
- package/dist/legacy/http/errorsCallback.d.mts +1 -0
- package/dist/legacy/http/errorsCallback.mjs +1 -0
- package/dist/legacy/http/fetch/json.cjs +1 -0
- package/dist/legacy/http/fetch/json.d.mts +1 -0
- package/dist/legacy/http/fetch/json.mjs +1 -0
- package/dist/legacy/http/fetch/text.cjs +1 -0
- package/dist/legacy/http/fetch/text.d.mts +1 -0
- package/dist/legacy/http/fetch/text.mjs +1 -0
- package/dist/legacy/http/fileCache.cjs +1 -0
- package/dist/legacy/http/fileCache.d.mts +1 -0
- package/dist/legacy/http/fileCache.mjs +1 -0
- package/dist/legacy/http/getDomainURL.cjs +1 -0
- package/dist/legacy/http/getDomainURL.d.mts +1 -0
- package/dist/legacy/http/getDomainURL.mjs +1 -0
- package/dist/legacy/http/userIP.cjs +1 -0
- package/dist/legacy/http/userIP.d.mts +1 -0
- package/dist/legacy/http/userIP.mjs +1 -0
- package/dist/legacy/libs/capitalize.cjs +1 -0
- package/dist/legacy/libs/capitalize.d.mts +1 -0
- package/dist/legacy/libs/capitalize.mjs +1 -0
- package/dist/legacy/libs/convertBytes.cjs +2 -0
- package/dist/legacy/libs/convertBytes.mjs +2 -0
- package/dist/legacy/libs/custom_module_loader.cjs +2 -0
- package/dist/legacy/libs/custom_module_loader.mjs +2 -0
- package/dist/legacy/libs/dice.cjs +2 -0
- package/dist/legacy/libs/dice.mjs +2 -0
- package/dist/legacy/libs/markdown.cjs +1 -0
- package/dist/legacy/libs/markdown.mjs +1 -0
- package/dist/legacy/libs/percentage.cjs +1 -0
- package/dist/legacy/libs/percentage.mjs +1 -0
- package/dist/legacy/libs/regex/getLetter.cjs +2 -0
- package/dist/legacy/libs/regex/getLetter.d.mts +2 -0
- package/dist/legacy/libs/regex/getLetter.mjs +2 -0
- package/dist/legacy/libs/rule3.cjs +1 -0
- package/dist/legacy/libs/rule3.mjs +1 -0
- package/dist/legacy/momentjs/getAge.cjs +1 -0
- package/dist/legacy/momentjs/getAge.d.mts +1 -0
- package/dist/legacy/momentjs/getAge.mjs +1 -0
- package/dist/legacy/momentjs/timeDuration.cjs +1 -0
- package/dist/legacy/momentjs/timeDuration.d.mts +1 -0
- package/dist/legacy/momentjs/timeDuration.mjs +1 -0
- package/dist/legacy/socket.io/antiFlood/install.cjs +1 -0
- package/dist/legacy/socket.io/antiFlood/install.d.mts +1 -0
- package/dist/legacy/socket.io/antiFlood/install.mjs +1 -0
- package/dist/legacy/socket.io/antiFlood/verify.cjs +1 -0
- package/dist/legacy/socket.io/antiFlood/verify.d.mts +1 -0
- package/dist/legacy/socket.io/antiFlood/verify.mjs +1 -0
- package/dist/legacy/socket.io/cookie-session.cjs +1 -0
- package/dist/legacy/socket.io/cookie-session.d.mts +1 -0
- package/dist/legacy/socket.io/cookie-session.mjs +1 -0
- package/dist/legacy/socket.io/discord.cjs +1 -0
- package/dist/legacy/socket.io/discord.d.mts +1 -0
- package/dist/legacy/socket.io/discord.mjs +1 -0
- package/dist/v1/TinyBasicsEs.js +559 -71
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyDragger.js +486 -47
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyEssentials.js +2496 -72
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyHtml.js +486 -47
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinySmartScroller.js +6230 -0
- package/dist/v1/TinySmartScroller.min.js +1 -0
- package/dist/v1/TinyUploadClicker.js +1538 -72
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/UltraRandomMsgGen.js +995 -0
- package/dist/v1/UltraRandomMsgGen.min.js +1 -0
- package/dist/v1/basics/html.cjs +74 -24
- package/dist/v1/basics/html.d.mts +38 -15
- package/dist/v1/basics/html.mjs +63 -20
- package/dist/v1/build/TinySmartScroller.cjs +7 -0
- package/dist/v1/build/TinySmartScroller.d.mts +3 -0
- package/dist/v1/build/TinySmartScroller.mjs +2 -0
- package/dist/v1/build/UltraRandomMsgGen.cjs +7 -0
- package/dist/v1/build/UltraRandomMsgGen.d.mts +3 -0
- package/dist/v1/build/UltraRandomMsgGen.mjs +2 -0
- package/dist/v1/index.cjs +4 -0
- package/dist/v1/index.d.mts +3 -1
- package/dist/v1/index.mjs +3 -1
- package/dist/v1/libs/TinyHtml.cjs +486 -47
- package/dist/v1/libs/TinyHtml.d.mts +352 -139
- package/dist/v1/libs/TinyHtml.mjs +431 -47
- package/dist/v1/libs/TinySmartScroller.cjs +976 -0
- package/dist/v1/libs/TinySmartScroller.d.mts +458 -0
- package/dist/v1/libs/TinySmartScroller.mjs +856 -0
- package/dist/v1/libs/UltraRandomMsgGen.cjs +956 -0
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +390 -0
- package/dist/v1/libs/UltraRandomMsgGen.mjs +825 -0
- package/docs/v1/README.md +2 -0
- package/docs/v1/basics/html.md +17 -2
- package/docs/v1/libs/TinyHtml.md +197 -8
- package/docs/v1/libs/TinySmartScroller.md +523 -0
- package/docs/v1/libs/UltraRandomMsgGen.md +289 -0
- package/package.json +1 -1
|
@@ -40,6 +40,7 @@ const cryptoAction = function (tinyCrypto, key, text) {
|
|
|
40
40
|
* @param {BufferEncoding} tinyCrypto.stringType - The encoding type used in the encrypted string (e.g., 'hex', 'base64').
|
|
41
41
|
* @param {string} text - The encrypted string to decrypt.
|
|
42
42
|
* @returns {string} The fully decrypted string.
|
|
43
|
+
* @deprecated
|
|
43
44
|
*/
|
|
44
45
|
function decrypt(tinyCrypto, text) {
|
|
45
46
|
// Prepare Result
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* @param {BufferEncoding} tinyCrypto.stringType - The encoding type used in the encrypted string (e.g., 'hex', 'base64').
|
|
11
11
|
* @param {string} text - The encrypted string to decrypt.
|
|
12
12
|
* @returns {string} The fully decrypted string.
|
|
13
|
+
* @deprecated
|
|
13
14
|
*/
|
|
14
15
|
export function decrypt(tinyCrypto: {
|
|
15
16
|
key: string | string[];
|
|
@@ -33,6 +33,7 @@ const cryptoAction = function (tinyCrypto, key, text) {
|
|
|
33
33
|
* @param {BufferEncoding} tinyCrypto.stringType - The encoding type used in the encrypted string (e.g., 'hex', 'base64').
|
|
34
34
|
* @param {string} text - The encrypted string to decrypt.
|
|
35
35
|
* @returns {string} The fully decrypted string.
|
|
36
|
+
* @deprecated
|
|
36
37
|
*/
|
|
37
38
|
export function decrypt(tinyCrypto, text) {
|
|
38
39
|
// Prepare Result
|
|
@@ -36,6 +36,7 @@ const cryptoAction = function (tinyCrypto, key, text) {
|
|
|
36
36
|
* @param {BufferEncoding} tinyCrypto.stringType - The encoding type used for output (e.g., 'hex', 'base64').
|
|
37
37
|
* @param {string} text - The plain text string to encrypt.
|
|
38
38
|
* @returns {string} The final encrypted string.
|
|
39
|
+
* @deprecated
|
|
39
40
|
*/
|
|
40
41
|
function encrypt(tinyCrypto, text) {
|
|
41
42
|
// Prepare Result
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* @param {BufferEncoding} tinyCrypto.stringType - The encoding type used for output (e.g., 'hex', 'base64').
|
|
11
11
|
* @param {string} text - The plain text string to encrypt.
|
|
12
12
|
* @returns {string} The final encrypted string.
|
|
13
|
+
* @deprecated
|
|
13
14
|
*/
|
|
14
15
|
export function encrypt(tinyCrypto: {
|
|
15
16
|
key: string | string[];
|
|
@@ -31,6 +31,7 @@ const cryptoAction = function (tinyCrypto, key, text) {
|
|
|
31
31
|
* @param {BufferEncoding} tinyCrypto.stringType - The encoding type used for output (e.g., 'hex', 'base64').
|
|
32
32
|
* @param {string} text - The plain text string to encrypt.
|
|
33
33
|
* @returns {string} The final encrypted string.
|
|
34
|
+
* @deprecated
|
|
34
35
|
*/
|
|
35
36
|
export function encrypt(tinyCrypto, text) {
|
|
36
37
|
// Prepare Result
|
|
@@ -25,6 +25,7 @@ function combineRGB(r, g, b) {
|
|
|
25
25
|
* @param {string|number} color - The color input (e.g. "#ff6600", "rgb(255, 102, 0)", or a decimal number).
|
|
26
26
|
* @param {function} [errCallback] - Optional callback to handle parsing errors.
|
|
27
27
|
* @returns {number} The decimal representation of the color, or 0 if invalid.
|
|
28
|
+
* @deprecated
|
|
28
29
|
*/
|
|
29
30
|
function decimalColor(color, errCallback) {
|
|
30
31
|
let newColor;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @param {string|number} color - The color input (e.g. "#ff6600", "rgb(255, 102, 0)", or a decimal number).
|
|
9
9
|
* @param {function} [errCallback] - Optional callback to handle parsing errors.
|
|
10
10
|
* @returns {number} The decimal representation of the color, or 0 if invalid.
|
|
11
|
+
* @deprecated
|
|
11
12
|
*/
|
|
12
13
|
export default function decimalColor(color: string | number, errCallback?: Function): number;
|
|
13
14
|
//# sourceMappingURL=decimalColor.d.mts.map
|
|
@@ -21,6 +21,7 @@ function combineRGB(r, g, b) {
|
|
|
21
21
|
* @param {string|number} color - The color input (e.g. "#ff6600", "rgb(255, 102, 0)", or a decimal number).
|
|
22
22
|
* @param {function} [errCallback] - Optional callback to handle parsing errors.
|
|
23
23
|
* @returns {number} The decimal representation of the color, or 0 if invalid.
|
|
24
|
+
* @deprecated
|
|
24
25
|
*/
|
|
25
26
|
export default function decimalColor(color, errCallback) {
|
|
26
27
|
let newColor;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* @param {string} [extraClass2=''] - Additional class name for individual page links.
|
|
26
26
|
*
|
|
27
27
|
* @returns {PaginationData} Pagination metadata
|
|
28
|
+
* @deprecated
|
|
28
29
|
|
|
29
30
|
*/
|
|
30
31
|
export default function pagination(query: string, page: number, total: number, url?: string, extraClass?: string, extraClass2?: string): PaginationData;
|
|
@@ -26,6 +26,7 @@ import queryUrlJSON from './queryUrlJSON.mjs';
|
|
|
26
26
|
* @param {string} [extraClass2=''] - Additional class name for individual page links.
|
|
27
27
|
*
|
|
28
28
|
* @returns {PaginationData} Pagination metadata
|
|
29
|
+
* @deprecated
|
|
29
30
|
|
|
30
31
|
*/
|
|
31
32
|
export default function pagination(query, page, total, url = '', extraClass = '', extraClass2 = '') {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* @param {string} name - The name of the query parameter to retrieve.
|
|
19
19
|
* @param {string} url - The full URL from which to extract the parameter.
|
|
20
20
|
* @returns {string|null} The decoded value of the parameter, or `null` if not found.
|
|
21
|
+
* @deprecated
|
|
21
22
|
*/
|
|
22
23
|
function queryUrlByName(name, url) {
|
|
23
24
|
let newName = name.replace(/[\[\]]/g, '\\$&');
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* @param {string} name - The name of the query parameter to retrieve.
|
|
17
17
|
* @param {string} url - The full URL from which to extract the parameter.
|
|
18
18
|
* @returns {string|null} The decoded value of the parameter, or `null` if not found.
|
|
19
|
+
* @deprecated
|
|
19
20
|
*/
|
|
20
21
|
export default function queryUrlByName(name: string, url: string): string | null;
|
|
21
22
|
//# sourceMappingURL=queryUrlByName.d.mts.map
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* @param {string} name - The name of the query parameter to retrieve.
|
|
17
17
|
* @param {string} url - The full URL from which to extract the parameter.
|
|
18
18
|
* @returns {string|null} The decoded value of the parameter, or `null` if not found.
|
|
19
|
+
* @deprecated
|
|
19
20
|
*/
|
|
20
21
|
export default function queryUrlByName(name, url) {
|
|
21
22
|
let newName = name.replace(/[\[\]]/g, '\\$&');
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @param {string} [url=location.href] - The full URL to parse.
|
|
19
19
|
* @returns {Object.<string, string|string[]>} A key-value object representing the parsed query.
|
|
20
|
+
* @deprecated
|
|
20
21
|
*/
|
|
21
22
|
export default function queryUrlJSON(url?: string): {
|
|
22
23
|
[x: string]: string | string[];
|
|
@@ -25,6 +25,7 @@ var objFilter = require('../../v1/basics/objFilter.cjs');
|
|
|
25
25
|
* @param {string[]} list - The list of strings to filter.
|
|
26
26
|
* @param {(string|Object)[]} validator_list - The list of validators.
|
|
27
27
|
* @returns {string[]} A filtered array of strings that passed at least one validator.
|
|
28
|
+
* @deprecated
|
|
28
29
|
*/
|
|
29
30
|
function super_string_filter(list, validator_list) {
|
|
30
31
|
// Result
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* @param {string[]} list - The list of strings to filter.
|
|
22
22
|
* @param {(string|Object)[]} validator_list - The list of validators.
|
|
23
23
|
* @returns {string[]} A filtered array of strings that passed at least one validator.
|
|
24
|
+
* @deprecated
|
|
24
25
|
*/
|
|
25
26
|
export default function super_string_filter(list: string[], validator_list: (string | Object)[]): string[];
|
|
26
27
|
//# sourceMappingURL=super_string_filter.d.mts.map
|
|
@@ -22,6 +22,7 @@ import objType from './objType.mjs';
|
|
|
22
22
|
* @param {string[]} list - The list of strings to filter.
|
|
23
23
|
* @param {(string|Object)[]} validator_list - The list of validators.
|
|
24
24
|
* @returns {string[]} A filtered array of strings that passed at least one validator.
|
|
25
|
+
* @deprecated
|
|
25
26
|
*/
|
|
26
27
|
export default function super_string_filter(list, validator_list) {
|
|
27
28
|
// Result
|
|
@@ -78,6 +78,7 @@ const http_base = {
|
|
|
78
78
|
* @param {function(number): import('express').Response} [callback] - Optional callback to handle response body manually.
|
|
79
79
|
*
|
|
80
80
|
* @returns {import('express').Response} The result of `res.send()` or the callback function.
|
|
81
|
+
* @deprecated
|
|
81
82
|
*
|
|
82
83
|
* @example
|
|
83
84
|
* http_base.send(res, 404); // Sends 404 Not Found with empty body
|
|
@@ -116,6 +117,7 @@ const http_base = {
|
|
|
116
117
|
* @param {function(number): Promise<any>} [callback] - Optional async callback to handle response.
|
|
117
118
|
*
|
|
118
119
|
* @returns {Promise<any>} The result of the async callback or the empty response.
|
|
120
|
+
* @deprecated
|
|
119
121
|
*
|
|
120
122
|
* @example
|
|
121
123
|
* await http_base.sendAsync(res, 500, async (code) => {
|
|
@@ -70,6 +70,7 @@ const http_base = {
|
|
|
70
70
|
* @param {function(number): import('express').Response} [callback] - Optional callback to handle response body manually.
|
|
71
71
|
*
|
|
72
72
|
* @returns {import('express').Response} The result of `res.send()` or the callback function.
|
|
73
|
+
* @deprecated
|
|
73
74
|
*
|
|
74
75
|
* @example
|
|
75
76
|
* http_base.send(res, 404); // Sends 404 Not Found with empty body
|
|
@@ -104,6 +105,7 @@ const http_base = {
|
|
|
104
105
|
* @param {function(number): Promise<any>} [callback] - Optional async callback to handle response.
|
|
105
106
|
*
|
|
106
107
|
* @returns {Promise<any>} The result of the async callback or the empty response.
|
|
108
|
+
* @deprecated
|
|
107
109
|
*
|
|
108
110
|
* @example
|
|
109
111
|
* await http_base.sendAsync(res, 500, async (code) => {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* @param {Function} [callback] - Optional fallback function `(req, res, next) => {}` executed after customError.
|
|
18
18
|
*
|
|
19
19
|
* @returns {function(import('express').Request, import('express').Response, import('express').NextFunction): void} Express middleware function.
|
|
20
|
+
* @deprecated
|
|
20
21
|
*
|
|
21
22
|
* @example
|
|
22
23
|
* import express from 'express';
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* @param {Function} [callback] - Optional fallback function `(req, res, next) => {}` executed after customError.
|
|
16
16
|
*
|
|
17
17
|
* @returns {function(import('express').Request, import('express').Response, import('express').NextFunction): void} Express middleware function.
|
|
18
|
+
* @deprecated
|
|
18
19
|
*
|
|
19
20
|
* @example
|
|
20
21
|
* import express from 'express';
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* @param {Function} [callback] - Optional fallback function `(req, res, next) => {}` executed after customError.
|
|
16
16
|
*
|
|
17
17
|
* @returns {function(import('express').Request, import('express').Response, import('express').NextFunction): void} Express middleware function.
|
|
18
|
+
* @deprecated
|
|
18
19
|
*
|
|
19
20
|
* @example
|
|
20
21
|
* import express from 'express';
|
|
@@ -24,6 +24,9 @@ const check_domain = {
|
|
|
24
24
|
validators: [
|
|
25
25
|
{
|
|
26
26
|
type: 'x-forwarded-host',
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated
|
|
29
|
+
*/
|
|
27
30
|
callback: function (
|
|
28
31
|
/** @type {import('express').Request} */ req,
|
|
29
32
|
/** @type {string} */ the_domain,
|
|
@@ -36,6 +39,9 @@ const check_domain = {
|
|
|
36
39
|
},
|
|
37
40
|
{
|
|
38
41
|
type: 'hostname',
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated
|
|
44
|
+
*/
|
|
39
45
|
callback: function (
|
|
40
46
|
/** @type {import('express').Request} */ req,
|
|
41
47
|
/** @type {string} */ the_domain,
|
|
@@ -48,6 +54,9 @@ const check_domain = {
|
|
|
48
54
|
},
|
|
49
55
|
{
|
|
50
56
|
type: 'hostname',
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated
|
|
59
|
+
*/
|
|
51
60
|
callback: function (
|
|
52
61
|
/** @type {import('express').Request} */ req,
|
|
53
62
|
/** @type {string} */ the_domain,
|
|
@@ -66,6 +75,7 @@ const check_domain = {
|
|
|
66
75
|
* @param {import('express').Request} req - The request object from Express.
|
|
67
76
|
* @param {string} the_domain - The domain to validate against.
|
|
68
77
|
* @returns {boolean} True if any validator matches the domain.
|
|
78
|
+
* @deprecated
|
|
69
79
|
*/
|
|
70
80
|
validator: function (req, the_domain) {
|
|
71
81
|
for (const item in check_domain.validators)
|
|
@@ -79,6 +89,7 @@ const check_domain = {
|
|
|
79
89
|
* @function
|
|
80
90
|
* @param {import('express').Request} req - The request object from Express.
|
|
81
91
|
* @returns {string|true|string[]|null} The found domain string or `null` if none matched.
|
|
92
|
+
* @deprecated
|
|
82
93
|
*/
|
|
83
94
|
get: function (req) {
|
|
84
95
|
for (const item in check_domain.validators) {
|
|
@@ -2,6 +2,9 @@ export default check_domain;
|
|
|
2
2
|
declare namespace check_domain {
|
|
3
3
|
let validators: {
|
|
4
4
|
type: string;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
5
8
|
callback: (req: import("express").Request, the_domain: string) => string | boolean | string[] | null | undefined;
|
|
6
9
|
}[];
|
|
7
10
|
function validator(req: import("express").Request, the_domain: string): boolean;
|
|
@@ -22,6 +22,9 @@ const check_domain = {
|
|
|
22
22
|
validators: [
|
|
23
23
|
{
|
|
24
24
|
type: 'x-forwarded-host',
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
25
28
|
callback: function (
|
|
26
29
|
/** @type {import('express').Request} */ req,
|
|
27
30
|
/** @type {string} */ the_domain) {
|
|
@@ -33,6 +36,9 @@ const check_domain = {
|
|
|
33
36
|
},
|
|
34
37
|
{
|
|
35
38
|
type: 'hostname',
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated
|
|
41
|
+
*/
|
|
36
42
|
callback: function (
|
|
37
43
|
/** @type {import('express').Request} */ req,
|
|
38
44
|
/** @type {string} */ the_domain) {
|
|
@@ -44,6 +50,9 @@ const check_domain = {
|
|
|
44
50
|
},
|
|
45
51
|
{
|
|
46
52
|
type: 'hostname',
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated
|
|
55
|
+
*/
|
|
47
56
|
callback: function (
|
|
48
57
|
/** @type {import('express').Request} */ req,
|
|
49
58
|
/** @type {string} */ the_domain) {
|
|
@@ -61,6 +70,7 @@ const check_domain = {
|
|
|
61
70
|
* @param {import('express').Request} req - The request object from Express.
|
|
62
71
|
* @param {string} the_domain - The domain to validate against.
|
|
63
72
|
* @returns {boolean} True if any validator matches the domain.
|
|
73
|
+
* @deprecated
|
|
64
74
|
*/
|
|
65
75
|
validator: function (req, the_domain) {
|
|
66
76
|
for (const item in check_domain.validators)
|
|
@@ -74,6 +84,7 @@ const check_domain = {
|
|
|
74
84
|
* @function
|
|
75
85
|
* @param {import('express').Request} req - The request object from Express.
|
|
76
86
|
* @returns {string|true|string[]|null} The found domain string or `null` if none matched.
|
|
87
|
+
* @deprecated
|
|
77
88
|
*/
|
|
78
89
|
get: function (req) {
|
|
79
90
|
for (const item in check_domain.validators) {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* @param {Function} [callback] - Optional custom callback to execute when CSRF validation fails.
|
|
14
14
|
*
|
|
15
15
|
* @returns {boolean} Returns `true` if the token is invalid and a response was sent, otherwise `false`.
|
|
16
|
+
* @deprecated
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* app.post('/submit', (req, res) => {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* @param {Function} [callback] - Optional custom callback to execute when CSRF validation fails.
|
|
12
12
|
*
|
|
13
13
|
* @returns {boolean} Returns `true` if the token is invalid and a response was sent, otherwise `false`.
|
|
14
|
+
* @deprecated
|
|
14
15
|
*
|
|
15
16
|
* @example
|
|
16
17
|
* app.post('/submit', (req, res) => {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* @param {Function} [callback] - Optional custom callback to execute when CSRF validation fails.
|
|
12
12
|
*
|
|
13
13
|
* @returns {boolean} Returns `true` if the token is invalid and a response was sent, otherwise `false`.
|
|
14
|
+
* @deprecated
|
|
14
15
|
*
|
|
15
16
|
* @example
|
|
16
17
|
* app.post('/submit', (req, res) => {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* - `info.err`: The original error object.
|
|
22
22
|
*
|
|
23
23
|
* @returns {function(Error, import('express').Request, import('express').Response, import('express').NextFunction): void} Express middleware function: (err, req, res, next)
|
|
24
|
+
* @deprecated
|
|
24
25
|
*
|
|
25
26
|
* @example
|
|
26
27
|
* import errorsCallback from './errorsCallback.mjs';
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* - `info.err`: The original error object.
|
|
20
20
|
*
|
|
21
21
|
* @returns {function(Error, import('express').Request, import('express').Response, import('express').NextFunction): void} Express middleware function: (err, req, res, next)
|
|
22
|
+
* @deprecated
|
|
22
23
|
*
|
|
23
24
|
* @example
|
|
24
25
|
* import errorsCallback from './errorsCallback.mjs';
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* - `info.err`: The original error object.
|
|
20
20
|
*
|
|
21
21
|
* @returns {function(Error, import('express').Request, import('express').Response, import('express').NextFunction): void} Express middleware function: (err, req, res, next)
|
|
22
|
+
* @deprecated
|
|
22
23
|
*
|
|
23
24
|
* @example
|
|
24
25
|
* import errorsCallback from './errorsCallback.mjs';
|
|
@@ -17,6 +17,7 @@ var fetch = require('node-fetch');
|
|
|
17
17
|
* @returns {Promise<any>} A Promise that resolves with the parsed JSON data
|
|
18
18
|
* if the request succeeds and the response is valid JSON,
|
|
19
19
|
* or rejects with an error if the request or parsing fails.
|
|
20
|
+
* @deprecated
|
|
20
21
|
*
|
|
21
22
|
* @example
|
|
22
23
|
* getJsonFetch('https://api.example.com/data')
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* @returns {Promise<any>} A Promise that resolves with the parsed JSON data
|
|
14
14
|
* if the request succeeds and the response is valid JSON,
|
|
15
15
|
* or rejects with an error if the request or parsing fails.
|
|
16
|
+
* @deprecated
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* getJsonFetch('https://api.example.com/data')
|
|
@@ -14,6 +14,7 @@ import fetch from 'node-fetch';
|
|
|
14
14
|
* @returns {Promise<any>} A Promise that resolves with the parsed JSON data
|
|
15
15
|
* if the request succeeds and the response is valid JSON,
|
|
16
16
|
* or rejects with an error if the request or parsing fails.
|
|
17
|
+
* @deprecated
|
|
17
18
|
*
|
|
18
19
|
* @example
|
|
19
20
|
* getJsonFetch('https://api.example.com/data')
|
|
@@ -16,6 +16,7 @@ var fetch = require('node-fetch');
|
|
|
16
16
|
* @returns {Promise<string>} A Promise that resolves with the response text
|
|
17
17
|
* if the request is successful and parsing succeeds,
|
|
18
18
|
* or rejects with an error if the request or text conversion fails.
|
|
19
|
+
* @deprecated
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* getTextFetch('https://example.com/page')
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @returns {Promise<string>} A Promise that resolves with the response text
|
|
13
13
|
* if the request is successful and parsing succeeds,
|
|
14
14
|
* or rejects with an error if the request or text conversion fails.
|
|
15
|
+
* @deprecated
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* getTextFetch('https://example.com/page')
|
|
@@ -13,6 +13,7 @@ import fetch from 'node-fetch';
|
|
|
13
13
|
* @returns {Promise<string>} A Promise that resolves with the response text
|
|
14
14
|
* if the request is successful and parsing succeeds,
|
|
15
15
|
* or rejects with an error if the request or text conversion fails.
|
|
16
|
+
* @deprecated
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* getTextFetch('https://example.com/page')
|
|
@@ -19,6 +19,7 @@ var byteLength = require('byte-length');
|
|
|
19
19
|
* @param {string} [data.date] - A date string used for the `Last-Modified` header.
|
|
20
20
|
* @param {string} [data.timezone="Universal"] - Timezone for `moment.tz()`.
|
|
21
21
|
* @param {string} [data.contentType="application/javascript"] - MIME type for the response.
|
|
22
|
+
* @deprecated
|
|
22
23
|
*
|
|
23
24
|
* @example
|
|
24
25
|
* import fileCache from './fileCache.mjs';
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @param {string} [data.date] - A date string used for the `Last-Modified` header.
|
|
13
13
|
* @param {string} [data.timezone="Universal"] - Timezone for `moment.tz()`.
|
|
14
14
|
* @param {string} [data.contentType="application/javascript"] - MIME type for the response.
|
|
15
|
+
* @deprecated
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* import fileCache from './fileCache.mjs';
|
|
@@ -16,6 +16,7 @@ import byteLength from 'byte-length';
|
|
|
16
16
|
* @param {string} [data.date] - A date string used for the `Last-Modified` header.
|
|
17
17
|
* @param {string} [data.timezone="Universal"] - Timezone for `moment.tz()`.
|
|
18
18
|
* @param {string} [data.contentType="application/javascript"] - MIME type for the response.
|
|
19
|
+
* @deprecated
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* import fileCache from './fileCache.mjs';
|
|
@@ -13,6 +13,7 @@ var check_domain = require('./check_domain.cjs');
|
|
|
13
13
|
* @param {string} [httpResult='https'] - The protocol to use (usually "http" or "https").
|
|
14
14
|
*
|
|
15
15
|
* @returns {string} A fully constructed URL string. Returns an empty string if the domain is invalid.
|
|
16
|
+
* @deprecated
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* getDomainURL('example.com', 443); // "https://example.com"
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @param {string} [httpResult='https'] - The protocol to use (usually "http" or "https").
|
|
10
10
|
*
|
|
11
11
|
* @returns {string} A fully constructed URL string. Returns an empty string if the domain is invalid.
|
|
12
|
+
* @deprecated
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* getDomainURL('example.com', 443); // "https://example.com"
|
|
@@ -10,6 +10,7 @@ import checkDomain from './check_domain.mjs';
|
|
|
10
10
|
* @param {string} [httpResult='https'] - The protocol to use (usually "http" or "https").
|
|
11
11
|
*
|
|
12
12
|
* @returns {string} A fully constructed URL string. Returns an empty string if the domain is invalid.
|
|
13
|
+
* @deprecated
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* getDomainURL('example.com', 443); // "https://example.com"
|
|
@@ -15,6 +15,7 @@ var _ = require('lodash');
|
|
|
15
15
|
* @param {boolean} [options.isFirebase=false] - Enable detection for Firebase environments (e.g., Fastly).
|
|
16
16
|
*
|
|
17
17
|
* @returns {IpResult} An object containing the list of IP addresses and the detection source type.
|
|
18
|
+
* @deprecated
|
|
18
19
|
*
|
|
19
20
|
* @example
|
|
20
21
|
* const ipInfo = userIp(req);
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* @param {boolean} [options.isFirebase=false] - Enable detection for Firebase environments (e.g., Fastly).
|
|
11
11
|
*
|
|
12
12
|
* @returns {IpResult} An object containing the list of IP addresses and the detection source type.
|
|
13
|
+
* @deprecated
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* const ipInfo = userIp(req);
|
|
@@ -11,6 +11,7 @@ import _ from 'lodash';
|
|
|
11
11
|
* @param {boolean} [options.isFirebase=false] - Enable detection for Firebase environments (e.g., Fastly).
|
|
12
12
|
*
|
|
13
13
|
* @returns {IpResult} An object containing the list of IP addresses and the detection source type.
|
|
14
|
+
* @deprecated
|
|
14
15
|
*
|
|
15
16
|
* @example
|
|
16
17
|
* const ipInfo = userIp(req);
|