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

all-of-just

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

all-of-just - npm Package Compare versions

Comparing version 0.2.4 to 0.3.0

just.d.ts

357

arrays.d.ts

@@ -1,358 +0,3 @@

declare module 'just-clamp' {
export default function clamp(b1: number, n: number, b2: number): number;
}
/// <reference path="./just.d.ts" />
declare module 'just-clone' {
// Definitions by: Chris Howard <https://github.com/ConnectivityChris>
function clone<T extends object>(obj: T): T;
export = clone;
}
declare module 'just-compact' {
// NaN and document.all are also falsy but they cannot be represented as a type
type Falsy = false | null | undefined | '' | 0 | 0n;
// return type has
export default function compact<T>(arr: (Falsy | T)[]): T[];
}
declare module 'just-curry-it' {
export = curry;
// TODO: get more specific with permssible param types for returned function
function curry(fn: Function, arity?: number): Function;
}
declare module 'just-debounce-it' {
// Definitions by: Aziz Khambati <https://github.com/azizhk>
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any
? A
: never;
type MethodTypes = {
cancel: () => void;
flush: () => void;
};
export = debounce;
function debounce<T extends Function>(
fn: T,
wait?: 0,
callFirst?: boolean
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst: true
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst?: false
): ((...args: ArgumentTypes<T>) => void) & MethodTypes;
}
declare module 'just-diff' {
// Definitions by: Cameron Hunter <https://github.com/cameronhunter>
// Modified by: Angus Croll <https://github.com/angus-c>
type Operation = 'add' | 'replace' | 'remove';
type JSONPatchPathConverter<OUTPUT> = (
arrayPath: Array<string | number>
) => OUTPUT;
export function diff(
a: object | Array<any>,
b: object | Array<any>
): Array<{ op: Operation; path: Array<string | number>; value: any }>;
export function diff<PATH>(
a: object | Array<any>,
b: object | Array<any>,
jsonPatchPathConverter: JSONPatchPathConverter<PATH>
): Array<{ op: Operation; path: PATH; value: any }>;
export const jsonPatchPathConverter: JSONPatchPathConverter<string>;
}
declare module 'just-extend' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function extend(obj1: object, ...objn: any[]): object;
function extend(deep: boolean, obj1: object, ...objn: any[]): object;
export = extend;
}
declare module 'just-filter-object' {
type PlainObject<T> = T extends Map<any, any> | Set<any> | null
? never
: T extends object
? T
: never;
function filter<T>(
obj: PlainObject<T>,
fn: (key: keyof T, value: T[typeof key]) => any
): Partial<T>;
export = filter;
}
declare module 'just-flatten-it' {
type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
function flatten<T>(list: RecursiveList<T>, depth?: number): T[];
export = flatten;
}
declare module 'just-group-by' {
type PropertyKey = string | symbol;
type Stringifyable = {
toString: () => string;
};
export default function groupBy<T>(
arr: T[],
cb: (arg: T) => Stringifyable
): { [key in PropertyKey]: T[] };
}
declare module 'just-index' {
function index<T>(
list: Array<T | null | undefined>,
key: string
): Record<string, T>;
export = index;
}
declare module 'just-insert' {
export default function insert<T, U>(
arr1: T[],
arr2: U[] | U,
index?: number
): (T | U)[];
}
declare module 'just-intersect' {
export default function intersect<T, U, I extends T | U>(
arr1: T[],
arr2: U[]
): I[];
}
declare module 'just-is-prime' {
export default function isPrime(number: number): boolean;
}
declare module 'just-last' {
type ArrayWithLastType<Last> = [...unknown[], Last];
export default function last(arr: []): undefined;
export default function last<Last>(arr: ArrayWithLastType<Last>): Last;
export default function last<Last>(
arr: ArrayWithLastType<Last> | []
): Last | undefined;
}
declare module 'just-map-values' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function map<T extends {}>(
item: T,
callback: (value: any, key: string, object: T) => any
): {};
export = map;
}
declare module 'just-mean' {
export default function mean(arr: [number, ...number[]]): number;
export default function mean(arg1: number, ...args: number[]): number;
}
declare module 'just-median' {
export default function median(arr: [number, ...number[]]): number;
export default function median(number: number, ...arr: number[]): number;
}
declare module 'just-memoize-last' {
export = memoizeLast;
function memoizeLast<T extends Function>(
fn: T,
isEqual?: (args1: any, args2: any) => boolean
): T;
}
declare module 'just-merge' {
// Definitions by: nokazn <https://github.com/nokazn>
function merge(obj1: object, ...objs: object[]): object;
export = merge;
}
declare module 'just-modulo' {
export default function modulo(n: number, d: number): number;
}
declare module 'just-omit' {
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove: Key[]
): Omit<Obj, Key>;
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove1: Key,
...removeN: Key[]
): Omit<Obj, Key>;
}
declare module 'just-once' {
export function once<Func extends (...args: unknown[]) => unknown>(
fn: Func
): Func;
}
declare module 'just-partition' {
export default function partition<First, Second>(
arr: (First | Second)[],
fn: (arg: First | Second) => unknown
): [First[], Second[]];
}
declare module 'just-permutations' {
export default function permutations<First, Rest>(
arr: [First, ...Rest[]]
): (First | Rest)[][];
export default function permutations<T>(arr: T[]): T[]; // for empty arrays
}
declare module 'just-pick' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function pick<T, U extends keyof T>(obj: T, select: U[]): Pick<T, U>;
function pick<T, U extends keyof T>(
obj: T,
select1: U,
...selectn: U[]
): Pick<T, U>;
export = pick;
}
declare module 'just-random' {
export default function random<Head, Rest>(
arr: [Head, ...Rest[]]
): Head | Rest;
export default function random<T>(arr: T[]): undefined; // return undefined for empty arrays.
}
declare module 'just-range' {
function range(stop: number): number[];
function range(
start?: number,
stop?: number | null | undefined,
step?: number | null
): number[];
export = range;
}
declare module 'just-remove' {
export default function remove<T, U, V extends T>(
arr1: T[],
arr2: U[]
): (V | Exclude<T, U>)[];
}
declare module 'just-safe-get' {
// Definitions by: Richard Tan <https://github.com/chardos>
function get(
item: any[] | {},
target: string | string[],
defaultValue?: any
): any;
export = get;
}
declare module 'just-safe-set' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function set(
item: any[] | {},
target: string | symbol | Array<string | symbol>,
value: any
): boolean;
export = set;
}
declare module 'just-shuffle' {
type Options = {
shuffleAll: boolean;
};
export default function shuffle<T>(arr: T[], options?: Options): T[];
}
declare module 'just-snake-case' {
// Definitions by: Michael Wittwer <https://github.com/michaelwittwer>
function snakeCase(value: string): string;
export = snakeCase;
}
declare module 'just-sort-by' {
function sortBy<T>(arr: T[], iteratee?: string | Function): T[];
export = sortBy;
}
declare module 'just-split' {
export default function split<T>(arr: T[], n?: number | null): Array<T[]>;
}
declare module 'just-throttle' {
// Definitions by: Dominik Rowicki <https://github.com/papermana>
// Modified by: Angus Croll <https://github.com/angus-c>
type options = {
leading?: boolean;
trailing?: boolean;
};
type Methods = {
cancel: () => void;
flush: () => void;
};
function throttle<Func extends (...args: any[]) => any>(
fn: Func,
interval: number,
options?: options
): Func & Methods;
export = throttle;
}
declare module 'just-union' {
export default function union<T, U>(arr1: T[], arr2: U[]): (T | U)[];
}
declare module 'just-unique' {
export default function unique<T>(
arr: string[],
sorted: boolean | null,
strings: true
): string[];
export default function unique<T>(
arr: T[],
sorted?: boolean | null,
strings?: false | null
): T[];
}
declare module 'just-values' {
export function values<Arr extends unknown[]>(obj: Arr): Arr;
export function values<Obj extends object>(
obj: Obj
): Obj extends String
? Obj[number][]
: Obj extends Number | Boolean
? unknown[]
: Obj[keyof Obj][];
}
export { default as cartesianProduct } from 'just-cartesian-product';

@@ -359,0 +4,0 @@ export { default as unique } from 'just-unique';

@@ -1,358 +0,3 @@

declare module 'just-clamp' {
export default function clamp(b1: number, n: number, b2: number): number;
}
/// <reference path="./just.d.ts" />
declare module 'just-clone' {
// Definitions by: Chris Howard <https://github.com/ConnectivityChris>
function clone<T extends object>(obj: T): T;
export = clone;
}
declare module 'just-compact' {
// NaN and document.all are also falsy but they cannot be represented as a type
type Falsy = false | null | undefined | '' | 0 | 0n;
// return type has
export default function compact<T>(arr: (Falsy | T)[]): T[];
}
declare module 'just-curry-it' {
export = curry;
// TODO: get more specific with permssible param types for returned function
function curry(fn: Function, arity?: number): Function;
}
declare module 'just-debounce-it' {
// Definitions by: Aziz Khambati <https://github.com/azizhk>
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any
? A
: never;
type MethodTypes = {
cancel: () => void;
flush: () => void;
};
export = debounce;
function debounce<T extends Function>(
fn: T,
wait?: 0,
callFirst?: boolean
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst: true
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst?: false
): ((...args: ArgumentTypes<T>) => void) & MethodTypes;
}
declare module 'just-diff' {
// Definitions by: Cameron Hunter <https://github.com/cameronhunter>
// Modified by: Angus Croll <https://github.com/angus-c>
type Operation = 'add' | 'replace' | 'remove';
type JSONPatchPathConverter<OUTPUT> = (
arrayPath: Array<string | number>
) => OUTPUT;
export function diff(
a: object | Array<any>,
b: object | Array<any>
): Array<{ op: Operation; path: Array<string | number>; value: any }>;
export function diff<PATH>(
a: object | Array<any>,
b: object | Array<any>,
jsonPatchPathConverter: JSONPatchPathConverter<PATH>
): Array<{ op: Operation; path: PATH; value: any }>;
export const jsonPatchPathConverter: JSONPatchPathConverter<string>;
}
declare module 'just-extend' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function extend(obj1: object, ...objn: any[]): object;
function extend(deep: boolean, obj1: object, ...objn: any[]): object;
export = extend;
}
declare module 'just-filter-object' {
type PlainObject<T> = T extends Map<any, any> | Set<any> | null
? never
: T extends object
? T
: never;
function filter<T>(
obj: PlainObject<T>,
fn: (key: keyof T, value: T[typeof key]) => any
): Partial<T>;
export = filter;
}
declare module 'just-flatten-it' {
type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
function flatten<T>(list: RecursiveList<T>, depth?: number): T[];
export = flatten;
}
declare module 'just-group-by' {
type PropertyKey = string | symbol;
type Stringifyable = {
toString: () => string;
};
export default function groupBy<T>(
arr: T[],
cb: (arg: T) => Stringifyable
): { [key in PropertyKey]: T[] };
}
declare module 'just-index' {
function index<T>(
list: Array<T | null | undefined>,
key: string
): Record<string, T>;
export = index;
}
declare module 'just-insert' {
export default function insert<T, U>(
arr1: T[],
arr2: U[] | U,
index?: number
): (T | U)[];
}
declare module 'just-intersect' {
export default function intersect<T, U, I extends T | U>(
arr1: T[],
arr2: U[]
): I[];
}
declare module 'just-is-prime' {
export default function isPrime(number: number): boolean;
}
declare module 'just-last' {
type ArrayWithLastType<Last> = [...unknown[], Last];
export default function last(arr: []): undefined;
export default function last<Last>(arr: ArrayWithLastType<Last>): Last;
export default function last<Last>(
arr: ArrayWithLastType<Last> | []
): Last | undefined;
}
declare module 'just-map-values' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function map<T extends {}>(
item: T,
callback: (value: any, key: string, object: T) => any
): {};
export = map;
}
declare module 'just-mean' {
export default function mean(arr: [number, ...number[]]): number;
export default function mean(arg1: number, ...args: number[]): number;
}
declare module 'just-median' {
export default function median(arr: [number, ...number[]]): number;
export default function median(number: number, ...arr: number[]): number;
}
declare module 'just-memoize-last' {
export = memoizeLast;
function memoizeLast<T extends Function>(
fn: T,
isEqual?: (args1: any, args2: any) => boolean
): T;
}
declare module 'just-merge' {
// Definitions by: nokazn <https://github.com/nokazn>
function merge(obj1: object, ...objs: object[]): object;
export = merge;
}
declare module 'just-modulo' {
export default function modulo(n: number, d: number): number;
}
declare module 'just-omit' {
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove: Key[]
): Omit<Obj, Key>;
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove1: Key,
...removeN: Key[]
): Omit<Obj, Key>;
}
declare module 'just-once' {
export function once<Func extends (...args: unknown[]) => unknown>(
fn: Func
): Func;
}
declare module 'just-partition' {
export default function partition<First, Second>(
arr: (First | Second)[],
fn: (arg: First | Second) => unknown
): [First[], Second[]];
}
declare module 'just-permutations' {
export default function permutations<First, Rest>(
arr: [First, ...Rest[]]
): (First | Rest)[][];
export default function permutations<T>(arr: T[]): T[]; // for empty arrays
}
declare module 'just-pick' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function pick<T, U extends keyof T>(obj: T, select: U[]): Pick<T, U>;
function pick<T, U extends keyof T>(
obj: T,
select1: U,
...selectn: U[]
): Pick<T, U>;
export = pick;
}
declare module 'just-random' {
export default function random<Head, Rest>(
arr: [Head, ...Rest[]]
): Head | Rest;
export default function random<T>(arr: T[]): undefined; // return undefined for empty arrays.
}
declare module 'just-range' {
function range(stop: number): number[];
function range(
start?: number,
stop?: number | null | undefined,
step?: number | null
): number[];
export = range;
}
declare module 'just-remove' {
export default function remove<T, U, V extends T>(
arr1: T[],
arr2: U[]
): (V | Exclude<T, U>)[];
}
declare module 'just-safe-get' {
// Definitions by: Richard Tan <https://github.com/chardos>
function get(
item: any[] | {},
target: string | string[],
defaultValue?: any
): any;
export = get;
}
declare module 'just-safe-set' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function set(
item: any[] | {},
target: string | symbol | Array<string | symbol>,
value: any
): boolean;
export = set;
}
declare module 'just-shuffle' {
type Options = {
shuffleAll: boolean;
};
export default function shuffle<T>(arr: T[], options?: Options): T[];
}
declare module 'just-snake-case' {
// Definitions by: Michael Wittwer <https://github.com/michaelwittwer>
function snakeCase(value: string): string;
export = snakeCase;
}
declare module 'just-sort-by' {
function sortBy<T>(arr: T[], iteratee?: string | Function): T[];
export = sortBy;
}
declare module 'just-split' {
export default function split<T>(arr: T[], n?: number | null): Array<T[]>;
}
declare module 'just-throttle' {
// Definitions by: Dominik Rowicki <https://github.com/papermana>
// Modified by: Angus Croll <https://github.com/angus-c>
type options = {
leading?: boolean;
trailing?: boolean;
};
type Methods = {
cancel: () => void;
flush: () => void;
};
function throttle<Func extends (...args: any[]) => any>(
fn: Func,
interval: number,
options?: options
): Func & Methods;
export = throttle;
}
declare module 'just-union' {
export default function union<T, U>(arr1: T[], arr2: U[]): (T | U)[];
}
declare module 'just-unique' {
export default function unique<T>(
arr: string[],
sorted: boolean | null,
strings: true
): string[];
export default function unique<T>(
arr: T[],
sorted?: boolean | null,
strings?: false | null
): T[];
}
declare module 'just-values' {
export function values<Arr extends unknown[]>(obj: Arr): Arr;
export function values<Obj extends object>(
obj: Obj
): Obj extends String
? Obj[number][]
: Obj extends Number | Boolean
? unknown[]
: Obj[keyof Obj][];
}
export { diff as diff } from 'just-diff';

@@ -359,0 +4,0 @@ export { diffApply } from 'just-diff-apply';

@@ -1,358 +0,3 @@

declare module 'just-clamp' {
export default function clamp(b1: number, n: number, b2: number): number;
}
/// <reference path="./just.d.ts" />
declare module 'just-clone' {
// Definitions by: Chris Howard <https://github.com/ConnectivityChris>
function clone<T extends object>(obj: T): T;
export = clone;
}
declare module 'just-compact' {
// NaN and document.all are also falsy but they cannot be represented as a type
type Falsy = false | null | undefined | '' | 0 | 0n;
// return type has
export default function compact<T>(arr: (Falsy | T)[]): T[];
}
declare module 'just-curry-it' {
export = curry;
// TODO: get more specific with permssible param types for returned function
function curry(fn: Function, arity?: number): Function;
}
declare module 'just-debounce-it' {
// Definitions by: Aziz Khambati <https://github.com/azizhk>
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any
? A
: never;
type MethodTypes = {
cancel: () => void;
flush: () => void;
};
export = debounce;
function debounce<T extends Function>(
fn: T,
wait?: 0,
callFirst?: boolean
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst: true
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst?: false
): ((...args: ArgumentTypes<T>) => void) & MethodTypes;
}
declare module 'just-diff' {
// Definitions by: Cameron Hunter <https://github.com/cameronhunter>
// Modified by: Angus Croll <https://github.com/angus-c>
type Operation = 'add' | 'replace' | 'remove';
type JSONPatchPathConverter<OUTPUT> = (
arrayPath: Array<string | number>
) => OUTPUT;
export function diff(
a: object | Array<any>,
b: object | Array<any>
): Array<{ op: Operation; path: Array<string | number>; value: any }>;
export function diff<PATH>(
a: object | Array<any>,
b: object | Array<any>,
jsonPatchPathConverter: JSONPatchPathConverter<PATH>
): Array<{ op: Operation; path: PATH; value: any }>;
export const jsonPatchPathConverter: JSONPatchPathConverter<string>;
}
declare module 'just-extend' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function extend(obj1: object, ...objn: any[]): object;
function extend(deep: boolean, obj1: object, ...objn: any[]): object;
export = extend;
}
declare module 'just-filter-object' {
type PlainObject<T> = T extends Map<any, any> | Set<any> | null
? never
: T extends object
? T
: never;
function filter<T>(
obj: PlainObject<T>,
fn: (key: keyof T, value: T[typeof key]) => any
): Partial<T>;
export = filter;
}
declare module 'just-flatten-it' {
type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
function flatten<T>(list: RecursiveList<T>, depth?: number): T[];
export = flatten;
}
declare module 'just-group-by' {
type PropertyKey = string | symbol;
type Stringifyable = {
toString: () => string;
};
export default function groupBy<T>(
arr: T[],
cb: (arg: T) => Stringifyable
): { [key in PropertyKey]: T[] };
}
declare module 'just-index' {
function index<T>(
list: Array<T | null | undefined>,
key: string
): Record<string, T>;
export = index;
}
declare module 'just-insert' {
export default function insert<T, U>(
arr1: T[],
arr2: U[] | U,
index?: number
): (T | U)[];
}
declare module 'just-intersect' {
export default function intersect<T, U, I extends T | U>(
arr1: T[],
arr2: U[]
): I[];
}
declare module 'just-is-prime' {
export default function isPrime(number: number): boolean;
}
declare module 'just-last' {
type ArrayWithLastType<Last> = [...unknown[], Last];
export default function last(arr: []): undefined;
export default function last<Last>(arr: ArrayWithLastType<Last>): Last;
export default function last<Last>(
arr: ArrayWithLastType<Last> | []
): Last | undefined;
}
declare module 'just-map-values' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function map<T extends {}>(
item: T,
callback: (value: any, key: string, object: T) => any
): {};
export = map;
}
declare module 'just-mean' {
export default function mean(arr: [number, ...number[]]): number;
export default function mean(arg1: number, ...args: number[]): number;
}
declare module 'just-median' {
export default function median(arr: [number, ...number[]]): number;
export default function median(number: number, ...arr: number[]): number;
}
declare module 'just-memoize-last' {
export = memoizeLast;
function memoizeLast<T extends Function>(
fn: T,
isEqual?: (args1: any, args2: any) => boolean
): T;
}
declare module 'just-merge' {
// Definitions by: nokazn <https://github.com/nokazn>
function merge(obj1: object, ...objs: object[]): object;
export = merge;
}
declare module 'just-modulo' {
export default function modulo(n: number, d: number): number;
}
declare module 'just-omit' {
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove: Key[]
): Omit<Obj, Key>;
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove1: Key,
...removeN: Key[]
): Omit<Obj, Key>;
}
declare module 'just-once' {
export function once<Func extends (...args: unknown[]) => unknown>(
fn: Func
): Func;
}
declare module 'just-partition' {
export default function partition<First, Second>(
arr: (First | Second)[],
fn: (arg: First | Second) => unknown
): [First[], Second[]];
}
declare module 'just-permutations' {
export default function permutations<First, Rest>(
arr: [First, ...Rest[]]
): (First | Rest)[][];
export default function permutations<T>(arr: T[]): T[]; // for empty arrays
}
declare module 'just-pick' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function pick<T, U extends keyof T>(obj: T, select: U[]): Pick<T, U>;
function pick<T, U extends keyof T>(
obj: T,
select1: U,
...selectn: U[]
): Pick<T, U>;
export = pick;
}
declare module 'just-random' {
export default function random<Head, Rest>(
arr: [Head, ...Rest[]]
): Head | Rest;
export default function random<T>(arr: T[]): undefined; // return undefined for empty arrays.
}
declare module 'just-range' {
function range(stop: number): number[];
function range(
start?: number,
stop?: number | null | undefined,
step?: number | null
): number[];
export = range;
}
declare module 'just-remove' {
export default function remove<T, U, V extends T>(
arr1: T[],
arr2: U[]
): (V | Exclude<T, U>)[];
}
declare module 'just-safe-get' {
// Definitions by: Richard Tan <https://github.com/chardos>
function get(
item: any[] | {},
target: string | string[],
defaultValue?: any
): any;
export = get;
}
declare module 'just-safe-set' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function set(
item: any[] | {},
target: string | symbol | Array<string | symbol>,
value: any
): boolean;
export = set;
}
declare module 'just-shuffle' {
type Options = {
shuffleAll: boolean;
};
export default function shuffle<T>(arr: T[], options?: Options): T[];
}
declare module 'just-snake-case' {
// Definitions by: Michael Wittwer <https://github.com/michaelwittwer>
function snakeCase(value: string): string;
export = snakeCase;
}
declare module 'just-sort-by' {
function sortBy<T>(arr: T[], iteratee?: string | Function): T[];
export = sortBy;
}
declare module 'just-split' {
export default function split<T>(arr: T[], n?: number | null): Array<T[]>;
}
declare module 'just-throttle' {
// Definitions by: Dominik Rowicki <https://github.com/papermana>
// Modified by: Angus Croll <https://github.com/angus-c>
type options = {
leading?: boolean;
trailing?: boolean;
};
type Methods = {
cancel: () => void;
flush: () => void;
};
function throttle<Func extends (...args: any[]) => any>(
fn: Func,
interval: number,
options?: options
): Func & Methods;
export = throttle;
}
declare module 'just-union' {
export default function union<T, U>(arr1: T[], arr2: U[]): (T | U)[];
}
declare module 'just-unique' {
export default function unique<T>(
arr: string[],
sorted: boolean | null,
strings: true
): string[];
export default function unique<T>(
arr: T[],
sorted?: boolean | null,
strings?: false | null
): T[];
}
declare module 'just-values' {
export function values<Arr extends unknown[]>(obj: Arr): Arr;
export function values<Obj extends object>(
obj: Obj
): Obj extends String
? Obj[number][]
: Obj extends Number | Boolean
? unknown[]
: Obj[keyof Obj][];
}
export { default as compose } from 'just-compose';

@@ -359,0 +4,0 @@ export { default as curry } from 'just-curry-it';

@@ -1,358 +0,3 @@

declare module 'just-clamp' {
export default function clamp(b1: number, n: number, b2: number): number;
}
/// <reference path="./just.d.ts" />
declare module 'just-clone' {
// Definitions by: Chris Howard <https://github.com/ConnectivityChris>
function clone<T extends object>(obj: T): T;
export = clone;
}
declare module 'just-compact' {
// NaN and document.all are also falsy but they cannot be represented as a type
type Falsy = false | null | undefined | '' | 0 | 0n;
// return type has
export default function compact<T>(arr: (Falsy | T)[]): T[];
}
declare module 'just-curry-it' {
export = curry;
// TODO: get more specific with permssible param types for returned function
function curry(fn: Function, arity?: number): Function;
}
declare module 'just-debounce-it' {
// Definitions by: Aziz Khambati <https://github.com/azizhk>
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any
? A
: never;
type MethodTypes = {
cancel: () => void;
flush: () => void;
};
export = debounce;
function debounce<T extends Function>(
fn: T,
wait?: 0,
callFirst?: boolean
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst: true
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst?: false
): ((...args: ArgumentTypes<T>) => void) & MethodTypes;
}
declare module 'just-diff' {
// Definitions by: Cameron Hunter <https://github.com/cameronhunter>
// Modified by: Angus Croll <https://github.com/angus-c>
type Operation = 'add' | 'replace' | 'remove';
type JSONPatchPathConverter<OUTPUT> = (
arrayPath: Array<string | number>
) => OUTPUT;
export function diff(
a: object | Array<any>,
b: object | Array<any>
): Array<{ op: Operation; path: Array<string | number>; value: any }>;
export function diff<PATH>(
a: object | Array<any>,
b: object | Array<any>,
jsonPatchPathConverter: JSONPatchPathConverter<PATH>
): Array<{ op: Operation; path: PATH; value: any }>;
export const jsonPatchPathConverter: JSONPatchPathConverter<string>;
}
declare module 'just-extend' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function extend(obj1: object, ...objn: any[]): object;
function extend(deep: boolean, obj1: object, ...objn: any[]): object;
export = extend;
}
declare module 'just-filter-object' {
type PlainObject<T> = T extends Map<any, any> | Set<any> | null
? never
: T extends object
? T
: never;
function filter<T>(
obj: PlainObject<T>,
fn: (key: keyof T, value: T[typeof key]) => any
): Partial<T>;
export = filter;
}
declare module 'just-flatten-it' {
type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
function flatten<T>(list: RecursiveList<T>, depth?: number): T[];
export = flatten;
}
declare module 'just-group-by' {
type PropertyKey = string | symbol;
type Stringifyable = {
toString: () => string;
};
export default function groupBy<T>(
arr: T[],
cb: (arg: T) => Stringifyable
): { [key in PropertyKey]: T[] };
}
declare module 'just-index' {
function index<T>(
list: Array<T | null | undefined>,
key: string
): Record<string, T>;
export = index;
}
declare module 'just-insert' {
export default function insert<T, U>(
arr1: T[],
arr2: U[] | U,
index?: number
): (T | U)[];
}
declare module 'just-intersect' {
export default function intersect<T, U, I extends T | U>(
arr1: T[],
arr2: U[]
): I[];
}
declare module 'just-is-prime' {
export default function isPrime(number: number): boolean;
}
declare module 'just-last' {
type ArrayWithLastType<Last> = [...unknown[], Last];
export default function last(arr: []): undefined;
export default function last<Last>(arr: ArrayWithLastType<Last>): Last;
export default function last<Last>(
arr: ArrayWithLastType<Last> | []
): Last | undefined;
}
declare module 'just-map-values' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function map<T extends {}>(
item: T,
callback: (value: any, key: string, object: T) => any
): {};
export = map;
}
declare module 'just-mean' {
export default function mean(arr: [number, ...number[]]): number;
export default function mean(arg1: number, ...args: number[]): number;
}
declare module 'just-median' {
export default function median(arr: [number, ...number[]]): number;
export default function median(number: number, ...arr: number[]): number;
}
declare module 'just-memoize-last' {
export = memoizeLast;
function memoizeLast<T extends Function>(
fn: T,
isEqual?: (args1: any, args2: any) => boolean
): T;
}
declare module 'just-merge' {
// Definitions by: nokazn <https://github.com/nokazn>
function merge(obj1: object, ...objs: object[]): object;
export = merge;
}
declare module 'just-modulo' {
export default function modulo(n: number, d: number): number;
}
declare module 'just-omit' {
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove: Key[]
): Omit<Obj, Key>;
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove1: Key,
...removeN: Key[]
): Omit<Obj, Key>;
}
declare module 'just-once' {
export function once<Func extends (...args: unknown[]) => unknown>(
fn: Func
): Func;
}
declare module 'just-partition' {
export default function partition<First, Second>(
arr: (First | Second)[],
fn: (arg: First | Second) => unknown
): [First[], Second[]];
}
declare module 'just-permutations' {
export default function permutations<First, Rest>(
arr: [First, ...Rest[]]
): (First | Rest)[][];
export default function permutations<T>(arr: T[]): T[]; // for empty arrays
}
declare module 'just-pick' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function pick<T, U extends keyof T>(obj: T, select: U[]): Pick<T, U>;
function pick<T, U extends keyof T>(
obj: T,
select1: U,
...selectn: U[]
): Pick<T, U>;
export = pick;
}
declare module 'just-random' {
export default function random<Head, Rest>(
arr: [Head, ...Rest[]]
): Head | Rest;
export default function random<T>(arr: T[]): undefined; // return undefined for empty arrays.
}
declare module 'just-range' {
function range(stop: number): number[];
function range(
start?: number,
stop?: number | null | undefined,
step?: number | null
): number[];
export = range;
}
declare module 'just-remove' {
export default function remove<T, U, V extends T>(
arr1: T[],
arr2: U[]
): (V | Exclude<T, U>)[];
}
declare module 'just-safe-get' {
// Definitions by: Richard Tan <https://github.com/chardos>
function get(
item: any[] | {},
target: string | string[],
defaultValue?: any
): any;
export = get;
}
declare module 'just-safe-set' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function set(
item: any[] | {},
target: string | symbol | Array<string | symbol>,
value: any
): boolean;
export = set;
}
declare module 'just-shuffle' {
type Options = {
shuffleAll: boolean;
};
export default function shuffle<T>(arr: T[], options?: Options): T[];
}
declare module 'just-snake-case' {
// Definitions by: Michael Wittwer <https://github.com/michaelwittwer>
function snakeCase(value: string): string;
export = snakeCase;
}
declare module 'just-sort-by' {
function sortBy<T>(arr: T[], iteratee?: string | Function): T[];
export = sortBy;
}
declare module 'just-split' {
export default function split<T>(arr: T[], n?: number | null): Array<T[]>;
}
declare module 'just-throttle' {
// Definitions by: Dominik Rowicki <https://github.com/papermana>
// Modified by: Angus Croll <https://github.com/angus-c>
type options = {
leading?: boolean;
trailing?: boolean;
};
type Methods = {
cancel: () => void;
flush: () => void;
};
function throttle<Func extends (...args: any[]) => any>(
fn: Func,
interval: number,
options?: options
): Func & Methods;
export = throttle;
}
declare module 'just-union' {
export default function union<T, U>(arr1: T[], arr2: U[]): (T | U)[];
}
declare module 'just-unique' {
export default function unique<T>(
arr: string[],
sorted: boolean | null,
strings: true
): string[];
export default function unique<T>(
arr: T[],
sorted?: boolean | null,
strings?: false | null
): T[];
}
declare module 'just-values' {
export function values<Arr extends unknown[]>(obj: Arr): Arr;
export function values<Obj extends object>(
obj: Obj
): Obj extends String
? Obj[number][]
: Obj extends Number | Boolean
? unknown[]
: Obj[keyof Obj][];
}
/** COLLECTIONS */

@@ -359,0 +4,0 @@ export { diff as collectionDiff } from 'just-diff';

@@ -1,360 +0,5 @@

declare module 'just-clamp' {
export default function clamp(b1: number, n: number, b2: number): number;
}
/// <reference path="./just.d.ts" />
declare module 'just-clone' {
// Definitions by: Chris Howard <https://github.com/ConnectivityChris>
function clone<T extends object>(obj: T): T;
export = clone;
}
declare module 'just-compact' {
// NaN and document.all are also falsy but they cannot be represented as a type
type Falsy = false | null | undefined | '' | 0 | 0n;
// return type has
export default function compact<T>(arr: (Falsy | T)[]): T[];
}
declare module 'just-curry-it' {
export = curry;
// TODO: get more specific with permssible param types for returned function
function curry(fn: Function, arity?: number): Function;
}
declare module 'just-debounce-it' {
// Definitions by: Aziz Khambati <https://github.com/azizhk>
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any
? A
: never;
type MethodTypes = {
cancel: () => void;
flush: () => void;
};
export = debounce;
function debounce<T extends Function>(
fn: T,
wait?: 0,
callFirst?: boolean
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst: true
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst?: false
): ((...args: ArgumentTypes<T>) => void) & MethodTypes;
}
declare module 'just-diff' {
// Definitions by: Cameron Hunter <https://github.com/cameronhunter>
// Modified by: Angus Croll <https://github.com/angus-c>
type Operation = 'add' | 'replace' | 'remove';
type JSONPatchPathConverter<OUTPUT> = (
arrayPath: Array<string | number>
) => OUTPUT;
export function diff(
a: object | Array<any>,
b: object | Array<any>
): Array<{ op: Operation; path: Array<string | number>; value: any }>;
export function diff<PATH>(
a: object | Array<any>,
b: object | Array<any>,
jsonPatchPathConverter: JSONPatchPathConverter<PATH>
): Array<{ op: Operation; path: PATH; value: any }>;
export const jsonPatchPathConverter: JSONPatchPathConverter<string>;
}
declare module 'just-extend' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function extend(obj1: object, ...objn: any[]): object;
function extend(deep: boolean, obj1: object, ...objn: any[]): object;
export = extend;
}
declare module 'just-filter-object' {
type PlainObject<T> = T extends Map<any, any> | Set<any> | null
? never
: T extends object
? T
: never;
function filter<T>(
obj: PlainObject<T>,
fn: (key: keyof T, value: T[typeof key]) => any
): Partial<T>;
export = filter;
}
declare module 'just-flatten-it' {
type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
function flatten<T>(list: RecursiveList<T>, depth?: number): T[];
export = flatten;
}
declare module 'just-group-by' {
type PropertyKey = string | symbol;
type Stringifyable = {
toString: () => string;
};
export default function groupBy<T>(
arr: T[],
cb: (arg: T) => Stringifyable
): { [key in PropertyKey]: T[] };
}
declare module 'just-index' {
function index<T>(
list: Array<T | null | undefined>,
key: string
): Record<string, T>;
export = index;
}
declare module 'just-insert' {
export default function insert<T, U>(
arr1: T[],
arr2: U[] | U,
index?: number
): (T | U)[];
}
declare module 'just-intersect' {
export default function intersect<T, U, I extends T | U>(
arr1: T[],
arr2: U[]
): I[];
}
declare module 'just-is-prime' {
export default function isPrime(number: number): boolean;
}
declare module 'just-last' {
type ArrayWithLastType<Last> = [...unknown[], Last];
export default function last(arr: []): undefined;
export default function last<Last>(arr: ArrayWithLastType<Last>): Last;
export default function last<Last>(
arr: ArrayWithLastType<Last> | []
): Last | undefined;
}
declare module 'just-map-values' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function map<T extends {}>(
item: T,
callback: (value: any, key: string, object: T) => any
): {};
export = map;
}
declare module 'just-mean' {
export default function mean(arr: [number, ...number[]]): number;
export default function mean(arg1: number, ...args: number[]): number;
}
declare module 'just-median' {
export default function median(arr: [number, ...number[]]): number;
export default function median(number: number, ...arr: number[]): number;
}
declare module 'just-memoize-last' {
export = memoizeLast;
function memoizeLast<T extends Function>(
fn: T,
isEqual?: (args1: any, args2: any) => boolean
): T;
}
declare module 'just-merge' {
// Definitions by: nokazn <https://github.com/nokazn>
function merge(obj1: object, ...objs: object[]): object;
export = merge;
}
declare module 'just-modulo' {
export default function modulo(n: number, d: number): number;
}
declare module 'just-omit' {
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove: Key[]
): Omit<Obj, Key>;
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove1: Key,
...removeN: Key[]
): Omit<Obj, Key>;
}
declare module 'just-once' {
export function once<Func extends (...args: unknown[]) => unknown>(
fn: Func
): Func;
}
declare module 'just-partition' {
export default function partition<First, Second>(
arr: (First | Second)[],
fn: (arg: First | Second) => unknown
): [First[], Second[]];
}
declare module 'just-permutations' {
export default function permutations<First, Rest>(
arr: [First, ...Rest[]]
): (First | Rest)[][];
export default function permutations<T>(arr: T[]): T[]; // for empty arrays
}
declare module 'just-pick' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function pick<T, U extends keyof T>(obj: T, select: U[]): Pick<T, U>;
function pick<T, U extends keyof T>(
obj: T,
select1: U,
...selectn: U[]
): Pick<T, U>;
export = pick;
}
declare module 'just-random' {
export default function random<Head, Rest>(
arr: [Head, ...Rest[]]
): Head | Rest;
export default function random<T>(arr: T[]): undefined; // return undefined for empty arrays.
}
declare module 'just-range' {
function range(stop: number): number[];
function range(
start?: number,
stop?: number | null | undefined,
step?: number | null
): number[];
export = range;
}
declare module 'just-remove' {
export default function remove<T, U, V extends T>(
arr1: T[],
arr2: U[]
): (V | Exclude<T, U>)[];
}
declare module 'just-safe-get' {
// Definitions by: Richard Tan <https://github.com/chardos>
function get(
item: any[] | {},
target: string | string[],
defaultValue?: any
): any;
export = get;
}
declare module 'just-safe-set' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function set(
item: any[] | {},
target: string | symbol | Array<string | symbol>,
value: any
): boolean;
export = set;
}
declare module 'just-shuffle' {
type Options = {
shuffleAll: boolean;
};
export default function shuffle<T>(arr: T[], options?: Options): T[];
}
declare module 'just-snake-case' {
// Definitions by: Michael Wittwer <https://github.com/michaelwittwer>
function snakeCase(value: string): string;
export = snakeCase;
}
declare module 'just-sort-by' {
function sortBy<T>(arr: T[], iteratee?: string | Function): T[];
export = sortBy;
}
declare module 'just-split' {
export default function split<T>(arr: T[], n?: number | null): Array<T[]>;
}
declare module 'just-throttle' {
// Definitions by: Dominik Rowicki <https://github.com/papermana>
// Modified by: Angus Croll <https://github.com/angus-c>
type options = {
leading?: boolean;
trailing?: boolean;
};
type Methods = {
cancel: () => void;
flush: () => void;
};
function throttle<Func extends (...args: any[]) => any>(
fn: Func,
interval: number,
options?: options
): Func & Methods;
export = throttle;
}
declare module 'just-union' {
export default function union<T, U>(arr1: T[], arr2: U[]): (T | U)[];
}
declare module 'just-unique' {
export default function unique<T>(
arr: string[],
sorted: boolean | null,
strings: true
): string[];
export default function unique<T>(
arr: T[],
sorted?: boolean | null,
strings?: false | null
): T[];
}
declare module 'just-values' {
export function values<Arr extends unknown[]>(obj: Arr): Arr;
export function values<Obj extends object>(
obj: Obj
): Obj extends String
? Obj[number][]
: Obj extends Number | Boolean
? unknown[]
: Obj[keyof Obj][];
}
export { default as clamp } from 'just-clamp';
export { default as prime } from 'just-is-prime';
export { default as modulo } from 'just-modulo';

@@ -1,358 +0,3 @@

declare module 'just-clamp' {
export default function clamp(b1: number, n: number, b2: number): number;
}
/// <reference path="./just.d.ts" />
declare module 'just-clone' {
// Definitions by: Chris Howard <https://github.com/ConnectivityChris>
function clone<T extends object>(obj: T): T;
export = clone;
}
declare module 'just-compact' {
// NaN and document.all are also falsy but they cannot be represented as a type
type Falsy = false | null | undefined | '' | 0 | 0n;
// return type has
export default function compact<T>(arr: (Falsy | T)[]): T[];
}
declare module 'just-curry-it' {
export = curry;
// TODO: get more specific with permssible param types for returned function
function curry(fn: Function, arity?: number): Function;
}
declare module 'just-debounce-it' {
// Definitions by: Aziz Khambati <https://github.com/azizhk>
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any
? A
: never;
type MethodTypes = {
cancel: () => void;
flush: () => void;
};
export = debounce;
function debounce<T extends Function>(
fn: T,
wait?: 0,
callFirst?: boolean
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst: true
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst?: false
): ((...args: ArgumentTypes<T>) => void) & MethodTypes;
}
declare module 'just-diff' {
// Definitions by: Cameron Hunter <https://github.com/cameronhunter>
// Modified by: Angus Croll <https://github.com/angus-c>
type Operation = 'add' | 'replace' | 'remove';
type JSONPatchPathConverter<OUTPUT> = (
arrayPath: Array<string | number>
) => OUTPUT;
export function diff(
a: object | Array<any>,
b: object | Array<any>
): Array<{ op: Operation; path: Array<string | number>; value: any }>;
export function diff<PATH>(
a: object | Array<any>,
b: object | Array<any>,
jsonPatchPathConverter: JSONPatchPathConverter<PATH>
): Array<{ op: Operation; path: PATH; value: any }>;
export const jsonPatchPathConverter: JSONPatchPathConverter<string>;
}
declare module 'just-extend' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function extend(obj1: object, ...objn: any[]): object;
function extend(deep: boolean, obj1: object, ...objn: any[]): object;
export = extend;
}
declare module 'just-filter-object' {
type PlainObject<T> = T extends Map<any, any> | Set<any> | null
? never
: T extends object
? T
: never;
function filter<T>(
obj: PlainObject<T>,
fn: (key: keyof T, value: T[typeof key]) => any
): Partial<T>;
export = filter;
}
declare module 'just-flatten-it' {
type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
function flatten<T>(list: RecursiveList<T>, depth?: number): T[];
export = flatten;
}
declare module 'just-group-by' {
type PropertyKey = string | symbol;
type Stringifyable = {
toString: () => string;
};
export default function groupBy<T>(
arr: T[],
cb: (arg: T) => Stringifyable
): { [key in PropertyKey]: T[] };
}
declare module 'just-index' {
function index<T>(
list: Array<T | null | undefined>,
key: string
): Record<string, T>;
export = index;
}
declare module 'just-insert' {
export default function insert<T, U>(
arr1: T[],
arr2: U[] | U,
index?: number
): (T | U)[];
}
declare module 'just-intersect' {
export default function intersect<T, U, I extends T | U>(
arr1: T[],
arr2: U[]
): I[];
}
declare module 'just-is-prime' {
export default function isPrime(number: number): boolean;
}
declare module 'just-last' {
type ArrayWithLastType<Last> = [...unknown[], Last];
export default function last(arr: []): undefined;
export default function last<Last>(arr: ArrayWithLastType<Last>): Last;
export default function last<Last>(
arr: ArrayWithLastType<Last> | []
): Last | undefined;
}
declare module 'just-map-values' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function map<T extends {}>(
item: T,
callback: (value: any, key: string, object: T) => any
): {};
export = map;
}
declare module 'just-mean' {
export default function mean(arr: [number, ...number[]]): number;
export default function mean(arg1: number, ...args: number[]): number;
}
declare module 'just-median' {
export default function median(arr: [number, ...number[]]): number;
export default function median(number: number, ...arr: number[]): number;
}
declare module 'just-memoize-last' {
export = memoizeLast;
function memoizeLast<T extends Function>(
fn: T,
isEqual?: (args1: any, args2: any) => boolean
): T;
}
declare module 'just-merge' {
// Definitions by: nokazn <https://github.com/nokazn>
function merge(obj1: object, ...objs: object[]): object;
export = merge;
}
declare module 'just-modulo' {
export default function modulo(n: number, d: number): number;
}
declare module 'just-omit' {
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove: Key[]
): Omit<Obj, Key>;
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove1: Key,
...removeN: Key[]
): Omit<Obj, Key>;
}
declare module 'just-once' {
export function once<Func extends (...args: unknown[]) => unknown>(
fn: Func
): Func;
}
declare module 'just-partition' {
export default function partition<First, Second>(
arr: (First | Second)[],
fn: (arg: First | Second) => unknown
): [First[], Second[]];
}
declare module 'just-permutations' {
export default function permutations<First, Rest>(
arr: [First, ...Rest[]]
): (First | Rest)[][];
export default function permutations<T>(arr: T[]): T[]; // for empty arrays
}
declare module 'just-pick' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function pick<T, U extends keyof T>(obj: T, select: U[]): Pick<T, U>;
function pick<T, U extends keyof T>(
obj: T,
select1: U,
...selectn: U[]
): Pick<T, U>;
export = pick;
}
declare module 'just-random' {
export default function random<Head, Rest>(
arr: [Head, ...Rest[]]
): Head | Rest;
export default function random<T>(arr: T[]): undefined; // return undefined for empty arrays.
}
declare module 'just-range' {
function range(stop: number): number[];
function range(
start?: number,
stop?: number | null | undefined,
step?: number | null
): number[];
export = range;
}
declare module 'just-remove' {
export default function remove<T, U, V extends T>(
arr1: T[],
arr2: U[]
): (V | Exclude<T, U>)[];
}
declare module 'just-safe-get' {
// Definitions by: Richard Tan <https://github.com/chardos>
function get(
item: any[] | {},
target: string | string[],
defaultValue?: any
): any;
export = get;
}
declare module 'just-safe-set' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function set(
item: any[] | {},
target: string | symbol | Array<string | symbol>,
value: any
): boolean;
export = set;
}
declare module 'just-shuffle' {
type Options = {
shuffleAll: boolean;
};
export default function shuffle<T>(arr: T[], options?: Options): T[];
}
declare module 'just-snake-case' {
// Definitions by: Michael Wittwer <https://github.com/michaelwittwer>
function snakeCase(value: string): string;
export = snakeCase;
}
declare module 'just-sort-by' {
function sortBy<T>(arr: T[], iteratee?: string | Function): T[];
export = sortBy;
}
declare module 'just-split' {
export default function split<T>(arr: T[], n?: number | null): Array<T[]>;
}
declare module 'just-throttle' {
// Definitions by: Dominik Rowicki <https://github.com/papermana>
// Modified by: Angus Croll <https://github.com/angus-c>
type options = {
leading?: boolean;
trailing?: boolean;
};
type Methods = {
cancel: () => void;
flush: () => void;
};
function throttle<Func extends (...args: any[]) => any>(
fn: Func,
interval: number,
options?: options
): Func & Methods;
export = throttle;
}
declare module 'just-union' {
export default function union<T, U>(arr1: T[], arr2: U[]): (T | U)[];
}
declare module 'just-unique' {
export default function unique<T>(
arr: string[],
sorted: boolean | null,
strings: true
): string[];
export default function unique<T>(
arr: T[],
sorted?: boolean | null,
strings?: false | null
): T[];
}
declare module 'just-values' {
export function values<Arr extends unknown[]>(obj: Arr): Arr;
export function values<Obj extends object>(
obj: Obj
): Obj extends String
? Obj[number][]
: Obj extends Number | Boolean
? unknown[]
: Obj[keyof Obj][];
}
export { default as extend } from 'just-extend';

@@ -359,0 +4,0 @@ export { default as merge } from 'just-merge';

{
"name": "all-of-just",
"private": false,
"version": "0.2.4",
"version": "0.3.0",
"description": "A single collection of all of Just utility functions in one single library",

@@ -6,0 +6,0 @@ "files": [

@@ -1,358 +0,3 @@

declare module 'just-clamp' {
export default function clamp(b1: number, n: number, b2: number): number;
}
/// <reference path="./just.d.ts" />
declare module 'just-clone' {
// Definitions by: Chris Howard <https://github.com/ConnectivityChris>
function clone<T extends object>(obj: T): T;
export = clone;
}
declare module 'just-compact' {
// NaN and document.all are also falsy but they cannot be represented as a type
type Falsy = false | null | undefined | '' | 0 | 0n;
// return type has
export default function compact<T>(arr: (Falsy | T)[]): T[];
}
declare module 'just-curry-it' {
export = curry;
// TODO: get more specific with permssible param types for returned function
function curry(fn: Function, arity?: number): Function;
}
declare module 'just-debounce-it' {
// Definitions by: Aziz Khambati <https://github.com/azizhk>
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any
? A
: never;
type MethodTypes = {
cancel: () => void;
flush: () => void;
};
export = debounce;
function debounce<T extends Function>(
fn: T,
wait?: 0,
callFirst?: boolean
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst: true
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst?: false
): ((...args: ArgumentTypes<T>) => void) & MethodTypes;
}
declare module 'just-diff' {
// Definitions by: Cameron Hunter <https://github.com/cameronhunter>
// Modified by: Angus Croll <https://github.com/angus-c>
type Operation = 'add' | 'replace' | 'remove';
type JSONPatchPathConverter<OUTPUT> = (
arrayPath: Array<string | number>
) => OUTPUT;
export function diff(
a: object | Array<any>,
b: object | Array<any>
): Array<{ op: Operation; path: Array<string | number>; value: any }>;
export function diff<PATH>(
a: object | Array<any>,
b: object | Array<any>,
jsonPatchPathConverter: JSONPatchPathConverter<PATH>
): Array<{ op: Operation; path: PATH; value: any }>;
export const jsonPatchPathConverter: JSONPatchPathConverter<string>;
}
declare module 'just-extend' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function extend(obj1: object, ...objn: any[]): object;
function extend(deep: boolean, obj1: object, ...objn: any[]): object;
export = extend;
}
declare module 'just-filter-object' {
type PlainObject<T> = T extends Map<any, any> | Set<any> | null
? never
: T extends object
? T
: never;
function filter<T>(
obj: PlainObject<T>,
fn: (key: keyof T, value: T[typeof key]) => any
): Partial<T>;
export = filter;
}
declare module 'just-flatten-it' {
type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
function flatten<T>(list: RecursiveList<T>, depth?: number): T[];
export = flatten;
}
declare module 'just-group-by' {
type PropertyKey = string | symbol;
type Stringifyable = {
toString: () => string;
};
export default function groupBy<T>(
arr: T[],
cb: (arg: T) => Stringifyable
): { [key in PropertyKey]: T[] };
}
declare module 'just-index' {
function index<T>(
list: Array<T | null | undefined>,
key: string
): Record<string, T>;
export = index;
}
declare module 'just-insert' {
export default function insert<T, U>(
arr1: T[],
arr2: U[] | U,
index?: number
): (T | U)[];
}
declare module 'just-intersect' {
export default function intersect<T, U, I extends T | U>(
arr1: T[],
arr2: U[]
): I[];
}
declare module 'just-is-prime' {
export default function isPrime(number: number): boolean;
}
declare module 'just-last' {
type ArrayWithLastType<Last> = [...unknown[], Last];
export default function last(arr: []): undefined;
export default function last<Last>(arr: ArrayWithLastType<Last>): Last;
export default function last<Last>(
arr: ArrayWithLastType<Last> | []
): Last | undefined;
}
declare module 'just-map-values' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function map<T extends {}>(
item: T,
callback: (value: any, key: string, object: T) => any
): {};
export = map;
}
declare module 'just-mean' {
export default function mean(arr: [number, ...number[]]): number;
export default function mean(arg1: number, ...args: number[]): number;
}
declare module 'just-median' {
export default function median(arr: [number, ...number[]]): number;
export default function median(number: number, ...arr: number[]): number;
}
declare module 'just-memoize-last' {
export = memoizeLast;
function memoizeLast<T extends Function>(
fn: T,
isEqual?: (args1: any, args2: any) => boolean
): T;
}
declare module 'just-merge' {
// Definitions by: nokazn <https://github.com/nokazn>
function merge(obj1: object, ...objs: object[]): object;
export = merge;
}
declare module 'just-modulo' {
export default function modulo(n: number, d: number): number;
}
declare module 'just-omit' {
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove: Key[]
): Omit<Obj, Key>;
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove1: Key,
...removeN: Key[]
): Omit<Obj, Key>;
}
declare module 'just-once' {
export function once<Func extends (...args: unknown[]) => unknown>(
fn: Func
): Func;
}
declare module 'just-partition' {
export default function partition<First, Second>(
arr: (First | Second)[],
fn: (arg: First | Second) => unknown
): [First[], Second[]];
}
declare module 'just-permutations' {
export default function permutations<First, Rest>(
arr: [First, ...Rest[]]
): (First | Rest)[][];
export default function permutations<T>(arr: T[]): T[]; // for empty arrays
}
declare module 'just-pick' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function pick<T, U extends keyof T>(obj: T, select: U[]): Pick<T, U>;
function pick<T, U extends keyof T>(
obj: T,
select1: U,
...selectn: U[]
): Pick<T, U>;
export = pick;
}
declare module 'just-random' {
export default function random<Head, Rest>(
arr: [Head, ...Rest[]]
): Head | Rest;
export default function random<T>(arr: T[]): undefined; // return undefined for empty arrays.
}
declare module 'just-range' {
function range(stop: number): number[];
function range(
start?: number,
stop?: number | null | undefined,
step?: number | null
): number[];
export = range;
}
declare module 'just-remove' {
export default function remove<T, U, V extends T>(
arr1: T[],
arr2: U[]
): (V | Exclude<T, U>)[];
}
declare module 'just-safe-get' {
// Definitions by: Richard Tan <https://github.com/chardos>
function get(
item: any[] | {},
target: string | string[],
defaultValue?: any
): any;
export = get;
}
declare module 'just-safe-set' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function set(
item: any[] | {},
target: string | symbol | Array<string | symbol>,
value: any
): boolean;
export = set;
}
declare module 'just-shuffle' {
type Options = {
shuffleAll: boolean;
};
export default function shuffle<T>(arr: T[], options?: Options): T[];
}
declare module 'just-snake-case' {
// Definitions by: Michael Wittwer <https://github.com/michaelwittwer>
function snakeCase(value: string): string;
export = snakeCase;
}
declare module 'just-sort-by' {
function sortBy<T>(arr: T[], iteratee?: string | Function): T[];
export = sortBy;
}
declare module 'just-split' {
export default function split<T>(arr: T[], n?: number | null): Array<T[]>;
}
declare module 'just-throttle' {
// Definitions by: Dominik Rowicki <https://github.com/papermana>
// Modified by: Angus Croll <https://github.com/angus-c>
type options = {
leading?: boolean;
trailing?: boolean;
};
type Methods = {
cancel: () => void;
flush: () => void;
};
function throttle<Func extends (...args: any[]) => any>(
fn: Func,
interval: number,
options?: options
): Func & Methods;
export = throttle;
}
declare module 'just-union' {
export default function union<T, U>(arr1: T[], arr2: U[]): (T | U)[];
}
declare module 'just-unique' {
export default function unique<T>(
arr: string[],
sorted: boolean | null,
strings: true
): string[];
export default function unique<T>(
arr: T[],
sorted?: boolean | null,
strings?: false | null
): T[];
}
declare module 'just-values' {
export function values<Arr extends unknown[]>(obj: Arr): Arr;
export function values<Obj extends object>(
obj: Obj
): Obj extends String
? Obj[number][]
: Obj extends Number | Boolean
? unknown[]
: Obj[keyof Obj][];
}
export { default as mean } from 'just-mean';

@@ -359,0 +4,0 @@ export { default as median } from 'just-median';

@@ -1,358 +0,3 @@

declare module 'just-clamp' {
export default function clamp(b1: number, n: number, b2: number): number;
}
/// <reference path="./just.d.ts" />
declare module 'just-clone' {
// Definitions by: Chris Howard <https://github.com/ConnectivityChris>
function clone<T extends object>(obj: T): T;
export = clone;
}
declare module 'just-compact' {
// NaN and document.all are also falsy but they cannot be represented as a type
type Falsy = false | null | undefined | '' | 0 | 0n;
// return type has
export default function compact<T>(arr: (Falsy | T)[]): T[];
}
declare module 'just-curry-it' {
export = curry;
// TODO: get more specific with permssible param types for returned function
function curry(fn: Function, arity?: number): Function;
}
declare module 'just-debounce-it' {
// Definitions by: Aziz Khambati <https://github.com/azizhk>
type ArgumentTypes<F extends Function> = F extends (...args: infer A) => any
? A
: never;
type MethodTypes = {
cancel: () => void;
flush: () => void;
};
export = debounce;
function debounce<T extends Function>(
fn: T,
wait?: 0,
callFirst?: boolean
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst: true
): T & MethodTypes;
function debounce<T extends Function>(
fn: T,
wait: number,
callFirst?: false
): ((...args: ArgumentTypes<T>) => void) & MethodTypes;
}
declare module 'just-diff' {
// Definitions by: Cameron Hunter <https://github.com/cameronhunter>
// Modified by: Angus Croll <https://github.com/angus-c>
type Operation = 'add' | 'replace' | 'remove';
type JSONPatchPathConverter<OUTPUT> = (
arrayPath: Array<string | number>
) => OUTPUT;
export function diff(
a: object | Array<any>,
b: object | Array<any>
): Array<{ op: Operation; path: Array<string | number>; value: any }>;
export function diff<PATH>(
a: object | Array<any>,
b: object | Array<any>,
jsonPatchPathConverter: JSONPatchPathConverter<PATH>
): Array<{ op: Operation; path: PATH; value: any }>;
export const jsonPatchPathConverter: JSONPatchPathConverter<string>;
}
declare module 'just-extend' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function extend(obj1: object, ...objn: any[]): object;
function extend(deep: boolean, obj1: object, ...objn: any[]): object;
export = extend;
}
declare module 'just-filter-object' {
type PlainObject<T> = T extends Map<any, any> | Set<any> | null
? never
: T extends object
? T
: never;
function filter<T>(
obj: PlainObject<T>,
fn: (key: keyof T, value: T[typeof key]) => any
): Partial<T>;
export = filter;
}
declare module 'just-flatten-it' {
type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
function flatten<T>(list: RecursiveList<T>, depth?: number): T[];
export = flatten;
}
declare module 'just-group-by' {
type PropertyKey = string | symbol;
type Stringifyable = {
toString: () => string;
};
export default function groupBy<T>(
arr: T[],
cb: (arg: T) => Stringifyable
): { [key in PropertyKey]: T[] };
}
declare module 'just-index' {
function index<T>(
list: Array<T | null | undefined>,
key: string
): Record<string, T>;
export = index;
}
declare module 'just-insert' {
export default function insert<T, U>(
arr1: T[],
arr2: U[] | U,
index?: number
): (T | U)[];
}
declare module 'just-intersect' {
export default function intersect<T, U, I extends T | U>(
arr1: T[],
arr2: U[]
): I[];
}
declare module 'just-is-prime' {
export default function isPrime(number: number): boolean;
}
declare module 'just-last' {
type ArrayWithLastType<Last> = [...unknown[], Last];
export default function last(arr: []): undefined;
export default function last<Last>(arr: ArrayWithLastType<Last>): Last;
export default function last<Last>(
arr: ArrayWithLastType<Last> | []
): Last | undefined;
}
declare module 'just-map-values' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function map<T extends {}>(
item: T,
callback: (value: any, key: string, object: T) => any
): {};
export = map;
}
declare module 'just-mean' {
export default function mean(arr: [number, ...number[]]): number;
export default function mean(arg1: number, ...args: number[]): number;
}
declare module 'just-median' {
export default function median(arr: [number, ...number[]]): number;
export default function median(number: number, ...arr: number[]): number;
}
declare module 'just-memoize-last' {
export = memoizeLast;
function memoizeLast<T extends Function>(
fn: T,
isEqual?: (args1: any, args2: any) => boolean
): T;
}
declare module 'just-merge' {
// Definitions by: nokazn <https://github.com/nokazn>
function merge(obj1: object, ...objs: object[]): object;
export = merge;
}
declare module 'just-modulo' {
export default function modulo(n: number, d: number): number;
}
declare module 'just-omit' {
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove: Key[]
): Omit<Obj, Key>;
export function omit<Obj extends object, Key extends string>(
obj: Obj,
remove1: Key,
...removeN: Key[]
): Omit<Obj, Key>;
}
declare module 'just-once' {
export function once<Func extends (...args: unknown[]) => unknown>(
fn: Func
): Func;
}
declare module 'just-partition' {
export default function partition<First, Second>(
arr: (First | Second)[],
fn: (arg: First | Second) => unknown
): [First[], Second[]];
}
declare module 'just-permutations' {
export default function permutations<First, Rest>(
arr: [First, ...Rest[]]
): (First | Rest)[][];
export default function permutations<T>(arr: T[]): T[]; // for empty arrays
}
declare module 'just-pick' {
// Definitions by: Peter Safranek <https://github.com/pe8ter>
function pick<T, U extends keyof T>(obj: T, select: U[]): Pick<T, U>;
function pick<T, U extends keyof T>(
obj: T,
select1: U,
...selectn: U[]
): Pick<T, U>;
export = pick;
}
declare module 'just-random' {
export default function random<Head, Rest>(
arr: [Head, ...Rest[]]
): Head | Rest;
export default function random<T>(arr: T[]): undefined; // return undefined for empty arrays.
}
declare module 'just-range' {
function range(stop: number): number[];
function range(
start?: number,
stop?: number | null | undefined,
step?: number | null
): number[];
export = range;
}
declare module 'just-remove' {
export default function remove<T, U, V extends T>(
arr1: T[],
arr2: U[]
): (V | Exclude<T, U>)[];
}
declare module 'just-safe-get' {
// Definitions by: Richard Tan <https://github.com/chardos>
function get(
item: any[] | {},
target: string | string[],
defaultValue?: any
): any;
export = get;
}
declare module 'just-safe-set' {
// Definitions by: Roman Lerchster <https://github.com/wa4-fearless-otter>
function set(
item: any[] | {},
target: string | symbol | Array<string | symbol>,
value: any
): boolean;
export = set;
}
declare module 'just-shuffle' {
type Options = {
shuffleAll: boolean;
};
export default function shuffle<T>(arr: T[], options?: Options): T[];
}
declare module 'just-snake-case' {
// Definitions by: Michael Wittwer <https://github.com/michaelwittwer>
function snakeCase(value: string): string;
export = snakeCase;
}
declare module 'just-sort-by' {
function sortBy<T>(arr: T[], iteratee?: string | Function): T[];
export = sortBy;
}
declare module 'just-split' {
export default function split<T>(arr: T[], n?: number | null): Array<T[]>;
}
declare module 'just-throttle' {
// Definitions by: Dominik Rowicki <https://github.com/papermana>
// Modified by: Angus Croll <https://github.com/angus-c>
type options = {
leading?: boolean;
trailing?: boolean;
};
type Methods = {
cancel: () => void;
flush: () => void;
};
function throttle<Func extends (...args: any[]) => any>(
fn: Func,
interval: number,
options?: options
): Func & Methods;
export = throttle;
}
declare module 'just-union' {
export default function union<T, U>(arr1: T[], arr2: U[]): (T | U)[];
}
declare module 'just-unique' {
export default function unique<T>(
arr: string[],
sorted: boolean | null,
strings: true
): string[];
export default function unique<T>(
arr: T[],
sorted?: boolean | null,
strings?: false | null
): T[];
}
declare module 'just-values' {
export function values<Arr extends unknown[]>(obj: Arr): Arr;
export function values<Obj extends object>(
obj: Obj
): Obj extends String
? Obj[number][]
: Obj extends Number | Boolean
? unknown[]
: Obj[keyof Obj][];
}
export { default as template } from 'just-template';

@@ -359,0 +4,0 @@ export { default as truncate } from 'just-truncate';

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