You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

array-slice-match

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-slice-match

Extra method for Array (slice by match)

0.0.0
latest
npmnpm
Version published
Maintainers
1
Created
Source

TO BE DEFINED

(below is template only)

Whole repository is template for new Node.js TypeScript module. Download it and adapt to your needs.

  • About
  • Examples
  • Documentation

About

This module extends Array prototype with additional methods:

  • xFindAllSlices() (x stands for custom, non-standard method)
$ npm i -S array-find-slice

Examples

Basic example

import 'array-find-slice';
let arr = ['x', 'A', 'B', 'x', 'x', 'x', 'A', 'B', 'x'];
arr.xFindAllSlices(['A', 'B']); // [['A', 'B'], ['A', 'B']]
arr.xFindAllSlices(['x', 'x']); // [['x', 'x']]
arr.xFindAllSlices(['x']); // [['x'], ['x'], ['x'], ['x'], ['x']]

Documentation

Array.prototype.xFindAllSlices(matcher: DeepPartial[], opts?: Array.XFindAllSlices_Opts)

Options

opts.fullMatch: boolean default false

  • if false (default) then array elements are compared with matcher elements using recursive deep partial match deep-match2.
  • if true then array elements are compared with matcher elements using deep-equal. In case of fullMatch=true TypeScript forces matcher to be non-partial T[].

Keywords

TODO-NPMJS-KEYWORD

FAQs

Package last updated on 31 Jan 2020

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