starts-with-one-of

v1.0.0arrow_drop_down
v1.0.0
v0.0.1
STATUS
Passing
DOWNLOADS
467
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
7 years ago
SIZE
540 B
Checks whether the string start with on the options specified.
1 contributor
Install starts-with-one-of as a package?
Copied
npm i @bit/bit.utils.string.starts-with-one-of
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
startsWithOneOf (
str:string,
options:Array
) : bool

Checks whether the string start with on the options specified.

Example
startsWithOneOf('hello', ['h', 'afdsf']) // => true
startsWithOneOf('hello', ['g', 'afdsf']) // => false
Arguments
str: string

string to check.

options: Array

options to start with

Returns
bool

whether the string starts with one of the options.

Test Summary

starts-with-one-of should return true if start with first option

Pass

starts-with-one-of should return true if start with first option

Pass

starts-with-one-of should return true if start with first option

Pass

starts-with-one-of should return true if start with first option

Pass

starts-with-one-of should return true if start with last option

Pass

starts-with-one-of should return true if start with option in the middle

Pass

starts-with-one-of should return true if starts with single option

Pass

starts-with-one-of should return false if no options sent

Pass

starts-with-one-of should return false if options is empty array

Pass

starts-with-one-of should return false if options is not an array

Pass

starts-with-one-of should return true if starts with option that is more than one char

Pass

starts-with-one-of should return true if starts with option that is more than one word

Pass

starts-with-one-of should return true if starts with more than one option

Pass

starts-with-one-of should return false if string to check is empty

Pass

starts-with-one-of should return false if string to check is undefined

Pass

starts-with-one-of should return false if string to check is empty and there are no options

Pass

starts-with-one-of should return false if string to check is undefined and there are no options

Pass
Help and resources