Skip to content

Commit b0e37fd

Browse files
feat(Value): add.
1 parent ae82481 commit b0e37fd

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/lib/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
// Function.
22
export { resultCallback } from './result-callback.func';
33
export { typeOf } from './type-of.func';
4+
export { Value } from './value.class';

src/lib/value.class.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* @description
3+
* @export
4+
* @abstract
5+
* @class Value
6+
* @template Type
7+
*/
8+
export abstract class Value<Type> {
9+
/**
10+
* @description Returns the privately stored value of generic type variable `Type`.
11+
* @public
12+
* @readonly
13+
* @type {Type}
14+
*/
15+
public get value() {
16+
return this.#value;
17+
}
18+
19+
20+
/**
21+
* @description Privately stored value of generic type variable `Type`.
22+
* @type {Type}
23+
*/
24+
#value: Type;
25+
26+
/**
27+
* Creates an instance of `Value`.
28+
* @constructor
29+
* @param {Type} value
30+
*/
31+
constructor(value: Type) {
32+
this.#value = value;
33+
}
34+
}

0 commit comments

Comments
 (0)