Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ephox/polaris

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ephox/polaris - npm Package Compare versions

Comparing version 3.0.18 to 3.0.19

2

lib/main/ts/ephox/polaris/api/Arrays.d.ts

@@ -8,4 +8,4 @@ import { Splitting } from './Main';

declare const splitbyAdv: SplitByAdvApi;
declare type SliceByApi = <T>(list: T[], pred: (x: T, i: number, xs: ReadonlyArray<T>) => boolean) => T[];
declare type SliceByApi = <T>(list: T[], pred: (x: T, i: number, xs: ArrayLike<T>) => boolean) => T[];
declare const sliceby: SliceByApi;
export { splitby, splitbyAdv, sliceby, boundAt };
/**
* Slice an array at the first item matched by the predicate
*/
declare const sliceby: <T>(list: T[], pred: (x: T, i: number, xs: ReadonlyArray<T>) => boolean) => T[];
declare const sliceby: <T>(list: T[], pred: (x: T, i: number, xs: ArrayLike<T>) => boolean) => T[];
export { sliceby };
{
"name": "@ephox/polaris",
"description": "This project does data manipulation on arrays and strings.",
"version": "3.0.18",
"version": "3.0.19",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

@@ -15,3 +15,3 @@ import * as Boundaries from '../array/Boundaries';

type SliceByApi = <T>(list: T[], pred: (x: T, i: number, xs: ReadonlyArray<T>) => boolean) => T[];
type SliceByApi = <T>(list: T[], pred: (x: T, i: number, xs: ArrayLike<T>) => boolean) => T[];
const sliceby: SliceByApi = Slice.sliceby;

@@ -18,0 +18,0 @@

@@ -6,3 +6,3 @@ import { Arr } from '@ephox/katamari';

*/
const sliceby = function <T> (list: T[], pred: (x: T, i: number, xs: ReadonlyArray<T>) => boolean) {
const sliceby = function <T> (list: T[], pred: (x: T, i: number, xs: ArrayLike<T>) => boolean) {
const index = Arr.findIndex(list, pred).getOr(-1);

@@ -9,0 +9,0 @@ return list.slice(0, index);

@@ -5,3 +5,3 @@ import { assert, UnitTest } from '@ephox/bedrock';

UnitTest.test('api.Arrays.sliceby', function () {
const check = function (expected: number[], input: number[], pred: (x: number, i: number, xs: ReadonlyArray<number>) => boolean) {
const check = function (expected: number[], input: number[], pred: (x: number, i: number, xs: ArrayLike<number>) => boolean) {
const actual = Arrays.sliceby(input, pred);

@@ -8,0 +8,0 @@ assert.eq(expected, actual);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc