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

@opencreek/ext

Package Overview
Dependencies
Maintainers
4
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opencreek/ext - npm Package Compare versions

Comparing version 2.0.1--canary.25.5748379176.0 to 2.0.1--canary.26.5748407676.0

18

package.json
{
"name": "@opencreek/ext",
"version": "2.0.1--canary.25.5748379176.0",
"version": "2.0.1--canary.26.5748407676.0",
"description": "",

@@ -28,9 +28,9 @@ "main": "build/index.js",

"@types/node": "^17.0.17",
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.32.0",
"auto": "^10.32.6",
"ava": "^4.0.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"prettier": "^2.4.1",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"auto": "^11.0.0",
"ava": "^5.3.1",
"eslint": "^8.46.0",
"eslint-config-prettier": "^8.10.0",
"prettier": "^3.0.1",
"typescript": "5.1.6"

@@ -53,4 +53,4 @@ },

"dependencies": {
"@opencreek/deno-std-collections": "^0.109.0"
"@opencreek/deno-std-collections": "^0.109.1"
}
}

@@ -31,3 +31,3 @@ import test from "ava"

chain(arr).findIndex((n) => n === 5),
undefined
undefined,
)

@@ -113,3 +113,3 @@ })

chain([]).maxOf((n) => n + 2),
undefined
undefined,
)

@@ -125,3 +125,3 @@ })

chain([]).minOf((n) => n + 2),
undefined
undefined,
)

@@ -128,0 +128,0 @@ })

@@ -46,6 +46,6 @@ import {

export function objChain<K extends string | number | symbol, T>(
value: Record<K, T> | ObjectChain<K, T> | Chain<readonly [K, T]>
value: Record<K, T> | ObjectChain<K, T> | Chain<readonly [K, T]>,
): ObjectChain<K, T>
export function objChain<_K extends string | number | symbol, _T>(
value: undefined | null
value: undefined | null,
): undefined

@@ -58,3 +58,3 @@ export function objChain<K extends string | number | symbol, T>(

| undefined
| null
| null,
): ObjectChain<K, T> | undefined

@@ -67,3 +67,3 @@ export function objChain<K extends string | number | symbol, T>(

| undefined
| null
| null,
): ObjectChain<K, T> | undefined {

@@ -86,10 +86,10 @@ if (value == null) return undefined

export function chain<T>(
value: ReadonlyArray<T> | Chain<T> | Iterable<T>
value: ReadonlyArray<T> | Chain<T> | Iterable<T>,
): Chain<T>
export function chain<_T>(value: undefined | null): undefined
export function chain<T>(
value: ReadonlyArray<T> | Chain<T> | Iterable<T> | undefined | null
value: ReadonlyArray<T> | Chain<T> | Iterable<T> | undefined | null,
): Chain<T> | undefined
export function chain<T>(
value: ReadonlyArray<T> | Chain<T> | Iterable<T> | undefined | null
value: ReadonlyArray<T> | Chain<T> | Iterable<T> | undefined | null,
): Chain<T> | undefined {

@@ -123,3 +123,3 @@ if (value == null) return undefined

mapKeys<U extends string | number | symbol>(
transformer: (key: K) => U
transformer: (key: K) => U,
): ObjectChain<U, T> {

@@ -144,3 +144,3 @@ const entries = Object.entries(this.val) as [K, T][]

mapEntries<U extends string | number | symbol, V>(
transformer: (key: K, value: T) => [U, V]
transformer: (key: K, value: T) => [U, V],
): ObjectChain<U, V> {

@@ -195,3 +195,3 @@ const entries = Object.entries(this.val) as [K, T][]

associateBy<S extends string | number | symbol>(
selector: (el: T) => S
selector: (el: T) => S,
): ObjectChain<S, T> {

@@ -205,3 +205,3 @@ const entries = this.map((m) => {

associateWith<U>(
selector: (key: string) => U
selector: (key: string) => U,
): IfString<T, ObjectChain<string, U>> {

@@ -243,9 +243,9 @@ const entries = this.map((el) => {

every<S extends T>(
predicate: (el: T, index: number, array: ReadonlyArray<T>) => el is S
predicate: (el: T, index: number, array: ReadonlyArray<T>) => el is S,
): this is Chain<S>
every(
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean,
): boolean
every(
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean,
): boolean {

@@ -256,3 +256,3 @@ return this.val.every(predicate)

some(
predicate: (value: T, index: number, array: ReadonlyArray<T>) => boolean
predicate: (value: T, index: number, array: ReadonlyArray<T>) => boolean,
): boolean {

@@ -271,9 +271,9 @@ return this.val.some(predicate)

filter<S extends T>(
filter: (el: T, index: number, array: ReadonlyArray<T>) => el is S
filter: (el: T, index: number, array: ReadonlyArray<T>) => el is S,
): Chain<S>
filter(
filter: (el: T, index: number, array: ReadonlyArray<T>) => boolean
filter: (el: T, index: number, array: ReadonlyArray<T>) => boolean,
): Chain<T>
filter(
filter: (el: T, index: number, array: ReadonlyArray<T>) => boolean
filter: (el: T, index: number, array: ReadonlyArray<T>) => boolean,
): Chain<T> {

@@ -288,4 +288,4 @@ const filtered = this.val.filter(filter)

index: number,
array: ReadonlyArray<T>
) => Promise<boolean>
array: ReadonlyArray<T>,
) => Promise<boolean>,
): Promise<Chain<T>> {

@@ -301,9 +301,9 @@ const includes = await this.mapAsync(predicate)

find<S extends T>(
predicate: (el: T, index: number, array: ReadonlyArray<T>) => el is S
predicate: (el: T, index: number, array: ReadonlyArray<T>) => el is S,
): S | undefined
find(
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean,
): T | undefined
find(
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean,
): T | undefined {

@@ -314,3 +314,3 @@ return this.val.find(predicate)

findIndex(
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean
predicate: (el: T, index: number, array: ReadonlyArray<T>) => boolean,
): number | undefined {

@@ -335,3 +335,3 @@ const ret = this.val.findIndex(predicate)

firstNotNullishOf<O>(
selector: (item: T) => O | undefined | null
selector: (item: T) => O | undefined | null,
): NonNullable<O> | undefined {

@@ -343,3 +343,3 @@ return firstNotNullishOf(this.val, selector)

const flattened = this.val.flatMap((it) =>
it instanceof Chain ? it.val : Array.isArray(it) ? it : [it]
it instanceof Chain ? it.val : Array.isArray(it) ? it : [it],
)

@@ -353,4 +353,4 @@ return new Chain(flattened) as FlattenChain<T>

index: number,
array: ReadonlyArray<T>
) => Chain<U> | ReadonlyArray<U>
array: ReadonlyArray<T>,
) => Chain<U> | ReadonlyArray<U>,
): Chain<U> {

@@ -366,3 +366,3 @@ const ret = this.val.flatMap((el, index, arr) => {

forEach(
callback: (el: T, index: number, array: ReadonlyArray<T>) => void
callback: (el: T, index: number, array: ReadonlyArray<T>) => void,
): void {

@@ -373,3 +373,3 @@ this.map(callback)

groupBy<K extends string | symbol | number>(
selector: (el: T) => K
selector: (el: T) => K,
): ObjectChain<K, ReadonlyArray<T>> {

@@ -432,3 +432,3 @@ const record = {} as Record<K, Array<T>>

map<U>(
transformer: (el: T, index: number, array: ReadonlyArray<T>) => U
transformer: (el: T, index: number, array: ReadonlyArray<T>) => U,
): Chain<U> {

@@ -440,3 +440,3 @@ const mapped = this.val.map(transformer)

async mapAsync<U>(
transformer: (el: T, index: number, array: ReadonlyArray<T>) => Promise<U>
transformer: (el: T, index: number, array: ReadonlyArray<T>) => Promise<U>,
): Promise<Chain<U>> {

@@ -466,3 +466,3 @@ const ret = await Promise.all(this.val.map(transformer))

maxOf<R extends bigint | number | string | Date>(
selector: (el: T) => R
selector: (el: T) => R,
): R | undefined {

@@ -496,3 +496,3 @@ if (this.val.length === 0) return undefined

minOf<R extends bigint | number | string | Date>(
selector: (el: T) => R
selector: (el: T) => R,
): R | undefined {

@@ -527,4 +527,4 @@ if (this.val.length === 0) return undefined

index: number,
array: ReadonlyArray<T>
) => T
array: ReadonlyArray<T>,
) => T,
): T

@@ -536,5 +536,5 @@ reduce(

index: number,
array: ReadonlyArray<T>
array: ReadonlyArray<T>,
) => T,
initial: T
initial: T,
): T

@@ -546,5 +546,5 @@ reduce<O>(

index: number,
array: ReadonlyArray<T>
array: ReadonlyArray<T>,
) => O,
initial: O
initial: O,
): O

@@ -556,5 +556,5 @@ reduce<O>(

index: number,
array: ReadonlyArray<T>
array: ReadonlyArray<T>,
) => O,
initial?: O
initial?: O,
): O {

@@ -569,4 +569,4 @@ return this.val.reduce<O>(reducer, initial as O)

index: number,
array: ReadonlyArray<T>
) => T
array: ReadonlyArray<T>,
) => T,
): T

@@ -578,5 +578,5 @@ reduceRight(

index: number,
array: ReadonlyArray<T>
array: ReadonlyArray<T>,
) => T,
initial: T
initial: T,
): T

@@ -588,5 +588,5 @@ reduceRight<O>(

index: number,
array: ReadonlyArray<T>
array: ReadonlyArray<T>,
) => O,
initial: O
initial: O,
): O

@@ -598,5 +598,5 @@ reduceRight<O>(

index: number,
array: ReadonlyArray<T>
array: ReadonlyArray<T>,
) => O,
initial?: O
initial?: O,
): O {

@@ -612,3 +612,3 @@ return this.val.reduceRight<O>(reducer, initial as O)

reducer: (accumulator: O, current: T) => O,
initialValue: O
initialValue: O,
): Chain<O> {

@@ -631,3 +631,3 @@ const ret = runningReduce(this.val, reducer, initialValue)

size: number,
{ step, partial }: { step: number; partial: boolean }
{ step, partial }: { step: number; partial: boolean },
): Chain<T[]> {

@@ -634,0 +634,0 @@ const ret = slidingWindows(this.val, size, { step, partial })

@@ -5,3 +5,3 @@ /* eslint-disable @typescript-eslint/ban-types */

func: Function,
functionName: string
functionName: string,
): void {

@@ -18,3 +18,3 @@ if (!Object.getOwnPropertyNames(target.prototype).includes(functionName)) {

target: Function,
wrap: T
wrap: T,
): void {

@@ -37,3 +37,3 @@ const keys = Object.keys(wrap)

infer T,
...infer _
...infer _,
]

@@ -40,0 +40,0 @@ ? T

@@ -6,3 +6,3 @@ import { mapValues } from "@opencreek/deno-std-collections"

this: NonNullable<T>,
body: (thiz: NonNullable<T>) => V
body: (thiz: NonNullable<T>) => V,
): V {

@@ -14,3 +14,3 @@ return body(this)

this: NonNullable<T>,
predicate: (thiz: NonNullable<T>) => boolean
predicate: (thiz: NonNullable<T>) => boolean,
): T | undefined {

@@ -23,3 +23,3 @@ if (predicate(this)) return this

this: NonNullable<T>,
predicate: (thiz: NonNullable<T>) => boolean
predicate: (thiz: NonNullable<T>) => boolean,
): T | undefined {

@@ -41,3 +41,3 @@ if (predicate(this)) return undefined

this: NonNullable<T>,
predicate: (thiz: NonNullable<T>) => boolean
predicate: (thiz: NonNullable<T>) => boolean,
): T | undefined

@@ -47,3 +47,3 @@

this: NonNullable<T>,
predicate: (thiz: NonNullable<T>) => boolean
predicate: (thiz: NonNullable<T>) => boolean,
): T | undefined

@@ -53,5 +53,5 @@

this: Readonly<Record<Key, T>>,
transformer: (value: T) => O
transformer: (value: T) => O,
): Record<Key, O>
}
}

@@ -11,3 +11,3 @@ export function undefinedIfNaN(n: number): number | undefined {

s: string,
radix?: number
radix?: number,
): number | undefined {

@@ -14,0 +14,0 @@ return undefinedIfNaN(parseInt(s, radix))

@@ -20,8 +20,8 @@ import test from "ava"

range(8, 3, -0.5),
[3.5, 4, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0].reverse()
[3.5, 4, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0].reverse(),
)
t.deepEqual(
range(8, 3, 0.5),
[3.5, 4, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0].reverse()
[3.5, 4, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0].reverse(),
)
})

@@ -15,3 +15,3 @@ import test from "ava"

undefined,
"some string"
"some string",
)

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

@@ -28,4 +28,4 @@ import test from "ava"

| bla | aiaiaiaiai |
------------------------------------------`
------------------------------------------`,
)
})

@@ -8,3 +8,3 @@ import { range } from "./range"

columns: Array<keyof T>,
columnLengths: Array<number>
columnLengths: Array<number>,
): string {

@@ -39,3 +39,3 @@ return (

export function tableToString<
T extends Record<string | number | symbol, unknown>
T extends Record<string | number | symbol, unknown>,
>(table: Array<T>, columns: Array<keyof T>): string {

@@ -46,3 +46,3 @@ const columnLengths = columns.map((key) => {

String(key).length,
...table.map((it) => String(it[key]).length)
...table.map((it) => String(it[key]).length),
) + 1

@@ -49,0 +49,0 @@ )

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