Socket
Socket
Sign inDemoInstall

@homebound/activesupport

Package Overview
Dependencies
Maintainers
36
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@homebound/activesupport - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

10

dist/index.d.ts

@@ -70,2 +70,7 @@ type KeysOfType<T, TProp> = {

count(f: (el: T, index: number, array: T[]) => boolean): number;
/**
* Compares every element in the array to each other and returns true if they all match `fn(el)` and
* false otherwise. Shorthand for `array.every((el, _, [first]) => el.some.id === first.some.id)`
*/
everyHasSame(fn: (el: T) => unknown): boolean;
}

@@ -132,2 +137,7 @@ interface ReadonlyArray<T> {

count(f: (el: T, index: number, array: readonly T[]) => boolean): number;
/**
* Compares every element in the array to each other and returns true if they all match `fn(el)` and
* false otherwise. Shorthand for `array.every((el, _, [first]) => el.some.id === first.some.id)`
*/
everyHasSame(fn: (el: T) => unknown): boolean;
}

@@ -134,0 +144,0 @@ }

@@ -0,1 +1,2 @@

"use strict";
var __defProp = Object.defineProperty;

@@ -202,2 +203,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;

};
Array.prototype.everyHasSame = function(fn) {
let cached;
return this.every((el, _, [first]) => fn(el) === (cached ??= fn(first)));
};
Object.defineProperty(Array.prototype, "isEmpty", {

@@ -204,0 +209,0 @@ enumerable: false,

2

package.json
{
"name": "@homebound/activesupport",
"version": "1.2.0",
"version": "1.3.0",
"main": "./dist/index.js",

@@ -5,0 +5,0 @@ "module": "./dist/index.mjs",

@@ -68,2 +68,7 @@ import type { KeysOfType } from "./utils";

count(f: (el: T, index: number, array: T[]) => boolean): number;
/**
* Compares every element in the array to each other and returns true if they all match `fn(el)` and
* false otherwise. Shorthand for `array.every((el, _, [first]) => el.some.id === first.some.id)`
*/
everyHasSame(fn: (el: T) => unknown): boolean;
}

@@ -136,2 +141,7 @@

count(f: (el: T, index: number, array: readonly T[]) => boolean): number;
/**
* Compares every element in the array to each other and returns true if they all match `fn(el)` and
* false otherwise. Shorthand for `array.every((el, _, [first]) => el.some.id === first.some.id)`
*/
everyHasSame(fn: (el: T) => unknown): boolean;
}

@@ -406,2 +416,7 @@ }

Array.prototype.everyHasSame = function <T>(this: T[], fn: (el: T) => unknown): boolean {
let cached: unknown;
return this.every((el, _, [first]) => fn(el) === (cached ??= fn(first)));
};
Object.defineProperty(Array.prototype, "isEmpty", {

@@ -408,0 +423,0 @@ enumerable: false,

Sorry, the diff of this file is not supported yet

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