is-options

WebJar for is-options

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

is-options
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

is-options
WebJar for is-options
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mafintosh/is-options

Download is-options

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/is-options/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>is-options</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/is-options/
implementation 'org.webjars.npm:is-options:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/is-options/
implementation ("org.webjars.npm:is-options:1.0.1")
'org.webjars.npm:is-options:jar:1.0.1'
<dependency org="org.webjars.npm" name="is-options" rev="1.0.1">
  <artifact name="is-options" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='is-options', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "is-options" % "1.0.1"
[org.webjars.npm/is-options "1.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

is-options

Easily check if input is an options map

npm install is-options

Build Status

Usage

var isOptions = require('is-options')

thing('', {foo: true}) // key='', opts={foo: true}
thing({foo: true}) // key=undefined, opts={foo: true}
thing(Buffer.from('buf'), {foo: true}) // key=Buffer('buf'), opts={foo: true}

function thing (optionalKey, opts) {
  if (isOptions(optionalKey)) {
    opts = optionalKey
    optionalKey = undefined
  }

  console.log('key', optionalKey)
  console.log('options', opts)
}

API

bool = isOptions(obj)

Returns true is obj is an object and not a buffer

License

MIT

Versions

Version
1.0.1