umt 2.0.0 → 2.1.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.
Files changed (139) hide show
  1. package/module/Consts/httpStatus/httpClientErrorStatus.d.ts +28 -0
  2. package/module/Consts/httpStatus/httpClientErrorStatus.js +27 -0
  3. package/module/Consts/httpStatus/httpClientErrorStatus.js.map +1 -0
  4. package/module/Consts/httpStatus/httpInformationalStatus.d.ts +8 -0
  5. package/module/Consts/httpStatus/httpInformationalStatus.js +7 -0
  6. package/module/Consts/httpStatus/httpInformationalStatus.js.map +1 -0
  7. package/module/Consts/httpStatus/httpRedirectionStatus.d.ts +11 -0
  8. package/module/Consts/httpStatus/httpRedirectionStatus.js +10 -0
  9. package/module/Consts/httpStatus/httpRedirectionStatus.js.map +1 -0
  10. package/module/Consts/httpStatus/httpServerErrorStatus.d.ts +10 -0
  11. package/module/Consts/httpStatus/httpServerErrorStatus.js +9 -0
  12. package/module/Consts/httpStatus/httpServerErrorStatus.js.map +1 -0
  13. package/module/Consts/httpStatus/httpSuccessStatus.d.ts +11 -0
  14. package/module/Consts/httpStatus/httpSuccessStatus.js +10 -0
  15. package/module/Consts/httpStatus/httpSuccessStatus.js.map +1 -0
  16. package/module/Consts/httpStatus/index.d.ts +57 -0
  17. package/module/Consts/httpStatus/index.js +18 -0
  18. package/module/Consts/httpStatus/index.js.map +1 -0
  19. package/module/Consts/index.d.ts +1 -0
  20. package/module/Consts/index.js +1 -0
  21. package/module/Consts/index.js.map +1 -1
  22. package/module/IP/index.d.ts +1 -0
  23. package/module/IP/index.js +1 -0
  24. package/module/IP/index.js.map +1 -1
  25. package/module/Math/index.d.ts +1 -0
  26. package/module/Math/index.js +1 -0
  27. package/module/Math/index.js.map +1 -1
  28. package/module/String/index.d.ts +2 -1
  29. package/module/String/index.js +2 -1
  30. package/module/String/index.js.map +1 -1
  31. package/module/Time/convertTime.d.ts +2 -1
  32. package/module/Time/convertTime.js +5 -2
  33. package/module/Time/convertTime.js.map +1 -1
  34. package/module/Time/index.d.ts +1 -0
  35. package/module/Time/index.js +1 -0
  36. package/module/Time/index.js.map +1 -1
  37. package/module/Time/normalizeTimeUnit.d.ts +10 -0
  38. package/module/Time/normalizeTimeUnit.js +14 -0
  39. package/module/Time/normalizeTimeUnit.js.map +1 -0
  40. package/module/Validate/index.d.ts +2 -1
  41. package/module/Validate/index.js +2 -1
  42. package/module/Validate/index.js.map +1 -1
  43. package/module/Validate/isDictionaryObject.d.ts +10 -0
  44. package/module/Validate/isDictionaryObject.js +11 -0
  45. package/module/Validate/isDictionaryObject.js.map +1 -0
  46. package/module/Validate/isEqual.d.ts +23 -0
  47. package/module/Validate/isEqual.js +24 -0
  48. package/module/Validate/isEqual.js.map +1 -0
  49. package/module/Validate/object/core.js +2 -2
  50. package/module/Validate/object/core.js.map +1 -1
  51. package/module/es5/Consts/httpStatus/httpClientErrorStatus.d.ts +28 -0
  52. package/module/es5/Consts/httpStatus/httpClientErrorStatus.js +32 -0
  53. package/module/es5/Consts/httpStatus/httpInformationalStatus.d.ts +8 -0
  54. package/module/es5/Consts/httpStatus/httpInformationalStatus.js +12 -0
  55. package/module/es5/Consts/httpStatus/httpRedirectionStatus.d.ts +11 -0
  56. package/module/es5/Consts/httpStatus/httpRedirectionStatus.js +15 -0
  57. package/module/es5/Consts/httpStatus/httpServerErrorStatus.d.ts +10 -0
  58. package/module/es5/Consts/httpStatus/httpServerErrorStatus.js +14 -0
  59. package/module/es5/Consts/httpStatus/httpSuccessStatus.d.ts +11 -0
  60. package/module/es5/Consts/httpStatus/httpSuccessStatus.js +15 -0
  61. package/module/es5/Consts/httpStatus/index.d.ts +57 -0
  62. package/module/es5/Consts/httpStatus/index.js +48 -0
  63. package/module/es5/Consts/index.d.ts +1 -0
  64. package/module/es5/Consts/index.js +11 -0
  65. package/module/es5/IP/index.d.ts +1 -0
  66. package/module/es5/IP/index.js +11 -0
  67. package/module/es5/Math/index.d.ts +1 -0
  68. package/module/es5/Math/index.js +11 -0
  69. package/module/es5/String/index.d.ts +2 -1
  70. package/module/es5/String/index.js +22 -11
  71. package/module/es5/Time/convertTime.d.ts +2 -1
  72. package/module/es5/Time/convertTime.js +5 -2
  73. package/module/es5/Time/index.d.ts +1 -0
  74. package/module/es5/Time/index.js +11 -0
  75. package/module/es5/Time/normalizeTimeUnit.d.ts +10 -0
  76. package/module/es5/Time/normalizeTimeUnit.js +51 -0
  77. package/module/es5/Validate/index.d.ts +2 -1
  78. package/module/es5/Validate/index.js +22 -11
  79. package/module/es5/Validate/isDictionaryObject.d.ts +10 -0
  80. package/module/es5/Validate/{isObject.js → isDictionaryObject.js} +6 -6
  81. package/module/es5/Validate/isEqual.d.ts +23 -0
  82. package/module/es5/Validate/isEqual.js +31 -0
  83. package/module/es5/Validate/object/core.js +2 -2
  84. package/module/es5/tests/unit/Consts/clock.test.js +12 -12
  85. package/module/es5/tests/unit/Consts/httpClientErrorStatus.test.js +33 -0
  86. package/module/es5/tests/unit/Consts/httpInformationalStatus.test.d.ts +1 -0
  87. package/module/es5/tests/unit/Consts/httpInformationalStatus.test.js +13 -0
  88. package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.d.ts +1 -0
  89. package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.js +16 -0
  90. package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.d.ts +1 -0
  91. package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.js +15 -0
  92. package/module/es5/tests/unit/Consts/httpStatus.test.d.ts +1 -0
  93. package/module/es5/tests/unit/Consts/httpStatus.test.js +73 -0
  94. package/module/es5/tests/unit/Consts/httpSuccessStatus.test.d.ts +1 -0
  95. package/module/es5/tests/unit/Consts/httpSuccessStatus.test.js +16 -0
  96. package/module/es5/tests/unit/Time/convertTime.test.js +99 -1
  97. package/module/es5/tests/unit/Time/normalizeTimeUnit.test.d.ts +1 -0
  98. package/module/es5/tests/unit/Time/normalizeTimeUnit.test.js +29 -0
  99. package/module/es5/tests/unit/Validate/isDictionaryObject.test.d.ts +1 -0
  100. package/module/es5/tests/unit/Validate/{isObject.test.js → isDictionaryObject.test.js} +11 -11
  101. package/module/es5/tests/unit/Validate/isEqual.test.d.ts +1 -0
  102. package/module/es5/tests/unit/Validate/isEqual.test.js +74 -0
  103. package/module/es5/tsconfig.tsbuildinfo +1 -1
  104. package/module/es5/types/enum/getEnumValues.d.ts +1 -0
  105. package/module/es5/types/enum/getEnumValues.js +5 -0
  106. package/module/es5/types/enum/index.d.ts +1 -0
  107. package/module/es5/types/enum/index.js +16 -0
  108. package/module/es5/types/index.d.ts +1 -0
  109. package/module/es5/types/index.js +11 -0
  110. package/module/es5/types/object/index.d.ts +1 -0
  111. package/module/es5/types/object/index.js +11 -0
  112. package/module/es5/types/time/index.d.ts +1 -0
  113. package/module/es5/types/time/index.js +11 -0
  114. package/module/es5/types/time/timeUnitShort.d.ts +4 -0
  115. package/module/es5/types/time/timeUnitShort.js +5 -0
  116. package/module/types/enum/getEnumValues.d.ts +1 -0
  117. package/module/types/enum/getEnumValues.js +2 -0
  118. package/module/types/enum/getEnumValues.js.map +1 -0
  119. package/module/types/enum/index.d.ts +1 -0
  120. package/module/types/enum/index.js +2 -0
  121. package/module/types/enum/index.js.map +1 -0
  122. package/module/types/index.d.ts +1 -0
  123. package/module/types/index.js +1 -0
  124. package/module/types/index.js.map +1 -1
  125. package/module/types/object/index.d.ts +1 -0
  126. package/module/types/object/index.js +1 -0
  127. package/module/types/object/index.js.map +1 -1
  128. package/module/types/time/index.d.ts +1 -0
  129. package/module/types/time/index.js +1 -0
  130. package/module/types/time/index.js.map +1 -1
  131. package/module/types/time/timeUnitShort.d.ts +4 -0
  132. package/module/types/time/timeUnitShort.js +2 -0
  133. package/module/types/time/timeUnitShort.js.map +1 -0
  134. package/package.json +10 -10
  135. package/module/Validate/isObject.d.ts +0 -10
  136. package/module/Validate/isObject.js +0 -11
  137. package/module/Validate/isObject.js.map +0 -1
  138. package/module/es5/Validate/isObject.d.ts +0 -10
  139. /package/module/es5/tests/unit/{Validate/isObject.test.d.ts → Consts/httpClientErrorStatus.test.d.ts} +0 -0
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isEqual = void 0;
7
+ /**
8
+ * Evaluates true strict equality
9
+ * @param {unknown} a
10
+ * @param {unknown} b
11
+ * @returns boolean
12
+ *
13
+ * @example
14
+ * isEqual(1, 1); // true
15
+ * isEqual("test", "test"); // true
16
+ * isEqual(Number.NaN, Number.NaN); // true
17
+ * isEqual(-0, +0); // false
18
+ *
19
+ * @example
20
+ * const obj = { a: 1 };
21
+ * isEqual(obj, obj); // true
22
+ * isEqual(obj, { a: 1 }); // false
23
+ *
24
+ * @example
25
+ * const arr = [1, 2, 3];
26
+ * isEqual(arr, arr); // true
27
+ * isEqual(arr, [1, 2, 3]); // false
28
+ */
29
+ var isEqual = exports.isEqual = function isEqual(a, b) {
30
+ return Object.is(a, b);
31
+ };
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.object = void 0;
7
- var _isObject = require("@/Validate/isObject");
7
+ var _isDictionaryObject = require("@/Validate/isDictionaryObject");
8
8
  var object = exports.object = function object() {
9
9
  var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10
10
  var message = arguments.length > 1 ? arguments[1] : undefined;
11
11
  return function (value) {
12
- if (!(0, _isObject.isObject)(value)) {
12
+ if (!(0, _isDictionaryObject.isDictionaryObject)(value)) {
13
13
  return {
14
14
  validate: false,
15
15
  message: message || "",
@@ -1,38 +1,38 @@
1
1
  "use strict";
2
2
 
3
- var _Consts = require("@/Consts");
3
+ var _clock = require("@/Consts/clock");
4
4
  describe("時間定数のテスト", function () {
5
5
  it("1秒は1000ミリ秒", function () {
6
- expect(_Consts.OneSecondMs).toBe(1000);
6
+ expect(_clock.OneSecondMs).toBe(1000);
7
7
  });
8
8
  it("1分は60000ミリ秒", function () {
9
- expect(_Consts.OneMinuteMs).toBe(60000);
9
+ expect(_clock.OneMinuteMs).toBe(60000);
10
10
  });
11
11
  it("1時間は3600000ミリ秒", function () {
12
- expect(_Consts.OneHourMs).toBe(3600000);
12
+ expect(_clock.OneHourMs).toBe(3600000);
13
13
  });
14
14
  it("1日は86400000ミリ秒", function () {
15
- expect(_Consts.OneDayMs).toBe(86400000);
15
+ expect(_clock.OneDayMs).toBe(86400000);
16
16
  });
17
17
  it("1週間は604800000ミリ秒", function () {
18
- expect(_Consts.OneWeekMs).toBe(604800000);
18
+ expect(_clock.OneWeekMs).toBe(604800000);
19
19
  });
20
20
  it("1ヶ月(28日として)は2419200000ミリ秒", function () {
21
- expect(_Consts.OneMonthMs28).toBe(2419200000);
21
+ expect(_clock.OneMonthMs28).toBe(2419200000);
22
22
  });
23
23
  it("1ヶ月(29日として)は2505600000ミリ秒", function () {
24
- expect(_Consts.OneMonthMs29).toBe(2505600000);
24
+ expect(_clock.OneMonthMs29).toBe(2505600000);
25
25
  });
26
26
  it("1ヶ月(30日として)は2592000000ミリ秒", function () {
27
- expect(_Consts.OneMonthMs).toBe(2592000000);
27
+ expect(_clock.OneMonthMs).toBe(2592000000);
28
28
  });
29
29
  it("1ヶ月(31日として)は2678400000ミリ秒", function () {
30
- expect(_Consts.OneMonthMs31).toBe(2678400000);
30
+ expect(_clock.OneMonthMs31).toBe(2678400000);
31
31
  });
32
32
  it("1年(365日として)は31536000000ミリ秒", function () {
33
- expect(_Consts.OneYearMs).toBe(31536000000);
33
+ expect(_clock.OneYearMs).toBe(31536000000);
34
34
  });
35
35
  it("1年(366日として)は31622400000ミリ秒", function () {
36
- expect(_Consts.OneYearMs366).toBe(31622400000);
36
+ expect(_clock.OneYearMs366).toBe(31622400000);
37
37
  });
38
38
  });
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _httpStatus = require("@/Consts/httpStatus");
4
+ describe("HttpClientErrorStatus", function () {
5
+ describe("4xx Client Error", function () {
6
+ it("should have correct client error status codes", function () {
7
+ expect(_httpStatus.HttpClientErrorStatus.BAD_REQUEST).toBe(400);
8
+ expect(_httpStatus.HttpClientErrorStatus.UNAUTHORIZED).toBe(401);
9
+ expect(_httpStatus.HttpClientErrorStatus.PAYMENT_REQUIRED).toBe(402);
10
+ expect(_httpStatus.HttpClientErrorStatus.FORBIDDEN).toBe(403);
11
+ expect(_httpStatus.HttpClientErrorStatus.NOT_FOUND).toBe(404);
12
+ expect(_httpStatus.HttpClientErrorStatus.METHOD_NOT_ALLOWED).toBe(405);
13
+ expect(_httpStatus.HttpClientErrorStatus.NOT_ACCEPTABLE).toBe(406);
14
+ expect(_httpStatus.HttpClientErrorStatus.PROXY_AUTHENTICATION_REQUIRED).toBe(407);
15
+ expect(_httpStatus.HttpClientErrorStatus.REQUEST_TIMEOUT).toBe(408);
16
+ expect(_httpStatus.HttpClientErrorStatus.CONFLICT).toBe(409);
17
+ expect(_httpStatus.HttpClientErrorStatus.GONE).toBe(410);
18
+ expect(_httpStatus.HttpClientErrorStatus.LENGTH_REQUIRED).toBe(411);
19
+ expect(_httpStatus.HttpClientErrorStatus.PRECONDITION_FAILED).toBe(412);
20
+ expect(_httpStatus.HttpClientErrorStatus.PAYLOAD_TOO_LARGE).toBe(413);
21
+ expect(_httpStatus.HttpClientErrorStatus.URI_TOO_LONG).toBe(414);
22
+ expect(_httpStatus.HttpClientErrorStatus.UNSUPPORTED_MEDIA_TYPE).toBe(415);
23
+ expect(_httpStatus.HttpClientErrorStatus.REQUESTED_RANGE_NOT_SATISFIABLE).toBe(416);
24
+ expect(_httpStatus.HttpClientErrorStatus.EXPECTATION_FAILED).toBe(417);
25
+ expect(_httpStatus.HttpClientErrorStatus.I_AM_A_TEAPOT).toBe(418);
26
+ expect(_httpStatus.HttpClientErrorStatus.MISDIRECTED).toBe(421);
27
+ expect(_httpStatus.HttpClientErrorStatus.UNPROCESSABLE_ENTITY).toBe(422);
28
+ expect(_httpStatus.HttpClientErrorStatus.FAILED_DEPENDENCY).toBe(424);
29
+ expect(_httpStatus.HttpClientErrorStatus.PRECONDITION_REQUIRED).toBe(428);
30
+ expect(_httpStatus.HttpClientErrorStatus.TOO_MANY_REQUESTS).toBe(429);
31
+ });
32
+ });
33
+ });
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _httpStatus = require("@/Consts/httpStatus");
4
+ describe("HttpInformationalStatus", function () {
5
+ describe("1xx Informational", function () {
6
+ it("should have correct informational status codes", function () {
7
+ expect(_httpStatus.HttpInformationalStatus.CONTINUE).toBe(100);
8
+ expect(_httpStatus.HttpInformationalStatus.SWITCHING_PROTOCOLS).toBe(101);
9
+ expect(_httpStatus.HttpInformationalStatus.PROCESSING).toBe(102);
10
+ expect(_httpStatus.HttpInformationalStatus.EARLYHINTS).toBe(103);
11
+ });
12
+ });
13
+ });
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ var _httpStatus = require("@/Consts/httpStatus");
4
+ describe("HttpRedirectionStatus", function () {
5
+ describe("3xx Redirection", function () {
6
+ it("should have correct redirection status codes", function () {
7
+ expect(_httpStatus.HttpRedirectionStatus.AMBIGUOUS).toBe(300);
8
+ expect(_httpStatus.HttpRedirectionStatus.MOVED_PERMANENTLY).toBe(301);
9
+ expect(_httpStatus.HttpRedirectionStatus.FOUND).toBe(302);
10
+ expect(_httpStatus.HttpRedirectionStatus.SEE_OTHER).toBe(303);
11
+ expect(_httpStatus.HttpRedirectionStatus.NOT_MODIFIED).toBe(304);
12
+ expect(_httpStatus.HttpRedirectionStatus.TEMPORARY_REDIRECT).toBe(307);
13
+ expect(_httpStatus.HttpRedirectionStatus.PERMANENT_REDIRECT).toBe(308);
14
+ });
15
+ });
16
+ });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ var _httpStatus = require("@/Consts/httpStatus");
4
+ describe("HttpServerErrorStatus", function () {
5
+ describe("5xx Server Error", function () {
6
+ it("should have correct server error status codes", function () {
7
+ expect(_httpStatus.HttpServerErrorStatus.INTERNAL_SERVER_ERROR).toBe(500);
8
+ expect(_httpStatus.HttpServerErrorStatus.NOT_IMPLEMENTED).toBe(501);
9
+ expect(_httpStatus.HttpServerErrorStatus.BAD_GATEWAY).toBe(502);
10
+ expect(_httpStatus.HttpServerErrorStatus.SERVICE_UNAVAILABLE).toBe(503);
11
+ expect(_httpStatus.HttpServerErrorStatus.GATEWAY_TIMEOUT).toBe(504);
12
+ expect(_httpStatus.HttpServerErrorStatus.HTTP_VERSION_NOT_SUPPORTED).toBe(505);
13
+ });
14
+ });
15
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ var _httpStatus = require("@/Consts/httpStatus");
4
+ describe("HttpStatus", function () {
5
+ describe("1xx Informational", function () {
6
+ it("should have correct informational status codes", function () {
7
+ expect(_httpStatus.HttpStatus.CONTINUE).toBe(100);
8
+ expect(_httpStatus.HttpStatus.SWITCHING_PROTOCOLS).toBe(101);
9
+ expect(_httpStatus.HttpStatus.PROCESSING).toBe(102);
10
+ expect(_httpStatus.HttpStatus.EARLYHINTS).toBe(103);
11
+ });
12
+ });
13
+ describe("2xx Success", function () {
14
+ it("should have correct success status codes", function () {
15
+ expect(_httpStatus.HttpStatus.OK).toBe(200);
16
+ expect(_httpStatus.HttpStatus.CREATED).toBe(201);
17
+ expect(_httpStatus.HttpStatus.ACCEPTED).toBe(202);
18
+ expect(_httpStatus.HttpStatus.NON_AUTHORITATIVE_INFORMATION).toBe(203);
19
+ expect(_httpStatus.HttpStatus.NO_CONTENT).toBe(204);
20
+ expect(_httpStatus.HttpStatus.RESET_CONTENT).toBe(205);
21
+ expect(_httpStatus.HttpStatus.PARTIAL_CONTENT).toBe(206);
22
+ });
23
+ });
24
+ describe("3xx Redirection", function () {
25
+ it("should have correct redirection status codes", function () {
26
+ expect(_httpStatus.HttpStatus.AMBIGUOUS).toBe(300);
27
+ expect(_httpStatus.HttpStatus.MOVED_PERMANENTLY).toBe(301);
28
+ expect(_httpStatus.HttpStatus.FOUND).toBe(302);
29
+ expect(_httpStatus.HttpStatus.SEE_OTHER).toBe(303);
30
+ expect(_httpStatus.HttpStatus.NOT_MODIFIED).toBe(304);
31
+ expect(_httpStatus.HttpStatus.TEMPORARY_REDIRECT).toBe(307);
32
+ expect(_httpStatus.HttpStatus.PERMANENT_REDIRECT).toBe(308);
33
+ });
34
+ });
35
+ describe("4xx Client Error", function () {
36
+ it("should have correct client error status codes", function () {
37
+ expect(_httpStatus.HttpStatus.BAD_REQUEST).toBe(400);
38
+ expect(_httpStatus.HttpStatus.UNAUTHORIZED).toBe(401);
39
+ expect(_httpStatus.HttpStatus.PAYMENT_REQUIRED).toBe(402);
40
+ expect(_httpStatus.HttpStatus.FORBIDDEN).toBe(403);
41
+ expect(_httpStatus.HttpStatus.NOT_FOUND).toBe(404);
42
+ expect(_httpStatus.HttpStatus.METHOD_NOT_ALLOWED).toBe(405);
43
+ expect(_httpStatus.HttpStatus.NOT_ACCEPTABLE).toBe(406);
44
+ expect(_httpStatus.HttpStatus.PROXY_AUTHENTICATION_REQUIRED).toBe(407);
45
+ expect(_httpStatus.HttpStatus.REQUEST_TIMEOUT).toBe(408);
46
+ expect(_httpStatus.HttpStatus.CONFLICT).toBe(409);
47
+ expect(_httpStatus.HttpStatus.GONE).toBe(410);
48
+ expect(_httpStatus.HttpStatus.LENGTH_REQUIRED).toBe(411);
49
+ expect(_httpStatus.HttpStatus.PRECONDITION_FAILED).toBe(412);
50
+ expect(_httpStatus.HttpStatus.PAYLOAD_TOO_LARGE).toBe(413);
51
+ expect(_httpStatus.HttpStatus.URI_TOO_LONG).toBe(414);
52
+ expect(_httpStatus.HttpStatus.UNSUPPORTED_MEDIA_TYPE).toBe(415);
53
+ expect(_httpStatus.HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE).toBe(416);
54
+ expect(_httpStatus.HttpStatus.EXPECTATION_FAILED).toBe(417);
55
+ expect(_httpStatus.HttpStatus.I_AM_A_TEAPOT).toBe(418);
56
+ expect(_httpStatus.HttpStatus.MISDIRECTED).toBe(421);
57
+ expect(_httpStatus.HttpStatus.UNPROCESSABLE_ENTITY).toBe(422);
58
+ expect(_httpStatus.HttpStatus.FAILED_DEPENDENCY).toBe(424);
59
+ expect(_httpStatus.HttpStatus.PRECONDITION_REQUIRED).toBe(428);
60
+ expect(_httpStatus.HttpStatus.TOO_MANY_REQUESTS).toBe(429);
61
+ });
62
+ });
63
+ describe("5xx Server Error", function () {
64
+ it("should have correct server error status codes", function () {
65
+ expect(_httpStatus.HttpStatus.INTERNAL_SERVER_ERROR).toBe(500);
66
+ expect(_httpStatus.HttpStatus.NOT_IMPLEMENTED).toBe(501);
67
+ expect(_httpStatus.HttpStatus.BAD_GATEWAY).toBe(502);
68
+ expect(_httpStatus.HttpStatus.SERVICE_UNAVAILABLE).toBe(503);
69
+ expect(_httpStatus.HttpStatus.GATEWAY_TIMEOUT).toBe(504);
70
+ expect(_httpStatus.HttpStatus.HTTP_VERSION_NOT_SUPPORTED).toBe(505);
71
+ });
72
+ });
73
+ });
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ var _httpStatus = require("@/Consts/httpStatus");
4
+ describe("HttpSuccessStatus", function () {
5
+ describe("2xx Success", function () {
6
+ it("should have correct success status codes", function () {
7
+ expect(_httpStatus.HttpSuccessStatus.OK).toBe(200);
8
+ expect(_httpStatus.HttpSuccessStatus.CREATED).toBe(201);
9
+ expect(_httpStatus.HttpSuccessStatus.ACCEPTED).toBe(202);
10
+ expect(_httpStatus.HttpSuccessStatus.NON_AUTHORITATIVE_INFORMATION).toBe(203);
11
+ expect(_httpStatus.HttpSuccessStatus.NO_CONTENT).toBe(204);
12
+ expect(_httpStatus.HttpSuccessStatus.RESET_CONTENT).toBe(205);
13
+ expect(_httpStatus.HttpSuccessStatus.PARTIAL_CONTENT).toBe(206);
14
+ });
15
+ });
16
+ });
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _convertTime = require("@/Time/convertTime");
4
4
  describe("convertTime", function () {
5
- // 正常系のテスト
5
+ // long format to long format
6
6
  test("1時間を秒に変換", function () {
7
7
  expect((0, _convertTime.convertTime)("1", "hours", "seconds")).toBe(3600);
8
8
  expect((0, _convertTime.convertTime)(1, "hours", "seconds")).toBe(3600);
@@ -40,4 +40,102 @@ describe("convertTime", function () {
40
40
  test("非常に大きな数値の変換", function () {
41
41
  expect((0, _convertTime.convertTime)("1e9", "milliseconds", "hours")).toBe(1000000000 / (60 * 60 * 1000));
42
42
  });
43
+
44
+ // short format to short format
45
+ test("1時間を秒に変換(short format)", function () {
46
+ expect((0, _convertTime.convertTime)("1", "h", "s")).toBe(3600);
47
+ });
48
+ test("3600秒を時間に変換(short format)", function () {
49
+ expect((0, _convertTime.convertTime)("3600", "s", "h")).toBe(1);
50
+ });
51
+ test("90分を時間に変換(short format)", function () {
52
+ expect((0, _convertTime.convertTime)("90", "m", "h")).toBe(1.5);
53
+ });
54
+ test("1時間をミリ秒に変換(short format)", function () {
55
+ expect((0, _convertTime.convertTime)("1", "h", "ms")).toBe(3600000);
56
+ });
57
+ test("0.5秒をミリ秒に変換(short format)", function () {
58
+ expect((0, _convertTime.convertTime)("0.5", "s", "ms")).toBe(500);
59
+ });
60
+ test("1000ミリ秒を秒に変換(short format)", function () {
61
+ expect((0, _convertTime.convertTime)("1000", "ms", "s")).toBe(1);
62
+ });
63
+ test("同じ単位(秒から秒)への変換(short format)", function () {
64
+ expect((0, _convertTime.convertTime)("10", "s", "s")).toBe(10);
65
+ });
66
+ test("小数点を含む入力(1.5時間を分に変換)(short format)", function () {
67
+ expect((0, _convertTime.convertTime)("1.5", "h", "m")).toBe(90);
68
+ });
69
+ test("0の変換(short format)", function () {
70
+ expect((0, _convertTime.convertTime)("0", "h", "s")).toBe(0);
71
+ });
72
+ test("非常に大きな数値の変換(short format)", function () {
73
+ expect((0, _convertTime.convertTime)("1e9", "ms", "h")).toBe(1000000000 / (60 * 60 * 1000));
74
+ });
75
+
76
+ // long format to short format
77
+
78
+ test("1時間を秒に変換(long to short)", function () {
79
+ expect((0, _convertTime.convertTime)("1", "hours", "s")).toBe(3600);
80
+ });
81
+ test("3600秒を時間に変換(long to short)", function () {
82
+ expect((0, _convertTime.convertTime)("3600", "seconds", "h")).toBe(1);
83
+ });
84
+ test("90分を時間に変換(long to short)", function () {
85
+ expect((0, _convertTime.convertTime)("90", "minutes", "h")).toBe(1.5);
86
+ });
87
+ test("1時間をミリ秒に変換(long to short)", function () {
88
+ expect((0, _convertTime.convertTime)("1", "hours", "ms")).toBe(3600000);
89
+ });
90
+ test("0.5秒をミリ秒に変換(long to short)", function () {
91
+ expect((0, _convertTime.convertTime)("0.5", "seconds", "ms")).toBe(500);
92
+ });
93
+ test("1000ミリ秒を秒に変換(long to short)", function () {
94
+ expect((0, _convertTime.convertTime)("1000", "milliseconds", "s")).toBe(1);
95
+ });
96
+ test("同じ単位(秒から秒)への変換(long to short)", function () {
97
+ expect((0, _convertTime.convertTime)("10", "seconds", "s")).toBe(10);
98
+ });
99
+ test("小数点を含む入力(1.5時間を分に変換)(long to short)", function () {
100
+ expect((0, _convertTime.convertTime)("1.5", "hours", "m")).toBe(90);
101
+ });
102
+ test("0の変換(long to short)", function () {
103
+ expect((0, _convertTime.convertTime)("0", "hours", "s")).toBe(0);
104
+ });
105
+ test("非常に大きな数値の変換(long to short)", function () {
106
+ expect((0, _convertTime.convertTime)("1e9", "milliseconds", "h")).toBe(1000000000 / (60 * 60 * 1000));
107
+ });
108
+
109
+ // short format to long format
110
+
111
+ test("1時間を秒に変換(short to long)", function () {
112
+ expect((0, _convertTime.convertTime)("1", "h", "seconds")).toBe(3600);
113
+ });
114
+ test("3600秒を時間に変換(short to long)", function () {
115
+ expect((0, _convertTime.convertTime)("3600", "s", "hours")).toBe(1);
116
+ });
117
+ test("90分を時間に変換(short to long)", function () {
118
+ expect((0, _convertTime.convertTime)("90", "m", "hours")).toBe(1.5);
119
+ });
120
+ test("1時間をミリ秒に変換(short to long)", function () {
121
+ expect((0, _convertTime.convertTime)("1", "h", "milliseconds")).toBe(3600000);
122
+ });
123
+ test("0.5秒をミリ秒に変換(short to long)", function () {
124
+ expect((0, _convertTime.convertTime)("0.5", "s", "milliseconds")).toBe(500);
125
+ });
126
+ test("1000ミリ秒を秒に変換(short to long)", function () {
127
+ expect((0, _convertTime.convertTime)("1000", "ms", "seconds")).toBe(1);
128
+ });
129
+ test("同じ単位(秒から秒)への変換(short to long)", function () {
130
+ expect((0, _convertTime.convertTime)("10", "s", "seconds")).toBe(10);
131
+ });
132
+ test("小数点を含む入力(1.5時間を分に変換)(short to long)", function () {
133
+ expect((0, _convertTime.convertTime)("1.5", "h", "minutes")).toBe(90);
134
+ });
135
+ test("0の変換(short to long)", function () {
136
+ expect((0, _convertTime.convertTime)("0", "h", "seconds")).toBe(0);
137
+ });
138
+ test("非常に大きな数値の変換(short to long)", function () {
139
+ expect((0, _convertTime.convertTime)("1e9", "ms", "hours")).toBe(1000000000 / (60 * 60 * 1000));
140
+ });
43
141
  });
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ var _normalizeTimeUnit = require("@/Time/normalizeTimeUnit");
4
+ describe("normalizeTimeUnit", function () {
5
+ test("converts long format to long format", function () {
6
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("milliseconds", "long")).toBe("milliseconds");
7
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("seconds", "long")).toBe("seconds");
8
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("minutes", "long")).toBe("minutes");
9
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("hours", "long")).toBe("hours");
10
+ });
11
+ test("converts long format to short format", function () {
12
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("milliseconds", "short")).toBe("ms");
13
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("seconds", "short")).toBe("s");
14
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("minutes", "short")).toBe("m");
15
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("hours", "short")).toBe("h");
16
+ });
17
+ test("converts short format to long format", function () {
18
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("ms", "long")).toBe("milliseconds");
19
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("s", "long")).toBe("seconds");
20
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("m", "long")).toBe("minutes");
21
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("h", "long")).toBe("hours");
22
+ });
23
+ test("converts short format to short format", function () {
24
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("ms", "short")).toBe("ms");
25
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("s", "short")).toBe("s");
26
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("m", "short")).toBe("m");
27
+ expect((0, _normalizeTimeUnit.normalizeTimeUnit)("h", "short")).toBe("h");
28
+ });
29
+ });
@@ -1,48 +1,48 @@
1
1
  "use strict";
2
2
 
3
- var _isObject = require("@/Validate/isObject");
3
+ var _isDictionaryObject = require("@/Validate/isDictionaryObject");
4
4
  describe("isObj", function () {
5
5
  it("should return true for an object with string properties", function () {
6
- expect((0, _isObject.isObject)({
6
+ expect((0, _isDictionaryObject.isDictionaryObject)({
7
7
  foo: "bar",
8
8
  baz: "qux"
9
9
  })).toBe(true);
10
10
  });
11
11
  it("should return true for an object with number properties", function () {
12
- expect((0, _isObject.isObject)({
12
+ expect((0, _isDictionaryObject.isDictionaryObject)({
13
13
  foo: 1,
14
14
  bar: 2
15
15
  })).toBe(true);
16
16
  });
17
17
  it("should return true for an object with boolean properties", function () {
18
- expect((0, _isObject.isObject)({
18
+ expect((0, _isDictionaryObject.isDictionaryObject)({
19
19
  foo: true,
20
20
  bar: false
21
21
  })).toBe(true);
22
22
  });
23
23
  it("should return true for an object with mixed properties", function () {
24
- expect((0, _isObject.isObject)({
24
+ expect((0, _isDictionaryObject.isDictionaryObject)({
25
25
  foo: "bar",
26
26
  baz: 1,
27
27
  qux: true
28
28
  })).toBe(true);
29
29
  });
30
30
  it("should return false for an array", function () {
31
- expect((0, _isObject.isObject)([1, 2, 3])).toBe(false);
31
+ expect((0, _isDictionaryObject.isDictionaryObject)([1, 2, 3])).toBe(false);
32
32
  });
33
33
  it("should return false for a string", function () {
34
- expect((0, _isObject.isObject)("foo")).toBe(false);
34
+ expect((0, _isDictionaryObject.isDictionaryObject)("foo")).toBe(false);
35
35
  });
36
36
  it("should return false for a number", function () {
37
- expect((0, _isObject.isObject)(42)).toBe(false);
37
+ expect((0, _isDictionaryObject.isDictionaryObject)(42)).toBe(false);
38
38
  });
39
39
  it("should return false for a boolean", function () {
40
- expect((0, _isObject.isObject)(true)).toBe(false);
40
+ expect((0, _isDictionaryObject.isDictionaryObject)(true)).toBe(false);
41
41
  });
42
42
  it("should return false for null", function () {
43
- expect((0, _isObject.isObject)(null)).toBe(false);
43
+ expect((0, _isDictionaryObject.isDictionaryObject)(null)).toBe(false);
44
44
  });
45
45
  it("should return false for undefined", function () {
46
- expect((0, _isObject.isObject)(undefined)).toBe(false);
46
+ expect((0, _isDictionaryObject.isDictionaryObject)(undefined)).toBe(false);
47
47
  });
48
48
  });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ var _isEqual = require("@/Validate/isEqual");
4
+ var _lodash = _interopRequireDefault(require("lodash"));
5
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
6
+ describe("isEqual", function () {
7
+ it("should compare primitive values correctly", function () {
8
+ expect((0, _isEqual.isEqual)(1, 1)).toBe(true);
9
+ expect((0, _isEqual.isEqual)("test", "test")).toBe(true);
10
+ expect((0, _isEqual.isEqual)(true, true)).toBe(true);
11
+ expect((0, _isEqual.isEqual)(null, null)).toBe(true);
12
+ expect((0, _isEqual.isEqual)(undefined, undefined)).toBe(true);
13
+ expect((0, _isEqual.isEqual)(Number.NaN, Number.NaN)).toBe(true);
14
+ });
15
+ it("should return false for different primitive values", function () {
16
+ expect((0, _isEqual.isEqual)(1, 2)).toBe(false);
17
+ expect((0, _isEqual.isEqual)("test", "other")).toBe(false);
18
+ expect((0, _isEqual.isEqual)(true, false)).toBe(false);
19
+ expect((0, _isEqual.isEqual)(null, undefined)).toBe(false);
20
+ });
21
+ it("should handle object references correctly", function () {
22
+ var obj = {
23
+ a: 1
24
+ };
25
+ expect((0, _isEqual.isEqual)(obj, obj)).toBe(true);
26
+ expect((0, _isEqual.isEqual)(obj, {
27
+ a: 1
28
+ })).toBe(false);
29
+ });
30
+ it("should handle array references correctly", function () {
31
+ var arr = [1, 2, 3];
32
+ expect((0, _isEqual.isEqual)(arr, arr)).toBe(true);
33
+ expect((0, _isEqual.isEqual)(arr, [1, 2, 3])).toBe(false);
34
+ });
35
+ it("should distinguish between -0 and +0", function () {
36
+ expect((0, _isEqual.isEqual)(-0, +0)).toBe(false);
37
+ });
38
+
39
+ // lodash tests
40
+ it("should compare primitive values correctly (using lodash)", function () {
41
+ expect(_lodash["default"].isEqual(1, 1)).toBe(true);
42
+ expect(_lodash["default"].isEqual("test", "test")).toBe(true);
43
+ expect(_lodash["default"].isEqual(true, true)).toBe(true);
44
+ expect(_lodash["default"].isEqual(null, null)).toBe(true);
45
+ expect(_lodash["default"].isEqual(undefined, undefined)).toBe(true);
46
+ expect(_lodash["default"].isEqual(Number.NaN, Number.NaN)).toBe(true);
47
+ });
48
+ it("should return false for different primitive values (using lodash)", function () {
49
+ expect(_lodash["default"].isEqual(1, 2)).toBe(false);
50
+ expect(_lodash["default"].isEqual("test", "other")).toBe(false);
51
+ expect(_lodash["default"].isEqual(true, false)).toBe(false);
52
+ expect(_lodash["default"].isEqual(null, undefined)).toBe(false);
53
+ });
54
+ it("should handle object references correctly (using lodash)", function () {
55
+ var obj = {
56
+ a: 1
57
+ };
58
+ expect(_lodash["default"].isEqual(obj, obj)).toBe(true);
59
+ // This test returns true because the implementation of lodash and isEqual is different.
60
+ expect(_lodash["default"].isEqual(obj, {
61
+ a: 1
62
+ })).toBe(true);
63
+ });
64
+ it("should handle array references correctly (using lodash)", function () {
65
+ var arr = [1, 2, 3];
66
+ expect(_lodash["default"].isEqual(arr, arr)).toBe(true);
67
+ // This test returns true because the implementation of lodash and isEqual is different.
68
+ expect(_lodash["default"].isEqual(arr, [1, 2, 3])).toBe(true);
69
+ });
70
+ it("should distinguish between -0 and +0 (using lodash)", function () {
71
+ // This test returns true because the implementation of lodash and isEqual is different.
72
+ expect(_lodash["default"].isEqual(-0, +0)).toBe(true);
73
+ });
74
+ });