@stackone/utils 0.1.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/README.md +49 -0
- package/dist/index.es.mjs +1 -0
- package/dist/index.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/typeguards.d.ts +7 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @stackone/utils
|
|
2
|
+
## Description
|
|
3
|
+
|
|
4
|
+
This package contains utility functions that can be used across projects to share common generic functionality.
|
|
5
|
+
|
|
6
|
+
This package uses the tech stack provided by the **Connect Monorepo** global setup. Please check the [root README](../../README.md) for more information.
|
|
7
|
+
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
Please check the [root README](../../README.md) for requirements.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# install dependencies
|
|
16
|
+
$ npm run install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Available commands
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# clean build output
|
|
23
|
+
$ npm run clean
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# build package
|
|
28
|
+
$ npm run build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# run tests
|
|
33
|
+
$ npm run test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# run tests on watch mode
|
|
38
|
+
$ npm run test:watch
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# run linter
|
|
43
|
+
$ npm run lint
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# run linter and try to fix any error
|
|
48
|
+
$ npm run lint:fix
|
|
49
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=e=>null!=e,o=e=>null==e||""===e,t=e=>"string"==typeof e,n=e=>"number"==typeof e,l=e=>"boolean"==typeof e,f=e=>e instanceof Date,p=e=>"object"==typeof e&&null!==e;export{l as isBoolean,f as isDate,o as isMissing,n as isNumber,p as isObject,t as isString,e as notMissing};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.isBoolean=e=>"boolean"==typeof e,exports.isDate=e=>e instanceof Date,exports.isMissing=e=>null==e||""===e,exports.isNumber=e=>"number"==typeof e,exports.isObject=e=>"object"==typeof e&&null!==e,exports.isString=e=>"string"==typeof e,exports.notMissing=e=>null!=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { notMissing, isMissing, isString, isNumber, isBoolean, isDate, isObject, } from './typeguards';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const notMissing: <T>(value: T | null | undefined) => value is T;
|
|
2
|
+
export declare const isMissing: <T>(value: T | null | undefined) => boolean;
|
|
3
|
+
export declare const isString: (value: unknown) => value is string;
|
|
4
|
+
export declare const isNumber: (value: unknown) => value is number;
|
|
5
|
+
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
6
|
+
export declare const isDate: (value: unknown) => value is Date;
|
|
7
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stackone/utils",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.es.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"devDependencies": {},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"package.json",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"clean": "rimraf dist",
|
|
16
|
+
"prebuild": "npm run clean",
|
|
17
|
+
"build": "rollup -c --environment NODE_ENV:production",
|
|
18
|
+
"prebuild:dev": "npm run clean",
|
|
19
|
+
"build:dev": "rollup -c --environment NODE_ENV:development",
|
|
20
|
+
"code:format": "biome format ./src ./*.mjs",
|
|
21
|
+
"code:format:fix": "biome format --write ./src ./*.mjs",
|
|
22
|
+
"code:lint": "biome lint --error-on-warnings ./src ./*.mjs",
|
|
23
|
+
"code:lint:fix": "biome lint --write ./src ./*.mjs",
|
|
24
|
+
"code:check": "biome check ./src ./*.mjs",
|
|
25
|
+
"code:check:fix": "biome check --write ./src ./*.mjs",
|
|
26
|
+
"lint": "npm run code:check",
|
|
27
|
+
"lint:fix": "npm run code:check:fix",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest watch",
|
|
30
|
+
"publish-release": "npm publish --access=public"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [],
|
|
33
|
+
"author": "StackOne",
|
|
34
|
+
"license": "ISC",
|
|
35
|
+
"dependencies": {}
|
|
36
|
+
}
|