Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-user

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-user - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

8

index.js
'use strict';
const userArr = ['user', 'admin', 'manager', 'superadmin', 'ceo'];
const is = input => {
const is = (userArr, input) => {
const inputLowerCase = input.toLowerCase();
return userArr.includes(inputLowerCase);
const userArrLowerCase = userArr.map( item => item.toLowerCase());
return userArrLowerCase.includes(inputLowerCase);
};

@@ -7,0 +9,0 @@ module.exports = {

{
"name": "is-user",
"version": "1.0.0",
"version": "1.1.0",
"description": "",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -9,4 +9,5 @@ ## Is-User

const isUser = require('is-user');
let isAdmin = isUser.is('admin'); //true
let isManager = isUser.is('manager'); //true
const userArr = ['user', 'admin', 'manager', 'superadmin', 'ceo'];
let isAdmin = isUser.is(userArr, 'admin'); //true
let isManager = isUser.is(userArr, 'manager'); //true
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc