Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

github: [angular-package] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: angularpackage # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: [
'https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29',
'https://donate.stripe.com/dR614hfDZcJE3wAcMM'
] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
46 changes: 34 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,68 @@
<a href="https://www.typescriptlang.org/">
<img
src="https://raw.githubusercontent.com/typescript-package/core/refs/heads/main/ts-package-barcode-logo-512.png"
width="20%"
src="https://avatars.githubusercontent.com/u/189666396?s=150&u=9d55b1eb4ce258974ead76bf07ccf49ef0eb0ea7&v=4"
title="@typescript-package/core"
/>
</a>

## typescript-package/core

Core package.

<!-- npm badge -->
[![npm version][typescript-package-npm-badge-svg]][typescript-package-npm-badge]
[![GitHub issues][typescript-package-badge-issues]][typescript-package-issues]
[![GitHub license][typescript-package-badge-license]][typescript-package-license]

A TypeScript library with features used across other `typescript-package` libraries.

<br>

## Table of contents

* [Installation](#installation)
* [Api](#api)
* [Git](#git)
* [Commit](#commit)
* [Versioning](#versioning)
* [License](#license)
- [Installation](#installation)
- [Api](#api)
- [Contributing](#contributing)
- [Support](#support)
- [Code of Conduct](#code-of-conduct)
- [Git](#git)
- [Commit](#commit)
- [Versioning](#versioning)
- [License](#license)

## Installation

```bash
npm install @typescript-package/core
npm install @typescript-package/core --save-peer
```

## Api

```typescript
import {
resultCallback,
typeOf
typeOf,
Value
} from '@typescript-package/core';
```

## Contributing

Your contributions are valued! If you'd like to contribute, please feel free to submit a pull request. Help is always appreciated.

## Support

If you find this package useful and would like to support its and general development, you can contribute through one of the following payment methods. Your support helps maintain the packages and continue adding new.

Support via:

- [Stripe](https://donate.stripe.com/dR614hfDZcJE3wAcMM)
- [Revolut](https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29)

Thanks for your support!

## Code of Conduct

By participating in this project, you agree to follow **[Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/)**.

## GIT

### Commit
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@typescript-package/core",
"version": "1.0.0",
"version": "1.1.0",
"author": "wwwdev.io <[email protected]>",
"description": "Core package.",
"description": "A TypeScript library with features used across other `typescript-package` libraries.",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
1 change: 1 addition & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Function.
export { resultCallback } from './result-callback.func';
export { typeOf } from './type-of.func';
export { Value } from './value.class';
34 changes: 34 additions & 0 deletions src/lib/value.class.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @description
* @export
* @abstract
* @class Value
* @template Type
*/
export abstract class Value<Type> {
/**
* @description Returns the privately stored value of generic type variable `Type`.
* @public
* @readonly
* @type {Type}
*/
public get value() {
return this.#value;
}


/**
* @description Privately stored value of generic type variable `Type`.
* @type {Type}
*/
#value: Type;

/**
* Creates an instance of `Value`.
* @constructor
* @param {Type} value
*/
constructor(value: Type) {
this.#value = value;
}
}
Binary file removed ts-package-barcode-logo-512.png
Binary file not shown.