@krampa/common 0.1.0 → 0.1.1
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 +1 -1
- package/README.md +8 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @krampa/common
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@krampa/common)
|
|
4
|
+
[](https://www.npmjs.com/package/@krampa/common)
|
|
5
|
+
[](https://github.com/dabbe/krampa-common/blob/main/LICENSE)
|
|
2
6
|
|
|
3
7
|
Shared types and constants for the Krampa fitness challenge app.
|
|
4
8
|
|
|
5
9
|
## Installation
|
|
6
10
|
|
|
7
11
|
```bash
|
|
8
|
-
npm install @
|
|
12
|
+
npm install @krampa/common
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
## Usage
|
|
@@ -13,7 +17,7 @@ npm install @dabbe/krampa-common
|
|
|
13
17
|
### Goal Types
|
|
14
18
|
|
|
15
19
|
```typescript
|
|
16
|
-
import { GOAL_TYPES, GOAL_TYPE_VALUES, GoalType } from "@
|
|
20
|
+
import { GOAL_TYPES, GOAL_TYPE_VALUES, GoalType } from "@krampa/common";
|
|
17
21
|
|
|
18
22
|
// Use constants
|
|
19
23
|
const goalType = GOAL_TYPES.FREQUENCY_CARDIO; // "frequency/cardio"
|
|
@@ -25,7 +29,7 @@ const myGoal: GoalType = "weight/loss";
|
|
|
25
29
|
const dbEnum = GOAL_TYPE_VALUES; // Array of all valid goal types
|
|
26
30
|
|
|
27
31
|
// Type guards
|
|
28
|
-
import { isCardioGoal, isWeightGoal } from "@
|
|
32
|
+
import { isCardioGoal, isWeightGoal } from "@krampa/common";
|
|
29
33
|
|
|
30
34
|
if (isCardioGoal(goal.type)) {
|
|
31
35
|
// Handle cardio-specific logic
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED