Comparing version
{ | ||
"name": "fn-code", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Functions (fn) to make code cleaner", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
# Fn functions | ||
# Fn functions | ||
@@ -14,3 +14,3 @@ > Functions (fn) that make your javascript code cleaner | ||
Use your favorite package manager to install. For instance: | ||
Use your favorite package manager to install. For instance: | ||
@@ -40,3 +40,3 @@ ```bash | ||
For example: | ||
For example: | ||
@@ -56,3 +56,3 @@ My const variable `binomalName` depends on the `animal` variable value. | ||
You try something like: | ||
You try something like: | ||
@@ -63,3 +63,3 @@ ```typescript | ||
This is meets the const criteria. But what if you would have a third species now (animal 'lion' for instance)? | ||
This is meets the const criteria. But what if you would have a third species now (animal 'lion' for instance)? | ||
@@ -106,3 +106,3 @@ ```typescript | ||
But what if you want to have a **default** value for binomialName when no condition is met? | ||
But what if you want to have a **default** value for binomialName when no condition is met? | ||
For that, you can use the third optional argument, passing `{ default: '' }` | ||
@@ -138,6 +138,6 @@ | ||
case: (str: string) => str.includes('dog'), | ||
value: 'Canis familiaris' | ||
value: 'Canis familiaris' | ||
} | ||
], { default: 'Species not found' }) | ||
```` | ||
@@ -144,0 +144,0 @@ |
8685
-0.1%