Comparing version 0.2.0 to 0.3.0
@@ -18,2 +18,2 @@ /** | ||
*/ | ||
export declare const compactMap: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => U | null | undefined) => Promise<U[]>; | ||
export declare const compactMap: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<U | null | undefined> | U | null | undefined) => Promise<U[]>; |
@@ -14,2 +14,2 @@ /** | ||
*/ | ||
export declare const every: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => boolean) => Promise<boolean>; | ||
export declare const every: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<boolean> | boolean) => Promise<boolean>; |
@@ -14,2 +14,2 @@ /** | ||
*/ | ||
export declare const filter: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => boolean) => Promise<T[]>; | ||
export declare const filter: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<boolean> | boolean) => Promise<T[]>; |
@@ -14,2 +14,2 @@ /** | ||
*/ | ||
export declare const find: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => boolean) => Promise<T | undefined>; | ||
export declare const find: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<boolean> | boolean) => Promise<T | undefined>; |
@@ -14,2 +14,2 @@ /** | ||
*/ | ||
export declare const flatMap: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => U[]) => Promise<U[]>; | ||
export declare const flatMap: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<U[]> | U[]) => Promise<U[]>; |
@@ -0,7 +1,8 @@ | ||
type CooperativeAction = (i: number) => Promise<boolean | void | unknown> | boolean | void | unknown; | ||
type CooperativeForType = { | ||
(end: number, action: (i: number) => void): Promise<void>; | ||
(start: number, end: number, action: (i: number) => void): Promise<void>; | ||
(start: number, end: number, step: number, action: (i: number) => void): Promise<void>; | ||
(end: number, action: CooperativeAction): Promise<void>; | ||
(start: number, end: number, action: CooperativeAction): Promise<void>; | ||
(start: number, end: number, step: number, action: CooperativeAction): Promise<void>; | ||
}; | ||
export declare const cooperativeFor: CooperativeForType; | ||
export {}; |
@@ -25,2 +25,2 @@ /** | ||
*/ | ||
export declare const forEach: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => void) => Promise<void>; | ||
export declare const forEach: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<void | unknown> | void | unknown) => Promise<void>; |
@@ -7,2 +7,2 @@ /** | ||
*/ | ||
export declare const groupBy: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => U) => Promise<Map<U, T[]>>; | ||
export declare const groupBy: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<U> | U) => Promise<Map<U, T[]>>; |
@@ -15,2 +15,3 @@ export * from './cooperate'; | ||
export * from './zip'; | ||
export * from './CancelError'; | ||
export * from './config'; |
@@ -7,2 +7,2 @@ /** | ||
*/ | ||
export declare const map: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => U) => Promise<U[]>; | ||
export declare const map: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<U> | U) => Promise<U[]>; |
@@ -13,2 +13,2 @@ /** | ||
*/ | ||
export declare const partition: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => boolean) => Promise<[T[], T[]]>; | ||
export declare const partition: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<boolean> | boolean) => Promise<[T[], T[]]>; |
@@ -15,2 +15,2 @@ /** | ||
*/ | ||
export declare const reduce: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U) => Promise<U>; | ||
export declare const reduce: <T, U>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => Promise<U> | U, initialValue: U) => Promise<U>; |
@@ -14,2 +14,2 @@ /** | ||
*/ | ||
export declare const some: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => boolean) => Promise<boolean>; | ||
export declare const some: <T>(arrayOrPromise: T[] | Promise<T[]>, callbackfn: (value: T, index: number, array: T[]) => Promise<boolean> | boolean) => Promise<boolean>; |
@@ -1,4 +0,1 @@ | ||
export type CooperativeWhileType = { | ||
(condition: () => boolean, action: () => void): void; | ||
}; | ||
export declare const cooperativeWhile: (condition: () => boolean, action: () => void | Promise<void> | unknown) => import('..').CooperationPromise<void>; | ||
export declare const cooperativeWhile: (condition: () => boolean, action: () => Promise<void | unknown> | void | unknown) => import('..').CooperationPromise<void>; |
{ | ||
"name": "unjam", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Unjam is a JavaScript and TypeScript library offering non-blocking versions of common array methods like forEach, map, and filter. Designed for cooperative multitasking, Unjam keeps your application responsive, even with large data processing tasks, by preventing the main thread from being blocked. Perfect for smooth and efficient JavaScript execution in web applications.", | ||
@@ -34,4 +34,4 @@ "keywords": [ | ||
"type": "module", | ||
"types": "./dist/unjam.d.ts", | ||
"module": "dist/unjam.mjs", | ||
"types": "./dist/index.d.ts", | ||
"module": "./dist/index.mjs", | ||
"exports": { | ||
@@ -111,3 +111,3 @@ ".": { | ||
}, | ||
"main": "dist/unjam.cjs", | ||
"main": "./dist/index.cjs", | ||
"repository": { | ||
@@ -114,0 +114,0 @@ "type": "git", |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 6 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 4 instances in 1 package
121989
700
16