Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@erboladaiorg/explicabo-eius-adipisci
Advanced tools
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) ![Build](https://github.com/erboladaiorg/explicabo-eius-adipisci/workflows/Npm%20deploy/badge.svg) ![Version](https://img.shields.io/npm/v/@erboladai
The library is available as a npm package. To install the package, run:
npm install @erboladaiorg/explicabo-eius-adipisci
# or
yarn add @erboladaiorg/explicabo-eius-adipisci
Start using:
import {byString} from '@erboladaiorg/explicabo-eius-adipisci'
const unsorted = ["xxx", "bbbb", "zzz", "cccc", "aaa"];
const sorted = unsorted.sort(byString());
console.log(sorted); //(5) ["aaa", "bbbb", "cccc", "xxx", "zzz"]
Use directly in the browser
<script src='https://cdn.jsdelivr.net/npm/@erboladaiorg/explicabo-eius-adipisci/dist/index.umd.js'></script>
<script>
const unsorted = ["xxx", "bbbb", "zzz", "cccc", "aaa"];
const sorted = unsorted.sort(sort.byString());
console.log(sorted); //(5) ["aaa", "bbbb", "cccc", "xxx", "zzz"]
</script>
//or via browser modules
<script type='module'>
import {byString} from 'https://cdn.jsdelivr.net/npm/@erboladaiorg/explicabo-eius-adipisci/dist/index.mjs'
const unsorted = ["xxx", "bbbb", "zzz", "cccc", "aaa"];
const sorted = unsorted.sort(byString());
console.log(sorted); //(5) ["aaa", "bbbb", "cccc", "xxx", "zzz"]
</script>
sort by a single property
//js or ts file
import {byValue, byNumber, byString} from '@erboladaiorg/explicabo-eius-adipisci'
const arrayUnsorted = [
{prop: "xxx", foo: 34},
{prop: "aaa", foo: 325},
{prop: "zzz", foo: 15},
{prop: "ccc", foo: 340},
{prop: "bbb", foo: 0}
];
//this sort by the foo property ascending
const sortedByFoo = arrayUnsorted.sort(byValue((i) => i.foo, byNumber()));
console.log(sortedByFoo); //(5) [{prop: "bbb", foo : 0}, {prop: "zzz", foo: 15}, .....];
//this sort by the prop property descending
const sortedByProp = arrayUnsorted.sort(byValue((i) => i.prop, byString({desc: true})));
console.log(sortedByProp); //(5) [{prop: "zzz", foo : 15}, {prop: "xxx", foo: 34}, .....];
sort by a multiple property
//js or ts file
import {byNumber, byString, byValues} from "@erboladaiorg/explicabo-eius-adipisci";
const objsToSort = [
{id: 2, name: 'teresa'},
{id: 3, name: 'roberto'},
{id: 2, name: 'roberto'}
];
//i sort by THEIR NAMES and THEN by their ids
const sortedObject = objsToSort.sort(byValues([
[(x) => x.name, byString()],
[(x) => x.id, byNumber()]
]));
console.log(sortedObject); //[{roberto, 2}, {roberto, 3}, {teresa, 2}];
//i sort by THEIR IDS and THEN by their names
const sortedObject2 = objsToSort.sort(byValues([
[(x) => x.id, byNumber()],
[(x) => x.name, byString()]
]));
console.log(sortedObject2); //[{roberto, 2}, {teresa, 2}, {roberto, 3}];
//i sort by THEIR IDS and THEN by their names DESCENDING
const sortedObject3 = objsToSort.sort(byValues([
[(x) => x.id, byNumber()],
[(x) => x.name, byString({desc: true})],
]));
console.log(sortedObject3); //[{teresa, 2}, {roberto, 2}, {roberto, 3}];
typescript types check
//ts file
import {byValue, byNumber, byString} from '@erboladaiorg/explicabo-eius-adipisci'
const objsArray = [{numbProp: 2, stringProp: 'a'}, {numbProp: 3, stringProp: 'f'}];
//Incorrect sort property
const incorrectSortedArray = objsArray.sort(byValue(i => i.numbProp, byString()));
//ts check error : Type 'number' is not assignable to type 'string'.
//Correct sort type
const sortedArray = objsArray.sort(byValue(i => i.numbProp, byNumber()))
//ts check ok
MIT © Cosimo chellini
FAQs
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) ![Build](https://github.com/erboladaiorg/explicabo-eius-adipisci/workflows/Npm%20deploy/badge.svg) ![Version](https://img.shields.io/npm/v/@erboladai
The npm package @erboladaiorg/explicabo-eius-adipisci receives a total of 0 weekly downloads. As such, @erboladaiorg/explicabo-eius-adipisci popularity was classified as not popular.
We found that @erboladaiorg/explicabo-eius-adipisci demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.