@4players/odin-common 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c)
|
|
1
|
+
Copyright (c) 2024, 4Players GmbH
|
|
2
2
|
|
|
3
3
|
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
4
|
|
|
@@ -7,6 +7,8 @@ exports.isNumber = isNumber;
|
|
|
7
7
|
exports.isObject = isObject;
|
|
8
8
|
exports.isString = isString;
|
|
9
9
|
exports.isUndefined = isUndefined;
|
|
10
|
+
exports.isFailure = isFailure;
|
|
11
|
+
exports.isSuccess = isSuccess;
|
|
10
12
|
function isProperty(object, name) {
|
|
11
13
|
return name in object;
|
|
12
14
|
}
|
|
@@ -28,3 +30,9 @@ function isString(value) {
|
|
|
28
30
|
function isUndefined(value) {
|
|
29
31
|
return typeof value === 'undefined';
|
|
30
32
|
}
|
|
33
|
+
function isFailure(result) {
|
|
34
|
+
return result.type === 'Failure';
|
|
35
|
+
}
|
|
36
|
+
function isSuccess(result) {
|
|
37
|
+
return result.type === 'Success';
|
|
38
|
+
}
|
|
@@ -19,3 +19,9 @@ export function isString(value) {
|
|
|
19
19
|
export function isUndefined(value) {
|
|
20
20
|
return typeof value === 'undefined';
|
|
21
21
|
}
|
|
22
|
+
export function isFailure(result) {
|
|
23
|
+
return result.type === 'Failure';
|
|
24
|
+
}
|
|
25
|
+
export function isSuccess(result) {
|
|
26
|
+
return result.type === 'Success';
|
|
27
|
+
}
|
package/lib/utility/log.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export declare class Logger {
|
|
|
55
55
|
}
|
|
56
56
|
type GenericFunction = (...args: any[]) => any;
|
|
57
57
|
type FormatterFunction = (record: LogRecord) => string;
|
|
58
|
-
interface LogRecord {
|
|
58
|
+
export interface LogRecord {
|
|
59
59
|
readonly date: Date;
|
|
60
60
|
readonly level: LogLevel;
|
|
61
61
|
readonly levelName: LogLevelName;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Failure, Result, Success } from './result';
|
|
1
2
|
export declare function isProperty<T extends object>(object: T, name: string): name is Extract<keyof T, string>;
|
|
2
3
|
export declare function isFunction(value: any): value is Function;
|
|
3
4
|
export declare function isNull(value: any): boolean;
|
|
@@ -5,3 +6,5 @@ export declare function isNumber(value: any): value is Number;
|
|
|
5
6
|
export declare function isObject(value: any): value is Object;
|
|
6
7
|
export declare function isString(value: any): value is String;
|
|
7
8
|
export declare function isUndefined(value: any): value is undefined;
|
|
9
|
+
export declare function isFailure<T>(result: Result<T>): result is Failure;
|
|
10
|
+
export declare function isSuccess<T>(result: Result<T>): result is Success<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4players/odin-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "A collection of commonly used type definitions and utility functions across ODIN web projects",
|
|
5
5
|
"author": "Josho Bleicker <josho.bleicker@4players.io> (https://www.4players.io)",
|
|
6
6
|
"homepage": "https://www.4players.io",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"@typescript-eslint/parser": "~7.18.0",
|
|
37
37
|
"eslint": "~8.57.0",
|
|
38
38
|
"eslint-config-semistandard": "~17.0.0",
|
|
39
|
-
"eslint-plugin-import": "~2.
|
|
39
|
+
"eslint-plugin-import": "~2.30.0",
|
|
40
40
|
"eslint-plugin-node": "~11.1.0",
|
|
41
|
-
"eslint-plugin-promise": "~6.
|
|
41
|
+
"eslint-plugin-promise": "~6.6.0",
|
|
42
42
|
"prettier": "~3.3.0",
|
|
43
43
|
"rimraf": "~6.0.0",
|
|
44
44
|
"testyts": "~1.5.0",
|