umt 2.1.0 → 2.1.2
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/module/Consts/httpStatus/httpClientErrorStatus.d.ts +28 -0
- package/module/Consts/httpStatus/httpClientErrorStatus.js +27 -0
- package/module/Consts/httpStatus/httpClientErrorStatus.js.map +1 -0
- package/module/Consts/httpStatus/httpInformationalStatus.d.ts +8 -0
- package/module/Consts/httpStatus/httpInformationalStatus.js +7 -0
- package/module/Consts/httpStatus/httpInformationalStatus.js.map +1 -0
- package/module/Consts/httpStatus/httpRedirectionStatus.d.ts +11 -0
- package/module/Consts/httpStatus/httpRedirectionStatus.js +10 -0
- package/module/Consts/httpStatus/httpRedirectionStatus.js.map +1 -0
- package/module/Consts/httpStatus/httpServerErrorStatus.d.ts +10 -0
- package/module/Consts/httpStatus/httpServerErrorStatus.js +9 -0
- package/module/Consts/httpStatus/httpServerErrorStatus.js.map +1 -0
- package/module/Consts/httpStatus/httpSuccessStatus.d.ts +11 -0
- package/module/Consts/httpStatus/httpSuccessStatus.js +10 -0
- package/module/Consts/httpStatus/httpSuccessStatus.js.map +1 -0
- package/module/Consts/httpStatus/index.d.ts +57 -0
- package/module/Consts/httpStatus/index.js +18 -0
- package/module/Consts/httpStatus/index.js.map +1 -0
- package/module/Consts/index.d.ts +1 -0
- package/module/Consts/index.js +1 -0
- package/module/Consts/index.js.map +1 -1
- package/module/IP/index.d.ts +1 -0
- package/module/IP/index.js +1 -0
- package/module/IP/index.js.map +1 -1
- package/module/Math/index.d.ts +1 -0
- package/module/Math/index.js +1 -0
- package/module/Math/index.js.map +1 -1
- package/module/String/index.d.ts +2 -1
- package/module/String/index.js +2 -1
- package/module/String/index.js.map +1 -1
- package/module/Time/convertTime.d.ts +2 -1
- package/module/Time/convertTime.js +5 -2
- package/module/Time/convertTime.js.map +1 -1
- package/module/Time/index.d.ts +1 -0
- package/module/Time/index.js +1 -0
- package/module/Time/index.js.map +1 -1
- package/module/Time/normalizeTimeUnit.d.ts +10 -0
- package/module/Time/normalizeTimeUnit.js +14 -0
- package/module/Time/normalizeTimeUnit.js.map +1 -0
- package/module/Unit/index.d.ts +1 -0
- package/module/Unit/index.js +2 -0
- package/module/Unit/index.js.map +1 -0
- package/module/Unit/unitConverterInitialization.d.ts +1 -0
- package/module/Unit/unitConverterInitialization.js +4 -0
- package/module/Unit/unitConverterInitialization.js.map +1 -0
- package/module/Validate/index.d.ts +2 -1
- package/module/Validate/index.js +2 -1
- package/module/Validate/index.js.map +1 -1
- package/module/Validate/isDictionaryObject.d.ts +10 -0
- package/module/Validate/isDictionaryObject.js +11 -0
- package/module/Validate/isDictionaryObject.js.map +1 -0
- package/module/Validate/isEqual.d.ts +23 -0
- package/module/Validate/isEqual.js +24 -0
- package/module/Validate/isEqual.js.map +1 -0
- package/module/Validate/object/core.js +2 -2
- package/module/Validate/object/core.js.map +1 -1
- package/module/es5/Consts/httpStatus/httpClientErrorStatus.d.ts +28 -0
- package/module/es5/Consts/httpStatus/httpClientErrorStatus.js +32 -0
- package/module/es5/Consts/httpStatus/httpInformationalStatus.d.ts +8 -0
- package/module/es5/Consts/httpStatus/httpInformationalStatus.js +12 -0
- package/module/es5/Consts/httpStatus/httpRedirectionStatus.d.ts +11 -0
- package/module/es5/Consts/httpStatus/httpRedirectionStatus.js +15 -0
- package/module/es5/Consts/httpStatus/httpServerErrorStatus.d.ts +10 -0
- package/module/es5/Consts/httpStatus/httpServerErrorStatus.js +14 -0
- package/module/es5/Consts/httpStatus/httpSuccessStatus.d.ts +11 -0
- package/module/es5/Consts/httpStatus/httpSuccessStatus.js +15 -0
- package/module/es5/Consts/httpStatus/index.d.ts +57 -0
- package/module/es5/Consts/httpStatus/index.js +48 -0
- package/module/es5/Consts/index.d.ts +1 -0
- package/module/es5/Consts/index.js +11 -0
- package/module/es5/IP/index.d.ts +1 -0
- package/module/es5/IP/index.js +11 -0
- package/module/es5/Math/index.d.ts +1 -0
- package/module/es5/Math/index.js +11 -0
- package/module/es5/String/index.d.ts +2 -1
- package/module/es5/String/index.js +22 -11
- package/module/es5/Time/convertTime.d.ts +2 -1
- package/module/es5/Time/convertTime.js +5 -2
- package/module/es5/Time/index.d.ts +1 -0
- package/module/es5/Time/index.js +11 -0
- package/module/es5/Time/normalizeTimeUnit.d.ts +10 -0
- package/module/es5/Time/normalizeTimeUnit.js +51 -0
- package/module/es5/Unit/index.d.ts +1 -0
- package/module/es5/Unit/index.js +16 -0
- package/module/es5/Unit/unitConverterInitialization.d.ts +1 -0
- package/module/es5/Unit/unitConverterInitialization.js +13 -0
- package/module/es5/Validate/index.d.ts +2 -1
- package/module/es5/Validate/index.js +22 -11
- package/module/es5/Validate/isDictionaryObject.d.ts +10 -0
- package/module/es5/Validate/{isObject.js → isDictionaryObject.js} +6 -6
- package/module/es5/Validate/isEqual.d.ts +23 -0
- package/module/es5/Validate/isEqual.js +31 -0
- package/module/es5/Validate/object/core.js +2 -2
- package/module/es5/index.d.ts +1 -0
- package/module/es5/index.js +11 -0
- package/module/es5/tests/unit/Consts/clock.test.js +12 -12
- package/module/es5/tests/unit/Consts/httpClientErrorStatus.test.js +33 -0
- package/module/es5/tests/unit/Consts/httpInformationalStatus.test.d.ts +1 -0
- package/module/es5/tests/unit/Consts/httpInformationalStatus.test.js +13 -0
- package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.d.ts +1 -0
- package/module/es5/tests/unit/Consts/httpRedirectionStatus.test.js +16 -0
- package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.d.ts +1 -0
- package/module/es5/tests/unit/Consts/httpServerErrorStatus.test.js +15 -0
- package/module/es5/tests/unit/Consts/httpStatus.test.d.ts +1 -0
- package/module/es5/tests/unit/Consts/httpStatus.test.js +73 -0
- package/module/es5/tests/unit/Consts/httpSuccessStatus.test.d.ts +1 -0
- package/module/es5/tests/unit/Consts/httpSuccessStatus.test.js +16 -0
- package/module/es5/tests/unit/Time/convertTime.test.js +99 -1
- package/module/es5/tests/unit/Time/normalizeTimeUnit.test.d.ts +1 -0
- package/module/es5/tests/unit/Time/normalizeTimeUnit.test.js +29 -0
- package/module/es5/tests/unit/Unit/unitConverterInitialization.test.d.ts +1 -0
- package/module/es5/tests/unit/Unit/unitConverterInitialization.test.js +38 -0
- package/module/es5/tests/unit/Validate/isDictionaryObject.test.d.ts +1 -0
- package/module/es5/tests/unit/Validate/{isObject.test.js → isDictionaryObject.test.js} +11 -11
- package/module/es5/tests/unit/Validate/isEqual.test.d.ts +1 -0
- package/module/es5/tests/unit/Validate/isEqual.test.js +74 -0
- package/module/es5/tsconfig.tsbuildinfo +1 -1
- package/module/es5/types/enum/getEnumValues.d.ts +1 -0
- package/module/es5/types/enum/getEnumValues.js +5 -0
- package/module/es5/types/enum/index.d.ts +1 -0
- package/module/es5/types/enum/index.js +16 -0
- package/module/es5/types/index.d.ts +1 -0
- package/module/es5/types/index.js +11 -0
- package/module/es5/types/object/index.d.ts +1 -0
- package/module/es5/types/object/index.js +11 -0
- package/module/es5/types/time/index.d.ts +1 -0
- package/module/es5/types/time/index.js +11 -0
- package/module/es5/types/time/timeUnitShort.d.ts +4 -0
- package/module/es5/types/time/timeUnitShort.js +5 -0
- package/module/index.d.ts +1 -0
- package/module/index.js +1 -0
- package/module/index.js.map +1 -1
- package/module/types/enum/getEnumValues.d.ts +1 -0
- package/module/types/enum/getEnumValues.js +2 -0
- package/module/types/enum/getEnumValues.js.map +1 -0
- package/module/types/enum/index.d.ts +1 -0
- package/module/types/enum/index.js +2 -0
- package/module/types/enum/index.js.map +1 -0
- package/module/types/index.d.ts +1 -0
- package/module/types/index.js +1 -0
- package/module/types/index.js.map +1 -1
- package/module/types/object/index.d.ts +1 -0
- package/module/types/object/index.js +1 -0
- package/module/types/object/index.js.map +1 -1
- package/module/types/time/index.d.ts +1 -0
- package/module/types/time/index.js +1 -0
- package/module/types/time/index.js.map +1 -1
- package/module/types/time/timeUnitShort.d.ts +4 -0
- package/module/types/time/timeUnitShort.js +2 -0
- package/module/types/time/timeUnitShort.js.map +1 -0
- package/package.json +14 -14
- package/module/Validate/isObject.d.ts +0 -10
- package/module/Validate/isObject.js +0 -11
- package/module/Validate/isObject.js.map +0 -1
- package/module/es5/Validate/isObject.d.ts +0 -10
- /package/module/es5/tests/unit/{Validate/isObject.test.d.ts → Consts/httpClientErrorStatus.test.d.ts} +0 -0
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.isDictionaryObject = void 0;
|
|
7
7
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* 辞書型のオブジェクトかどうかを判定する
|
|
10
10
|
* @param object
|
|
11
|
-
* @returns {boolean} true:
|
|
12
|
-
* @example
|
|
13
|
-
*
|
|
11
|
+
* @returns {boolean} true: 辞書型オブジェクト, false: 辞書型オブジェクトでない
|
|
12
|
+
* @example isDictionaryObject({}); // true
|
|
13
|
+
* isDictionaryObject([]); // false
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
15
|
+
var isDictionaryObject = exports.isDictionaryObject = function isDictionaryObject(object) {
|
|
16
16
|
return _typeof(object) === "object" && object !== null && !Array.isArray(object);
|
|
17
17
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluates true strict equality
|
|
3
|
+
* @param {unknown} a
|
|
4
|
+
* @param {unknown} b
|
|
5
|
+
* @returns boolean
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* isEqual(1, 1); // true
|
|
9
|
+
* isEqual("test", "test"); // true
|
|
10
|
+
* isEqual(Number.NaN, Number.NaN); // true
|
|
11
|
+
* isEqual(-0, +0); // false
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const obj = { a: 1 };
|
|
15
|
+
* isEqual(obj, obj); // true
|
|
16
|
+
* isEqual(obj, { a: 1 }); // false
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const arr = [1, 2, 3];
|
|
20
|
+
* isEqual(arr, arr); // true
|
|
21
|
+
* isEqual(arr, [1, 2, 3]); // false
|
|
22
|
+
*/
|
|
23
|
+
export declare const isEqual: (a: unknown, b: unknown) => boolean;
|
|
@@ -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
|
|
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,
|
|
12
|
+
if (!(0, _isDictionaryObject.isDictionaryObject)(value)) {
|
|
13
13
|
return {
|
|
14
14
|
validate: false,
|
|
15
15
|
message: message || "",
|
package/module/es5/index.d.ts
CHANGED
package/module/es5/index.js
CHANGED
|
@@ -168,6 +168,17 @@ Object.keys(_UA).forEach(function (key) {
|
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
});
|
|
171
|
+
var _Unit = require("./Unit");
|
|
172
|
+
Object.keys(_Unit).forEach(function (key) {
|
|
173
|
+
if (key === "default" || key === "__esModule") return;
|
|
174
|
+
if (key in exports && exports[key] === _Unit[key]) return;
|
|
175
|
+
Object.defineProperty(exports, key, {
|
|
176
|
+
enumerable: true,
|
|
177
|
+
get: function get() {
|
|
178
|
+
return _Unit[key];
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
});
|
|
171
182
|
var _Validate = require("./Validate");
|
|
172
183
|
Object.keys(_Validate).forEach(function (key) {
|
|
173
184
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _clock = require("@/Consts/clock");
|
|
4
4
|
describe("時間定数のテスト", function () {
|
|
5
5
|
it("1秒は1000ミリ秒", function () {
|
|
6
|
-
expect(
|
|
6
|
+
expect(_clock.OneSecondMs).toBe(1000);
|
|
7
7
|
});
|
|
8
8
|
it("1分は60000ミリ秒", function () {
|
|
9
|
-
expect(
|
|
9
|
+
expect(_clock.OneMinuteMs).toBe(60000);
|
|
10
10
|
});
|
|
11
11
|
it("1時間は3600000ミリ秒", function () {
|
|
12
|
-
expect(
|
|
12
|
+
expect(_clock.OneHourMs).toBe(3600000);
|
|
13
13
|
});
|
|
14
14
|
it("1日は86400000ミリ秒", function () {
|
|
15
|
-
expect(
|
|
15
|
+
expect(_clock.OneDayMs).toBe(86400000);
|
|
16
16
|
});
|
|
17
17
|
it("1週間は604800000ミリ秒", function () {
|
|
18
|
-
expect(
|
|
18
|
+
expect(_clock.OneWeekMs).toBe(604800000);
|
|
19
19
|
});
|
|
20
20
|
it("1ヶ月(28日として)は2419200000ミリ秒", function () {
|
|
21
|
-
expect(
|
|
21
|
+
expect(_clock.OneMonthMs28).toBe(2419200000);
|
|
22
22
|
});
|
|
23
23
|
it("1ヶ月(29日として)は2505600000ミリ秒", function () {
|
|
24
|
-
expect(
|
|
24
|
+
expect(_clock.OneMonthMs29).toBe(2505600000);
|
|
25
25
|
});
|
|
26
26
|
it("1ヶ月(30日として)は2592000000ミリ秒", function () {
|
|
27
|
-
expect(
|
|
27
|
+
expect(_clock.OneMonthMs).toBe(2592000000);
|
|
28
28
|
});
|
|
29
29
|
it("1ヶ月(31日として)は2678400000ミリ秒", function () {
|
|
30
|
-
expect(
|
|
30
|
+
expect(_clock.OneMonthMs31).toBe(2678400000);
|
|
31
31
|
});
|
|
32
32
|
it("1年(365日として)は31536000000ミリ秒", function () {
|
|
33
|
-
expect(
|
|
33
|
+
expect(_clock.OneYearMs).toBe(31536000000);
|
|
34
34
|
});
|
|
35
35
|
it("1年(366日として)は31622400000ミリ秒", function () {
|
|
36
|
-
expect(
|
|
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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _unitConverterInitialization = require("@/Unit/unitConverterInitialization");
|
|
4
|
+
var convertWaterUnit = (0, _unitConverterInitialization.unitConverterInitialization)({
|
|
5
|
+
L: 1,
|
|
6
|
+
mL: 1000,
|
|
7
|
+
cup: 4.227,
|
|
8
|
+
m3: 0.001
|
|
9
|
+
});
|
|
10
|
+
describe("convertWaterUnit", function () {
|
|
11
|
+
it("should correctly convert between L and mL", function () {
|
|
12
|
+
expect(convertWaterUnit(1, "L", "mL")).toBeCloseTo(1000);
|
|
13
|
+
expect(convertWaterUnit(1000, "mL", "L")).toBeCloseTo(1);
|
|
14
|
+
});
|
|
15
|
+
it("should correctly convert between L and cup", function () {
|
|
16
|
+
expect(convertWaterUnit(1, "L", "cup")).toBeCloseTo(4.227);
|
|
17
|
+
expect(convertWaterUnit(1, "cup", "L")).toBeCloseTo(0.237);
|
|
18
|
+
});
|
|
19
|
+
it("should correctly convert between L and m3", function () {
|
|
20
|
+
expect(convertWaterUnit(1, "m3", "L")).toBeCloseTo(1000);
|
|
21
|
+
expect(convertWaterUnit(1000, "L", "m3")).toBeCloseTo(1);
|
|
22
|
+
});
|
|
23
|
+
it("should handle zero values correctly", function () {
|
|
24
|
+
expect(convertWaterUnit(0, "L", "mL")).toBe(0);
|
|
25
|
+
expect(convertWaterUnit(0, "cup", "m3")).toBe(0);
|
|
26
|
+
});
|
|
27
|
+
it("should return same value when converting to same unit", function () {
|
|
28
|
+
expect(convertWaterUnit(5, "L", "L")).toBe(5);
|
|
29
|
+
expect(convertWaterUnit(100, "mL", "mL")).toBe(100);
|
|
30
|
+
});
|
|
31
|
+
it("should maintain value in round-trip conversions", function () {
|
|
32
|
+
var original = 5;
|
|
33
|
+
var roundTrip = convertWaterUnit(convertWaterUnit(original, "L", "mL"), "mL", "L");
|
|
34
|
+
expect(roundTrip).toBeCloseTo(original);
|
|
35
|
+
var cupRoundTrip = convertWaterUnit(convertWaterUnit(original, "cup", "m3"), "m3", "cup");
|
|
36
|
+
expect(cupRoundTrip).toBeCloseTo(original);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
34
|
+
expect((0, _isDictionaryObject.isDictionaryObject)("foo")).toBe(false);
|
|
35
35
|
});
|
|
36
36
|
it("should return false for a number", function () {
|
|
37
|
-
expect((0,
|
|
37
|
+
expect((0, _isDictionaryObject.isDictionaryObject)(42)).toBe(false);
|
|
38
38
|
});
|
|
39
39
|
it("should return false for a boolean", function () {
|
|
40
|
-
expect((0,
|
|
40
|
+
expect((0, _isDictionaryObject.isDictionaryObject)(true)).toBe(false);
|
|
41
41
|
});
|
|
42
42
|
it("should return false for null", function () {
|
|
43
|
-
expect((0,
|
|
43
|
+
expect((0, _isDictionaryObject.isDictionaryObject)(null)).toBe(false);
|
|
44
44
|
});
|
|
45
45
|
it("should return false for undefined", function () {
|
|
46
|
-
expect((0,
|
|
46
|
+
expect((0, _isDictionaryObject.isDictionaryObject)(undefined)).toBe(false);
|
|
47
47
|
});
|
|
48
48
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|