zynor 0.0.85 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.js +2 -2
- package/dist/native.cjs +3 -3
- package/dist/native.d.ts +25 -15
- package/dist/native.js +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2817,7 +2817,7 @@ export declare class EmailValidator {
|
|
|
2817
2817
|
*
|
|
2818
2818
|
* Unlike {@link validateBulk}, which waits for every input before returning,
|
|
2819
2819
|
* `each` invokes `onBatch` as soon as enough results have accumulated
|
|
2820
|
-
* (`
|
|
2820
|
+
* (`perPage`, default 10) and continues until every input has been
|
|
2821
2821
|
* processed. Designed for very large inputs (millions) where time-to-first
|
|
2822
2822
|
* result matters and holding the entire result array in memory is wasteful.
|
|
2823
2823
|
*
|
|
@@ -2827,7 +2827,7 @@ export declare class EmailValidator {
|
|
|
2827
2827
|
* round-robin per validation.
|
|
2828
2828
|
*
|
|
2829
2829
|
* Backpressure: `onBatch` is awaited serially. If the callback is slow and
|
|
2830
|
-
* the in-memory buffer reaches `10 *
|
|
2830
|
+
* the in-memory buffer reaches `10 * perPage`, workers pause picking
|
|
2831
2831
|
* new emails until the buffer drains below the cap. This keeps memory
|
|
2832
2832
|
* bounded for truly large inputs.
|
|
2833
2833
|
*
|
|
@@ -2845,7 +2845,7 @@ export declare class EmailValidator {
|
|
|
2845
2845
|
* @param emails - The list of email addresses to validate
|
|
2846
2846
|
* @param options - Streaming options
|
|
2847
2847
|
* @param options.concurrency - Max parallel validations (default 500)
|
|
2848
|
-
* @param options.
|
|
2848
|
+
* @param options.perPage - Min results buffered before invoking onBatch (default 10)
|
|
2849
2849
|
* @param options.deep - Enable deep validation per email
|
|
2850
2850
|
* @param options.logo - Fetch provider logo per email
|
|
2851
2851
|
* @param options.signal - AbortSignal to cancel the batch
|
|
@@ -2857,7 +2857,7 @@ export declare class EmailValidator {
|
|
|
2857
2857
|
* ```typescript
|
|
2858
2858
|
* await validator.each(
|
|
2859
2859
|
* emails, // could be millions
|
|
2860
|
-
* { concurrency: 500,
|
|
2860
|
+
* { concurrency: 500, perPage: 50, deep: true },
|
|
2861
2861
|
* async (batch) => {
|
|
2862
2862
|
* await db.insertMany(batch);
|
|
2863
2863
|
* },
|
|
@@ -2866,7 +2866,7 @@ export declare class EmailValidator {
|
|
|
2866
2866
|
*/
|
|
2867
2867
|
each(emails: string[], options: {
|
|
2868
2868
|
concurrency?: number;
|
|
2869
|
-
|
|
2869
|
+
perPage?: number;
|
|
2870
2870
|
deep?: boolean;
|
|
2871
2871
|
logo?: boolean;
|
|
2872
2872
|
signal?: AbortSignal;
|
|
@@ -3698,24 +3698,24 @@ export declare class Zynor {
|
|
|
3698
3698
|
/**
|
|
3699
3699
|
* Streams validation results as they complete. Forwards to
|
|
3700
3700
|
* {@link EmailValidator.each} on the singleton validator. See `each` for
|
|
3701
|
-
* full semantics — defaults are `concurrency: 500`, `
|
|
3701
|
+
* full semantics — defaults are `concurrency: 500`, `perPage: 10`, and
|
|
3702
3702
|
* all validator-routed DNS calls bypass the per-provider queue.
|
|
3703
3703
|
*
|
|
3704
3704
|
* @param emails - The list of email addresses to validate
|
|
3705
|
-
* @param options - Streaming options (concurrency,
|
|
3705
|
+
* @param options - Streaming options (concurrency, perPage, deep, etc.)
|
|
3706
3706
|
* @param onBatch - Callback invoked with each completed batch
|
|
3707
3707
|
* @returns Resolves once every input has been processed and flushed
|
|
3708
3708
|
*
|
|
3709
3709
|
* @example
|
|
3710
3710
|
* ```typescript
|
|
3711
|
-
* await Zynor.each(emails, {
|
|
3711
|
+
* await Zynor.each(emails, { perPage: 50 }, async (batch) => {
|
|
3712
3712
|
* await db.insertMany(batch);
|
|
3713
3713
|
* });
|
|
3714
3714
|
* ```
|
|
3715
3715
|
*/
|
|
3716
3716
|
static each(emails: string[], options: {
|
|
3717
3717
|
concurrency?: number;
|
|
3718
|
-
|
|
3718
|
+
perPage?: number;
|
|
3719
3719
|
deep?: boolean;
|
|
3720
3720
|
logo?: boolean;
|
|
3721
3721
|
signal?: AbortSignal;
|