You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

fn-code

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fn-code - npm Package Compare versions

Comparing version

to
0.1.1

2

package.json
{
"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 @@