Skip to content

Commit 2346500

Browse files
Initial commit.
1 parent 6f8c76c commit 2346500

File tree

11 files changed

+250
-2
lines changed

11 files changed

+250
-2
lines changed

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db
43+
*.ignore
44+
temp

README.md

Lines changed: 106 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,106 @@
1-
# core
2-
Main package.
1+
# typescript-package
2+
3+
<a href="https://www.typescriptlang.org/">
4+
<img src="https://creazilla-store.fra1.digitaloceanspaces.com/icons/3257106/file-type-typescript-official-icon-md.png" width="20%" />
5+
</a>
6+
7+
## core
8+
9+
`typescript-package/core`
10+
11+
Core package.
12+
13+
<!-- npm badge -->
14+
[![npm version][typescript-package-npm-badge-svg]][typescript-package-npm-badge]
15+
<!-- GitHub badges -->
16+
[![GitHub issues][typescript-package-badge-issues]][typescript-package-issues]
17+
[![GitHub forks][typescript-package-badge-forks]][typescript-package-forks]
18+
[![GitHub stars][typescript-package-badge-stars]][typescript-package-stars]
19+
[![GitHub license][typescript-package-badge-license]][typescript-package-license]
20+
21+
<br>
22+
23+
## Table of contents
24+
25+
* [Installation](#installation)
26+
* [Api](#api)
27+
* [Git](#git)
28+
* [Commit](#commit)
29+
* [Versioning](#versioning)
30+
* [License](#license)
31+
32+
## Installation
33+
34+
```bash
35+
npm install @typescript-package/core
36+
```
37+
38+
## Api
39+
40+
```typescript
41+
import {
42+
resultCallback,
43+
typeOf
44+
} from '@typescript-package/core';
45+
```
46+
47+
<br>
48+
49+
## GIT
50+
51+
### Commit
52+
53+
* [AngularJS Git Commit Message Conventions][git-commit-angular]
54+
* [Karma Git Commit Msg][git-commit-karma]
55+
* [Conventional Commits][git-commit-conventional]
56+
57+
### Versioning
58+
59+
[Semantic Versioning 2.0.0][git-semver]
60+
61+
**Given a version number MAJOR.MINOR.PATCH, increment the:**
62+
63+
* MAJOR version when you make incompatible API changes,
64+
* MINOR version when you add functionality in a backwards-compatible manner, and
65+
* PATCH version when you make backwards-compatible bug fixes.
66+
67+
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
68+
69+
**FAQ**
70+
How should I deal with revisions in the 0.y.z initial development phase?
71+
72+
> The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.
73+
74+
How do I know when to release 1.0.0?
75+
76+
> If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.
77+
78+
## License
79+
80+
MIT © angular-package ([license][typescript-package-license])
81+
82+
<!-- This package: typescript-package -->
83+
<!-- GitHub: badges -->
84+
[typescript-package-badge-issues]: https://img.shields.io/github/issues/angular-package/typescript-package
85+
[typescript-package-badge-forks]: https://img.shields.io/github/forks/angular-package/typescript-package
86+
[typescript-package-badge-stars]: https://img.shields.io/github/stars/angular-package/typescript-package
87+
[typescript-package-badge-license]: https://img.shields.io/github/license/angular-package/typescript-package
88+
<!-- GitHub: badges links -->
89+
[typescript-package-issues]: https://github.com/angular-package/typescript-package/issues
90+
[typescript-package-forks]: https://github.com/angular-package/typescript-package/network
91+
[typescript-package-license]: https://github.com/angular-package/typescript-package/blob/master/LICENSE
92+
[typescript-package-stars]: https://github.com/angular-package/typescript-package/stargazers
93+
<!-- This package -->
94+
95+
<!-- Package: typescript-package -->
96+
<!-- npm -->
97+
[typescript-package-npm-badge-svg]: https://badge.fury.io/js/%40typescript-package%2Ftypescript-package.svg
98+
[typescript-package-npm-badge]: https://badge.fury.io/js/%40typescript-package%2Ftypescript-package
99+
100+
<!-- GIT -->
101+
[git-semver]: http://semver.org/
102+
103+
<!-- GIT: commit -->
104+
[git-commit-angular]: https://gist.github.com/stephenparish/9941e89d80e2bc58a153
105+
[git-commit-karma]: http://karma-runner.github.io/0.10/dev/git-commit-msg.html
106+
[git-commit-conventional]: https://www.conventionalcommits.org/en/v1.0.0/

ng-package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../../dist/core",
4+
"lib": {
5+
"entryFile": "src/public-api.ts"
6+
}
7+
}

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "@testing-package/core",
3+
"version": "1.0.0",
4+
"author": "wwwdev.io <dev@wwwdev.io>",
5+
"description": "Core package.",
6+
"license": "MIT",
7+
"publishConfig": {
8+
"access": "public",
9+
"registry": "https://registry.npmjs.org"
10+
},
11+
"peerDependencies": {},
12+
"scripts": {},
13+
"repository": {
14+
"type": "git",
15+
"url": "git+https://github.com/typescript-package/core.git"
16+
},
17+
"bugs": {
18+
"url": "https://github.com/typescript-package/core/issues"
19+
},
20+
"keywords": [
21+
"@typescript-package",
22+
"@typescript-package/core"
23+
],
24+
"funding": [
25+
{
26+
"type": "individual",
27+
"url": "https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29"
28+
}
29+
],
30+
"sideEffects": false
31+
}

src/lib/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Function.
2+
export { resultCallback } from './result-callback.func';
3+
export { typeOf } from './type-of.func';

src/lib/result-callback.func.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Default function to handle `callback` of functions.
3+
* @param result A value of `boolean` type of the result of the check.
4+
* @returns The return value is a `boolean` of the result of the check.
5+
*/
6+
export const resultCallback = (result: boolean): boolean => result;

src/lib/type-of.func.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @description Gets the specific object class type of any value.
3+
* @param {*} value Any value to check its object class type.
4+
* @returns {string} The return value is a `string` of the object class name.
5+
* @author https://javascript.plainenglish.io/the-best-way-to-type-check-in-vanilla-js-55197b4f45ec
6+
*/
7+
export const typeOf = (value: any): string =>
8+
Object.prototype.toString.call(value).slice(8, -1).toLowerCase();

src/public-api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/*
2+
* Public API Surface of core
3+
*/
4+
export * from './lib';

tsconfig.lib.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3+
{
4+
"extends": "../../tsconfig.json",
5+
"compilerOptions": {
6+
"outDir": "../../out-tsc/lib",
7+
"declaration": true,
8+
"declarationMap": true,
9+
"inlineSources": true,
10+
"types": []
11+
},
12+
"exclude": [
13+
"**/*.spec.ts"
14+
]
15+
}

tsconfig.lib.prod.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3+
{
4+
"extends": "./tsconfig.lib.json",
5+
"compilerOptions": {
6+
"declarationMap": false
7+
},
8+
"angularCompilerOptions": {
9+
"compilationMode": "partial"
10+
}
11+
}

0 commit comments

Comments
 (0)