@splendidlabz/utils 1.12.0 → 1.12.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/dist/cjs/lib/http/index.cjs +100 -0
- package/dist/cjs/lib/http/status-text.cjs +98 -0
- package/dist/cjs/lib/index.cjs +444 -9
- package/dist/cjs/lib/promises/index.cjs +72 -15
- package/dist/cjs/lib/promises/reject.cjs +72 -13
- package/dist/cjs/lib/strings/index.cjs +368 -6
- package/dist/cjs/lib/strings/pluralize.cjs +372 -14
- package/dist/cjs/lib/strings/query-string.cjs +0 -6
- package/dist/esm/lib/http/index.js +1 -0
- package/dist/esm/lib/http/status-text.js +72 -0
- package/dist/esm/lib/index.js +1 -0
- package/dist/esm/lib/promises/reject.js +2 -2
- package/dist/esm/lib/strings/pluralize.js +366 -3
- package/dist/esm/lib/strings/query-string.js +0 -5
- package/dist/types/lib/http/index.d.cts +1 -0
- package/dist/types/lib/http/status-text.d.cts +73 -0
- package/dist/types/lib/index.d.cts +3 -2
- package/dist/types/lib/strings/index.d.cts +2 -2
- package/dist/types/lib/strings/pluralize.d.cts +24 -2
- package/dist/types/lib/strings/query-string.d.cts +1 -2
- package/package.json +2 -4
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/lib/http/index.js
|
|
20
|
+
var http_exports = {};
|
|
21
|
+
__export(http_exports, {
|
|
22
|
+
statusText: () => statusText,
|
|
23
|
+
statusTexts: () => statusTexts
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(http_exports);
|
|
26
|
+
|
|
27
|
+
// src/lib/http/status-text.js
|
|
28
|
+
var statusTexts = {
|
|
29
|
+
100: "Continue",
|
|
30
|
+
101: "Switching Protocols",
|
|
31
|
+
102: "Processing",
|
|
32
|
+
103: "Early Hints",
|
|
33
|
+
200: "OK",
|
|
34
|
+
201: "Created",
|
|
35
|
+
202: "Accepted",
|
|
36
|
+
203: "Non-Authoritative Information",
|
|
37
|
+
204: "No Content",
|
|
38
|
+
205: "Reset Content",
|
|
39
|
+
206: "Partial Content",
|
|
40
|
+
207: "Multi-Status",
|
|
41
|
+
208: "Already Reported",
|
|
42
|
+
226: "IM Used",
|
|
43
|
+
300: "Multiple Choices",
|
|
44
|
+
301: "Moved Permanently",
|
|
45
|
+
302: "Found",
|
|
46
|
+
303: "See Other",
|
|
47
|
+
304: "Not Modified",
|
|
48
|
+
305: "Use Proxy",
|
|
49
|
+
307: "Temporary Redirect",
|
|
50
|
+
308: "Permanent Redirect",
|
|
51
|
+
400: "Bad Request",
|
|
52
|
+
401: "Unauthorized",
|
|
53
|
+
402: "Payment Required",
|
|
54
|
+
403: "Forbidden",
|
|
55
|
+
404: "Not Found",
|
|
56
|
+
405: "Method Not Allowed",
|
|
57
|
+
406: "Not Acceptable",
|
|
58
|
+
407: "Proxy Authentication Required",
|
|
59
|
+
408: "Request Timeout",
|
|
60
|
+
409: "Conflict",
|
|
61
|
+
410: "Gone",
|
|
62
|
+
411: "Length Required",
|
|
63
|
+
412: "Precondition Failed",
|
|
64
|
+
413: "Payload Too Large",
|
|
65
|
+
414: "URI Too Long",
|
|
66
|
+
415: "Unsupported Media Type",
|
|
67
|
+
416: "Range Not Satisfiable",
|
|
68
|
+
417: "Expectation Failed",
|
|
69
|
+
418: "I'm a Teapot",
|
|
70
|
+
421: "Misdirected Request",
|
|
71
|
+
422: "Unprocessable Entity",
|
|
72
|
+
423: "Locked",
|
|
73
|
+
424: "Failed Dependency",
|
|
74
|
+
425: "Too Early",
|
|
75
|
+
426: "Upgrade Required",
|
|
76
|
+
428: "Precondition Required",
|
|
77
|
+
429: "Too Many Requests",
|
|
78
|
+
431: "Request Header Fields Too Large",
|
|
79
|
+
451: "Unavailable For Legal Reasons",
|
|
80
|
+
500: "Internal Server Error",
|
|
81
|
+
501: "Not Implemented",
|
|
82
|
+
502: "Bad Gateway",
|
|
83
|
+
503: "Service Unavailable",
|
|
84
|
+
504: "Gateway Timeout",
|
|
85
|
+
505: "HTTP Version Not Supported",
|
|
86
|
+
506: "Variant Also Negotiates",
|
|
87
|
+
507: "Insufficient Storage",
|
|
88
|
+
508: "Loop Detected",
|
|
89
|
+
509: "Bandwidth Limit Exceeded",
|
|
90
|
+
510: "Not Extended",
|
|
91
|
+
511: "Network Authentication Required"
|
|
92
|
+
};
|
|
93
|
+
function statusText(code) {
|
|
94
|
+
return statusTexts[code];
|
|
95
|
+
}
|
|
96
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
97
|
+
0 && (module.exports = {
|
|
98
|
+
statusText,
|
|
99
|
+
statusTexts
|
|
100
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/lib/http/status-text.js
|
|
20
|
+
var status_text_exports = {};
|
|
21
|
+
__export(status_text_exports, {
|
|
22
|
+
statusText: () => statusText,
|
|
23
|
+
statusTexts: () => statusTexts
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(status_text_exports);
|
|
26
|
+
var statusTexts = {
|
|
27
|
+
100: "Continue",
|
|
28
|
+
101: "Switching Protocols",
|
|
29
|
+
102: "Processing",
|
|
30
|
+
103: "Early Hints",
|
|
31
|
+
200: "OK",
|
|
32
|
+
201: "Created",
|
|
33
|
+
202: "Accepted",
|
|
34
|
+
203: "Non-Authoritative Information",
|
|
35
|
+
204: "No Content",
|
|
36
|
+
205: "Reset Content",
|
|
37
|
+
206: "Partial Content",
|
|
38
|
+
207: "Multi-Status",
|
|
39
|
+
208: "Already Reported",
|
|
40
|
+
226: "IM Used",
|
|
41
|
+
300: "Multiple Choices",
|
|
42
|
+
301: "Moved Permanently",
|
|
43
|
+
302: "Found",
|
|
44
|
+
303: "See Other",
|
|
45
|
+
304: "Not Modified",
|
|
46
|
+
305: "Use Proxy",
|
|
47
|
+
307: "Temporary Redirect",
|
|
48
|
+
308: "Permanent Redirect",
|
|
49
|
+
400: "Bad Request",
|
|
50
|
+
401: "Unauthorized",
|
|
51
|
+
402: "Payment Required",
|
|
52
|
+
403: "Forbidden",
|
|
53
|
+
404: "Not Found",
|
|
54
|
+
405: "Method Not Allowed",
|
|
55
|
+
406: "Not Acceptable",
|
|
56
|
+
407: "Proxy Authentication Required",
|
|
57
|
+
408: "Request Timeout",
|
|
58
|
+
409: "Conflict",
|
|
59
|
+
410: "Gone",
|
|
60
|
+
411: "Length Required",
|
|
61
|
+
412: "Precondition Failed",
|
|
62
|
+
413: "Payload Too Large",
|
|
63
|
+
414: "URI Too Long",
|
|
64
|
+
415: "Unsupported Media Type",
|
|
65
|
+
416: "Range Not Satisfiable",
|
|
66
|
+
417: "Expectation Failed",
|
|
67
|
+
418: "I'm a Teapot",
|
|
68
|
+
421: "Misdirected Request",
|
|
69
|
+
422: "Unprocessable Entity",
|
|
70
|
+
423: "Locked",
|
|
71
|
+
424: "Failed Dependency",
|
|
72
|
+
425: "Too Early",
|
|
73
|
+
426: "Upgrade Required",
|
|
74
|
+
428: "Precondition Required",
|
|
75
|
+
429: "Too Many Requests",
|
|
76
|
+
431: "Request Header Fields Too Large",
|
|
77
|
+
451: "Unavailable For Legal Reasons",
|
|
78
|
+
500: "Internal Server Error",
|
|
79
|
+
501: "Not Implemented",
|
|
80
|
+
502: "Bad Gateway",
|
|
81
|
+
503: "Service Unavailable",
|
|
82
|
+
504: "Gateway Timeout",
|
|
83
|
+
505: "HTTP Version Not Supported",
|
|
84
|
+
506: "Variant Also Negotiates",
|
|
85
|
+
507: "Insufficient Storage",
|
|
86
|
+
508: "Loop Detected",
|
|
87
|
+
509: "Bandwidth Limit Exceeded",
|
|
88
|
+
510: "Not Extended",
|
|
89
|
+
511: "Network Authentication Required"
|
|
90
|
+
};
|
|
91
|
+
function statusText(code) {
|
|
92
|
+
return statusTexts[code];
|
|
93
|
+
}
|
|
94
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
+
0 && (module.exports = {
|
|
96
|
+
statusText,
|
|
97
|
+
statusTexts
|
|
98
|
+
});
|