@heyform-inc/utils 1.3.0 → 1.3.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/index.d.mts +151 -11
- package/dist/index.d.ts +151 -11
- package/dist/index.js +279 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +252 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +38 -13
package/dist/index.js
CHANGED
|
@@ -574,6 +574,217 @@ function datePeriod(start, value = 1, unit = "month") {
|
|
|
574
574
|
return unixDate(start).add(value, unit).unix();
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
+
// src/error.ts
|
|
578
|
+
var HttpStatus = /* @__PURE__ */ ((HttpStatus2) => {
|
|
579
|
+
HttpStatus2[HttpStatus2["CONTINUE"] = 100] = "CONTINUE";
|
|
580
|
+
HttpStatus2[HttpStatus2["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
581
|
+
HttpStatus2[HttpStatus2["PROCESSING"] = 102] = "PROCESSING";
|
|
582
|
+
HttpStatus2[HttpStatus2["EARLYHINTS"] = 103] = "EARLYHINTS";
|
|
583
|
+
HttpStatus2[HttpStatus2["OK"] = 200] = "OK";
|
|
584
|
+
HttpStatus2[HttpStatus2["CREATED"] = 201] = "CREATED";
|
|
585
|
+
HttpStatus2[HttpStatus2["ACCEPTED"] = 202] = "ACCEPTED";
|
|
586
|
+
HttpStatus2[HttpStatus2["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
|
|
587
|
+
HttpStatus2[HttpStatus2["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
588
|
+
HttpStatus2[HttpStatus2["RESET_CONTENT"] = 205] = "RESET_CONTENT";
|
|
589
|
+
HttpStatus2[HttpStatus2["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
|
|
590
|
+
HttpStatus2[HttpStatus2["MULTI_STATUS"] = 207] = "MULTI_STATUS";
|
|
591
|
+
HttpStatus2[HttpStatus2["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
|
|
592
|
+
HttpStatus2[HttpStatus2["CONTENT_DIFFERENT"] = 210] = "CONTENT_DIFFERENT";
|
|
593
|
+
HttpStatus2[HttpStatus2["AMBIGUOUS"] = 300] = "AMBIGUOUS";
|
|
594
|
+
HttpStatus2[HttpStatus2["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
595
|
+
HttpStatus2[HttpStatus2["FOUND"] = 302] = "FOUND";
|
|
596
|
+
HttpStatus2[HttpStatus2["SEE_OTHER"] = 303] = "SEE_OTHER";
|
|
597
|
+
HttpStatus2[HttpStatus2["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
598
|
+
HttpStatus2[HttpStatus2["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
|
|
599
|
+
HttpStatus2[HttpStatus2["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
|
|
600
|
+
HttpStatus2[HttpStatus2["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
601
|
+
HttpStatus2[HttpStatus2["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
602
|
+
HttpStatus2[HttpStatus2["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
603
|
+
HttpStatus2[HttpStatus2["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
604
|
+
HttpStatus2[HttpStatus2["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
605
|
+
HttpStatus2[HttpStatus2["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
606
|
+
HttpStatus2[HttpStatus2["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
607
|
+
HttpStatus2[HttpStatus2["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
608
|
+
HttpStatus2[HttpStatus2["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
609
|
+
HttpStatus2[HttpStatus2["CONFLICT"] = 409] = "CONFLICT";
|
|
610
|
+
HttpStatus2[HttpStatus2["GONE"] = 410] = "GONE";
|
|
611
|
+
HttpStatus2[HttpStatus2["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
|
|
612
|
+
HttpStatus2[HttpStatus2["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
613
|
+
HttpStatus2[HttpStatus2["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
614
|
+
HttpStatus2[HttpStatus2["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
|
|
615
|
+
HttpStatus2[HttpStatus2["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
616
|
+
HttpStatus2[HttpStatus2["REQUESTED_RANGE_NOT_SATISFIABLE"] = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE";
|
|
617
|
+
HttpStatus2[HttpStatus2["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
|
|
618
|
+
HttpStatus2[HttpStatus2["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
|
|
619
|
+
HttpStatus2[HttpStatus2["MISDIRECTED"] = 421] = "MISDIRECTED";
|
|
620
|
+
HttpStatus2[HttpStatus2["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
621
|
+
HttpStatus2[HttpStatus2["LOCKED"] = 423] = "LOCKED";
|
|
622
|
+
HttpStatus2[HttpStatus2["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
|
|
623
|
+
HttpStatus2[HttpStatus2["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
|
|
624
|
+
HttpStatus2[HttpStatus2["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
625
|
+
HttpStatus2[HttpStatus2["UNRECOVERABLE_ERROR"] = 456] = "UNRECOVERABLE_ERROR";
|
|
626
|
+
HttpStatus2[HttpStatus2["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
627
|
+
HttpStatus2[HttpStatus2["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
628
|
+
HttpStatus2[HttpStatus2["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
629
|
+
HttpStatus2[HttpStatus2["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
630
|
+
HttpStatus2[HttpStatus2["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
631
|
+
HttpStatus2[HttpStatus2["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
632
|
+
HttpStatus2[HttpStatus2["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
|
|
633
|
+
HttpStatus2[HttpStatus2["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
|
|
634
|
+
return HttpStatus2;
|
|
635
|
+
})(HttpStatus || {});
|
|
636
|
+
var HttpError = class extends Error {
|
|
637
|
+
constructor(message, { status, code, errors }) {
|
|
638
|
+
super(message);
|
|
639
|
+
this.name = "HttpError";
|
|
640
|
+
Object.defineProperty(this, "status", {
|
|
641
|
+
value: status ?? 500 /* INTERNAL_SERVER_ERROR */,
|
|
642
|
+
writable: false,
|
|
643
|
+
enumerable: true,
|
|
644
|
+
configurable: false
|
|
645
|
+
});
|
|
646
|
+
Object.defineProperty(this, "code", {
|
|
647
|
+
value: code || "HTTP_ERROR",
|
|
648
|
+
writable: false,
|
|
649
|
+
enumerable: true,
|
|
650
|
+
configurable: false
|
|
651
|
+
});
|
|
652
|
+
Object.defineProperty(this, "errors", {
|
|
653
|
+
value: errors,
|
|
654
|
+
writable: false,
|
|
655
|
+
enumerable: true,
|
|
656
|
+
configurable: false
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
getStatus() {
|
|
660
|
+
return this.status;
|
|
661
|
+
}
|
|
662
|
+
getCode() {
|
|
663
|
+
return this.code;
|
|
664
|
+
}
|
|
665
|
+
getErrors() {
|
|
666
|
+
return this.errors;
|
|
667
|
+
}
|
|
668
|
+
toJSON() {
|
|
669
|
+
return {
|
|
670
|
+
status: this.status,
|
|
671
|
+
code: this.code,
|
|
672
|
+
message: this.message,
|
|
673
|
+
errors: this.errors
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
var BadGatewayError = class extends HttpError {
|
|
678
|
+
constructor(message = "Bad Gateway", code = "BAD_GATEWAY", errors) {
|
|
679
|
+
super(message, { status: 502 /* BAD_GATEWAY */, code, errors });
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
var BadRequestError = class extends HttpError {
|
|
683
|
+
constructor(message = "Bad Request", code = "BAD_REQUEST", errors) {
|
|
684
|
+
super(message, { status: 400 /* BAD_REQUEST */, code, errors });
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
var ConflictError = class extends HttpError {
|
|
688
|
+
constructor(message = "Conflict", code = "CONFLICT", errors) {
|
|
689
|
+
super(message, { status: 409 /* CONFLICT */, code, errors });
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
var ForbiddenError = class extends HttpError {
|
|
693
|
+
constructor(message = "Forbidden", code = "FORBIDDEN", errors) {
|
|
694
|
+
super(message, { status: 403 /* FORBIDDEN */, code, errors });
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
var TooManyRequestsError = class extends HttpError {
|
|
698
|
+
constructor(message = "Too Many Requests", code = "TOO_MANY_REQUESTS", errors) {
|
|
699
|
+
super(message, { status: 429 /* TOO_MANY_REQUESTS */, code, errors });
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
var GatewayTimeoutError = class extends HttpError {
|
|
703
|
+
constructor(message = "Gateway Timeout", code = "GATEWAY_TIMEOUT", errors) {
|
|
704
|
+
super(message, { status: 504 /* GATEWAY_TIMEOUT */, code, errors });
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
var GoneError = class extends HttpError {
|
|
708
|
+
constructor(message = "Gone", code = "GONE", errors) {
|
|
709
|
+
super(message, { status: 410 /* GONE */, code, errors });
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
var HttpVersionNotSupportedError = class extends HttpError {
|
|
713
|
+
constructor(message = "HTTP Version Not Supported", code = "HTTP_VERSION_NOT_SUPPORTED", errors) {
|
|
714
|
+
super(message, { status: 505 /* HTTP_VERSION_NOT_SUPPORTED */, code, errors });
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
var ImATeapotError = class extends HttpError {
|
|
718
|
+
constructor(message = "I'm a teapot", code = "I_AM_A_TEAPOT", errors) {
|
|
719
|
+
super(message, { status: 418 /* I_AM_A_TEAPOT */, code, errors });
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
var InternalServerError = class extends HttpError {
|
|
723
|
+
constructor(message = "Internal Server Error", code = "INTERNAL_SERVER_ERROR", errors) {
|
|
724
|
+
super(message, { status: 500 /* INTERNAL_SERVER_ERROR */, code, errors });
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
var MethodNotAllowedError = class extends HttpError {
|
|
728
|
+
constructor(message = "Method Not Allowed", code = "METHOD_NOT_ALLOWED", errors) {
|
|
729
|
+
super(message, { status: 405 /* METHOD_NOT_ALLOWED */, code, errors });
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
var MisdirectedError = class extends HttpError {
|
|
733
|
+
constructor(message = "Misdirected Request", code = "MISDIRECTED", errors) {
|
|
734
|
+
super(message, { status: 421 /* MISDIRECTED */, code, errors });
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
var NotAcceptableError = class extends HttpError {
|
|
738
|
+
constructor(message = "Not Acceptable", code = "NOT_ACCEPTABLE", errors) {
|
|
739
|
+
super(message, { status: 406 /* NOT_ACCEPTABLE */, code, errors });
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
var NotFoundError = class extends HttpError {
|
|
743
|
+
constructor(message = "Not Found", code = "NOT_FOUND", errors) {
|
|
744
|
+
super(message, { status: 404 /* NOT_FOUND */, code, errors });
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
var NotImplementedError = class extends HttpError {
|
|
748
|
+
constructor(message = "Not Implemented", code = "NOT_IMPLEMENTED", errors) {
|
|
749
|
+
super(message, { status: 501 /* NOT_IMPLEMENTED */, code, errors });
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
var PayloadTooLargeError = class extends HttpError {
|
|
753
|
+
constructor(message = "Payload Too Large", code = "PAYLOAD_TOO_LARGE", errors) {
|
|
754
|
+
super(message, { status: 413 /* PAYLOAD_TOO_LARGE */, code, errors });
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
var PreconditionFailedError = class extends HttpError {
|
|
758
|
+
constructor(message = "Precondition Failed", code = "PRECONDITION_FAILED", errors) {
|
|
759
|
+
super(message, { status: 412 /* PRECONDITION_FAILED */, code, errors });
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
var RequestTimeoutError = class extends HttpError {
|
|
763
|
+
constructor(message = "Request Timeout", code = "REQUEST_TIMEOUT", errors) {
|
|
764
|
+
super(message, { status: 408 /* REQUEST_TIMEOUT */, code, errors });
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
var ServiceUnavailableError = class extends HttpError {
|
|
768
|
+
constructor(message = "Service Unavailable", code = "SERVICE_UNAVAILABLE", errors) {
|
|
769
|
+
super(message, { status: 503 /* SERVICE_UNAVAILABLE */, code, errors });
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
var UnauthorizedError = class extends HttpError {
|
|
773
|
+
constructor(message = "Unauthorized", code = "UNAUTHORIZED", errors) {
|
|
774
|
+
super(message, { status: 401 /* UNAUTHORIZED */, code, errors });
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
var UnprocessableEntityError = class extends HttpError {
|
|
778
|
+
constructor(message = "Unprocessable Entity", code = "UNPROCESSABLE_ENTITY", errors) {
|
|
779
|
+
super(message, { status: 422 /* UNPROCESSABLE_ENTITY */, code, errors });
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
var UnsupportedMediaTypeError = class extends HttpError {
|
|
783
|
+
constructor(message = "Unsupported Media Type", code = "UNSUPPORTED_MEDIA_TYPE", errors) {
|
|
784
|
+
super(message, { status: 415 /* UNSUPPORTED_MEDIA_TYPE */, code, errors });
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
|
|
577
788
|
// src/mime-db.json
|
|
578
789
|
var mime_db_default = {
|
|
579
790
|
"123": "application/vnd.lotus-1-2-3",
|
|
@@ -1845,15 +2056,23 @@ function excludeObject(target, excludes = []) {
|
|
|
1845
2056
|
return pickObject(target, [], excludes);
|
|
1846
2057
|
}
|
|
1847
2058
|
function pickValidValues(target, fields) {
|
|
2059
|
+
if (!isObject(target) || !isArray(fields)) {
|
|
2060
|
+
return {};
|
|
2061
|
+
}
|
|
1848
2062
|
const dist = {};
|
|
1849
2063
|
fields.forEach((field) => {
|
|
1850
2064
|
let key = String(field);
|
|
1851
2065
|
let alias;
|
|
1852
2066
|
if (isArray(field)) {
|
|
2067
|
+
if (field.length === 0 || isNil(field[0])) {
|
|
2068
|
+
return;
|
|
2069
|
+
}
|
|
1853
2070
|
key = field[0];
|
|
1854
|
-
if (field.length > 1) {
|
|
1855
|
-
alias = field[1];
|
|
2071
|
+
if (field.length > 1 && !isNil(field[1])) {
|
|
2072
|
+
alias = String(field[1]);
|
|
1856
2073
|
}
|
|
2074
|
+
} else if (isNil(field)) {
|
|
2075
|
+
return;
|
|
1857
2076
|
}
|
|
1858
2077
|
let value = target[key];
|
|
1859
2078
|
if (isValid(value)) {
|
|
@@ -1881,16 +2100,22 @@ function removeObjectNil(target) {
|
|
|
1881
2100
|
return newObj;
|
|
1882
2101
|
}
|
|
1883
2102
|
function copyObjectValues(target, dist, keyMaps) {
|
|
1884
|
-
if (!isObject(target) || !isObject(dist)) {
|
|
2103
|
+
if (!isObject(target) || !isObject(dist) || !isArray(keyMaps)) {
|
|
1885
2104
|
return;
|
|
1886
2105
|
}
|
|
1887
2106
|
for (const keys of keyMaps) {
|
|
1888
2107
|
let targetKey;
|
|
1889
2108
|
let distKey;
|
|
1890
2109
|
if (isArray(keys)) {
|
|
1891
|
-
|
|
1892
|
-
|
|
2110
|
+
if (keys.length === 0 || isNil(keys[0])) {
|
|
2111
|
+
continue;
|
|
2112
|
+
}
|
|
2113
|
+
targetKey = String(keys[0]);
|
|
2114
|
+
distKey = !isNil(keys[1]) ? String(keys[1]) : targetKey;
|
|
1893
2115
|
} else {
|
|
2116
|
+
if (isNil(keys)) {
|
|
2117
|
+
continue;
|
|
2118
|
+
}
|
|
1894
2119
|
targetKey = String(keys);
|
|
1895
2120
|
distKey = targetKey;
|
|
1896
2121
|
}
|
|
@@ -1905,52 +2130,29 @@ function copyObjectValues(target, dist, keyMaps) {
|
|
|
1905
2130
|
}
|
|
1906
2131
|
|
|
1907
2132
|
// src/random.ts
|
|
1908
|
-
var
|
|
1909
|
-
var
|
|
1910
|
-
var
|
|
1911
|
-
var
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
RandomType2[RandomType2["UPPER"] = 1] = "UPPER";
|
|
1916
|
-
RandomType2[RandomType2["NUMERIC"] = 2] = "NUMERIC";
|
|
1917
|
-
RandomType2[RandomType2["HEXIC"] = 3] = "HEXIC";
|
|
1918
|
-
RandomType2[RandomType2["LOWER_NUMERIC"] = 4] = "LOWER_NUMERIC";
|
|
1919
|
-
RandomType2[RandomType2["UPPER_NUMERIC"] = 5] = "UPPER_NUMERIC";
|
|
1920
|
-
RandomType2[RandomType2["ALPHANUMERIC"] = 6] = "ALPHANUMERIC";
|
|
1921
|
-
return RandomType2;
|
|
1922
|
-
})(RandomType || {});
|
|
1923
|
-
function random(len = length * 2, type2 = 6 /* ALPHANUMERIC */) {
|
|
1924
|
-
let alphabet = numeric + lower + upper;
|
|
1925
|
-
switch (type2) {
|
|
1926
|
-
case 0 /* LOWER */:
|
|
1927
|
-
alphabet = lower;
|
|
1928
|
-
break;
|
|
1929
|
-
case 1 /* UPPER */:
|
|
1930
|
-
alphabet = upper;
|
|
1931
|
-
break;
|
|
1932
|
-
case 3 /* HEXIC */:
|
|
1933
|
-
alphabet = hexic;
|
|
1934
|
-
break;
|
|
1935
|
-
case 2 /* NUMERIC */:
|
|
1936
|
-
alphabet = numeric;
|
|
1937
|
-
break;
|
|
1938
|
-
case 4 /* LOWER_NUMERIC */:
|
|
1939
|
-
alphabet = lower + numeric;
|
|
1940
|
-
break;
|
|
1941
|
-
case 5 /* UPPER_NUMERIC */:
|
|
1942
|
-
alphabet = upper + numeric;
|
|
1943
|
-
break;
|
|
1944
|
-
case 6 /* ALPHANUMERIC */:
|
|
1945
|
-
alphabet = lower + upper + numeric;
|
|
1946
|
-
break;
|
|
1947
|
-
}
|
|
1948
|
-
let str = "";
|
|
1949
|
-
const alphabetLength = alphabet.length;
|
|
2133
|
+
var NUMERIC = "0123456789";
|
|
2134
|
+
var HEXIC = "0123456789abcdef";
|
|
2135
|
+
var ALPHA = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
2136
|
+
var ALPHANUMERIC = ALPHA + NUMERIC;
|
|
2137
|
+
function random(len = 6, alphabet = ALPHANUMERIC) {
|
|
2138
|
+
let result = "";
|
|
2139
|
+
const length = alphabet.length;
|
|
1950
2140
|
for (let i = 0; i < len; i++) {
|
|
1951
|
-
|
|
2141
|
+
result += alphabet.charAt(Math.floor(Math.random() * length));
|
|
1952
2142
|
}
|
|
1953
|
-
return
|
|
2143
|
+
return result;
|
|
2144
|
+
}
|
|
2145
|
+
function randomHexic(len) {
|
|
2146
|
+
return random(len, HEXIC);
|
|
2147
|
+
}
|
|
2148
|
+
function randomAlpha(len) {
|
|
2149
|
+
return random(len, ALPHA);
|
|
2150
|
+
}
|
|
2151
|
+
function randomNumeric(len) {
|
|
2152
|
+
return random(len, NUMERIC);
|
|
2153
|
+
}
|
|
2154
|
+
function randomNumber(min, max) {
|
|
2155
|
+
return Math.ceil(Math.random() * (max - min) + min);
|
|
1954
2156
|
}
|
|
1955
2157
|
function slugify(text, options) {
|
|
1956
2158
|
return slug__default.default(text, {
|
|
@@ -1976,9 +2178,32 @@ Object.defineProperty(exports, "uuidv5", {
|
|
|
1976
2178
|
enumerable: true,
|
|
1977
2179
|
get: function () { return uuid.v5; }
|
|
1978
2180
|
});
|
|
2181
|
+
exports.BadGatewayError = BadGatewayError;
|
|
2182
|
+
exports.BadRequestError = BadRequestError;
|
|
2183
|
+
exports.ConflictError = ConflictError;
|
|
1979
2184
|
exports.FILE_MIME_TYPES = FILE_MIME_TYPES;
|
|
2185
|
+
exports.ForbiddenError = ForbiddenError;
|
|
2186
|
+
exports.GatewayTimeoutError = GatewayTimeoutError;
|
|
2187
|
+
exports.GoneError = GoneError;
|
|
2188
|
+
exports.HttpError = HttpError;
|
|
2189
|
+
exports.HttpStatus = HttpStatus;
|
|
2190
|
+
exports.HttpVersionNotSupportedError = HttpVersionNotSupportedError;
|
|
1980
2191
|
exports.IMAGE_MIME_TYPES = IMAGE_MIME_TYPES;
|
|
1981
|
-
exports.
|
|
2192
|
+
exports.ImATeapotError = ImATeapotError;
|
|
2193
|
+
exports.InternalServerError = InternalServerError;
|
|
2194
|
+
exports.MethodNotAllowedError = MethodNotAllowedError;
|
|
2195
|
+
exports.MisdirectedError = MisdirectedError;
|
|
2196
|
+
exports.NotAcceptableError = NotAcceptableError;
|
|
2197
|
+
exports.NotFoundError = NotFoundError;
|
|
2198
|
+
exports.NotImplementedError = NotImplementedError;
|
|
2199
|
+
exports.PayloadTooLargeError = PayloadTooLargeError;
|
|
2200
|
+
exports.PreconditionFailedError = PreconditionFailedError;
|
|
2201
|
+
exports.RequestTimeoutError = RequestTimeoutError;
|
|
2202
|
+
exports.ServiceUnavailableError = ServiceUnavailableError;
|
|
2203
|
+
exports.TooManyRequestsError = TooManyRequestsError;
|
|
2204
|
+
exports.UnauthorizedError = UnauthorizedError;
|
|
2205
|
+
exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
2206
|
+
exports.UnsupportedMediaTypeError = UnsupportedMediaTypeError;
|
|
1982
2207
|
exports.alpha = alpha;
|
|
1983
2208
|
exports.alphaHexToRgb = alphaHexToRgb;
|
|
1984
2209
|
exports.bytes = bytes;
|
|
@@ -2017,6 +2242,10 @@ exports.parseNumber = parseNumber;
|
|
|
2017
2242
|
exports.pickObject = pickObject;
|
|
2018
2243
|
exports.pickValidValues = pickValidValues;
|
|
2019
2244
|
exports.random = random;
|
|
2245
|
+
exports.randomAlpha = randomAlpha;
|
|
2246
|
+
exports.randomHexic = randomHexic;
|
|
2247
|
+
exports.randomNumber = randomNumber;
|
|
2248
|
+
exports.randomNumeric = randomNumeric;
|
|
2020
2249
|
exports.removeObjectNil = removeObjectNil;
|
|
2021
2250
|
exports.rgbToHex = rgbToHex;
|
|
2022
2251
|
exports.slugify = slugify;
|