New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bot-command-options-parser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

bot-command-options-parser

```js import CommandOptionsParser from "bot-command-options-parser/dist"

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

Using

import CommandOptionsParser from "bot-command-options-parser/dist"

const commandOptions = [
    {
        name: "person-name",
        type: "string",
        descritpion: "Name of the person",
        required: true
    },
    {
        name: "person-age",
        type: "integer",
        descritpion: "Age of the person",
        required: true
    },
    {
        name: "person-like-minecraft",
        type: "boolean",
        descritpion: "Does the person like to play minecraft?",
        required: true
    }
]
const commandOptionsPassed = [ "Marcuth", "16.7", "true" ]

const optionsParser = new CommandOptionsParser(commandOptions)

const validateResult = optionsParser.validateOptions(commandOptionsPassed)

console.log(validateResult)

Output

[
  {
    name: 'person-name',
    type: 'string',
    values: { raw: 'Marcuth', parsed: 'marcuth' },
    isValid: { type: true, value: true }
  },
  {
    name: 'person-age',
    type: 'integer',
    values: { raw: '16.7', parsed: null },
    isValid: { type: false, value: false }
  },
  {
    name: 'person-like-minecraft',
    type: 'boolean',
    values: { raw: 'true', parsed: true },
    isValid: { type: true, value: true }
  }
]

Keywords

bot

FAQs

Package last updated on 24 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts