New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@itrocks/sorted-array

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@itrocks/sorted-array - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json

@@ -53,3 +53,3 @@ {

"types": "./sorted-array.d.ts",
"version": "0.0.1"
"version": "0.0.2"
}

@@ -0,1 +1,7 @@

![written in TypeScript](https://badgen.net/badge/icon/typescript?icon=typescript&label)
[![view on npm](https://badgen.net/npm/v/@itrocks/sorted-array)](https://www.npmjs.org/package/@itrocks/sorted-array)
[![npm module downloads](https://badgen.net/npm/dt/@itrocks/sorted-array)](https://www.npmjs.org/package/@itrocks/sorted-array)
[![GitHub repo dependents](https://badgen.net/github/dependents-repo/itrocks-ts/sorted-array)](https://github.com/itrocks-ts/sorted-array/network/dependents?dependent_type=REPOSITORY)
[![GitHub package dependents](https://badgen.net/github/dependents-pkg/itrocks-ts/sorted-array)](https://github.com/itrocks-ts/sorted-array/network/dependents?dependent_type=PACKAGE)
# sorted-array

@@ -152,17 +158,17 @@

- If `compareBy` is a number, it specifies the index of each inner array's element that will be used for comparison.
Example:
```js
new SortedArrayBy(1, ['a', 'c', 'b'], ['r', 'd', 'a'])
```
The array will be continuously sorted by the 2nd element of the array (index 1), comparing `'c'` and `'d'` in this example.
<br/><br/>
**Example**:
```js
new SortedArrayBy(1, ['a', 'c', 'b'], ['r', 'd', 'a'])
```
The array will be continuously sorted by the 2nd element of the array (index 1), comparing `'c'` and `'d'` in this example.
- If `compareBy` is a number or a string, it specifies the property name by which object elements will be compared.
Example:
```js
new SortedArrayBy('name', { age: 30, name: 'Henry', age: 20, name: 'Johana' })
```
The array will be continuously sorted by the value of the property named `name` into the object element.
<br/><br/>
**Example**:
```js
new SortedArrayBy('name', { age: 30, name: 'Henry', age: 20, name: 'Johana' })
```
The array will be continuously sorted by the value of the property named `name` into the object element.
- The `elements` and `arrayLength` parameters function the same as in the standard JavaScript

@@ -169,0 +175,0 @@ [Array constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/Array).

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