longest-streak

WebJar for longest-streak

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

longest-streak
Last Version

Last Version

2.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

longest-streak
WebJar for longest-streak
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/wooorm/longest-streak

Download longest-streak

How to add to project

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

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.

longest-streak

Build Coverage Downloads Size

Count the longest repeating streak of a character.

Install

npm:

npm install longest-streak

Use

var longestStreak = require('longest-streak')

longestStreak('` foo `` bar `', '`') // => 2

API

longestStreak(value, character)

Get the count of the longest repeating streak of character in value.

Parameters
  • value (string) — Content, coerced to string.
  • character (string) — Single character to look for.
Returns

number — Number of characters at the place where character occurs in its longest streak in value.

Throws
  • Error — when character is not a single character string.

License

MIT © Titus Wormer

Versions

Version
2.0.4
2.0.3
2.0.2