JSPM

array-find-predecessor

0.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1329
  • Score
    100M100P100Q113779F
  • License MIT

Find a predecessor value of the array that should be chosen when a given array index is removed

Package Exports

  • array-find-predecessor

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (array-find-predecessor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

str-indexes-of

NPM version Bower version Build Status Coverage Status devDependencies Status

Like String#indexOf, but return all indexes instead of the first one

import strIndexesOf from 'str-indexes-of';

strIndexesOf('aaa', 'a'); //=> [0, 1, 2]
strIndexesOf('ffoofffofofofofofffooffoo', 'foo'); //=> [1, 18, 22]

Almost the same module as indexes-of, but:

  • only supports String explicitly
    • throws TypeError when it takes an Array
  • supports optional fromIndex parameter
  • disallows empty search value

Installation

npm

npm install str-indexes-of

bower

bower install str-indexes-of

API

strIndexesOf(str, searchValue [, fromIndex])

str: String
searchValue: String (value to search for)
fromIndex: Number (index in the string where to begin searching)
Return: Array of String

strIndexesOf('ABC-ABC', 'A'); //=> [0, 4]
strIndexesOf('ABC-ABC', 'A', 4); //=> [4]

arr-indexes-of - Array#indexOf version

License

Copyright (c) 2016 Shinnosuke Watanabe

Licensed under the MIT License.