You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: docs/supported-packages/ajv.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: ajv
2
+
title: "ajv"
3
3
---
4
4
5
5
# ajv
@@ -40,11 +40,13 @@ What happens **after** calling this function:
40
40
41
41
**Condition:** data fails validation against the JSON schema
42
42
43
-
**Returns:** false (errors are stored in ajv.errors property)
43
+
**Returns:**
44
+
45
+
false (errors are stored in ajv.errors property)
44
46
45
47
**Required Handling:**
46
48
47
-
Caller MUST check the return value of validate() and handle the false case. When validate() returns false, ajv.errors contains validation error details. Without checking the return value, invalid data will pass through, leading to data corruption, business logic errors, or security vulnerabilities. Use pattern: if (!ajv.validate(schema, data)) { console.error(ajv.errors); }
49
+
Caller MUST check the return value of validate() and handle the false case. When validate() returns false, ajv.errors contains validation error details. Without checking the return value, invalid data will pass through, leading to data corruption, business logic errors, or security vulnerabilities. Use pattern: if (!ajv.validate(schema, data)) console.error(ajv.errors);
@@ -68,11 +70,11 @@ What happens **after** calling this function:
68
70
69
71
**Condition:** schema is invalid or malformed
70
72
71
-
**Throws:**`Error (schema compilation error)`
73
+
**Throws:** Error (schema compilation error)
72
74
73
75
**Required Handling:**
74
76
75
-
Caller MUST wrap compile() in try-catch when working with untrusted schemas. Invalid schemas cause compilation errors that crash the application. Use pattern: try { const validate = ajv.compile(schema); } catch (error) { /* handle */ }
77
+
Caller MUST wrap compile() in try-catch when working with untrusted schemas. Invalid schemas cause compilation errors that crash the application. Use pattern: try const validate = ajv.compile(schema); catch (error) /* handle */
@@ -96,11 +98,13 @@ What happens **after** calling this function:
96
98
97
99
**Condition:** schema is invalid according to meta-schema
98
100
99
-
**Returns:** false (errors are stored in ajv.errors property)
101
+
**Returns:**
102
+
103
+
false (errors are stored in ajv.errors property)
100
104
101
105
**Required Handling:**
102
106
103
-
Caller MUST check the return value to determine if schema is valid. Without checking, invalid schemas may be used, causing unexpected validation behavior. Use pattern: if (!ajv.validateSchema(schema)) { console.error(ajv.errors); }
107
+
Caller MUST check the return value to determine if schema is valid. Without checking, invalid schemas may be used, causing unexpected validation behavior. Use pattern: if (!ajv.validateSchema(schema)) console.error(ajv.errors);
Copy file name to clipboardExpand all lines: docs/supported-packages/archiver.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: archiver
2
+
title: "archiver"
3
3
---
4
4
5
5
# archiver
@@ -40,11 +40,11 @@ What happens **after** calling this function:
40
40
41
41
**Condition:** archiver instance created without error event handler
42
42
43
-
**Throws:**`Emits 'error' event that crashes process if not handled`
43
+
**Throws:** Emits 'error' event that crashes process if not handled
44
44
45
45
**Required Handling:**
46
46
47
-
Caller MUST attach error event handler immediately after creating archiver instance. Without error handler, unhandled 'error' events crash the entire Node.js process. CRITICAL: This is the #1 production bug (70% of codebases). Always add: archive.on('error', (error) => { handle_error(error); })
47
+
Caller MUST attach error event handler immediately after creating archiver instance. Without error handler, unhandled 'error' events crash the entire Node.js process. CRITICAL: This is the #1 production bug (70% of codebases). Always add: archive.on('error', (error) = handle_error(error); )
Caller MUST attach warning event handler to catch non-blocking errors. Without warning handler, file access errors (ENOENT) go unnoticed, resulting in incomplete archives and silent data loss. CRITICAL: This is production bug #2 (80% of codebases). Always add: archive.on('warning', (err) => { if (err.code !== 'ENOENT') throw err; })
60
+
Caller MUST attach warning event handler to catch non-blocking errors. Without warning handler, file access errors (ENOENT) go unnoticed, resulting in incomplete archives and silent data loss. CRITICAL: This is production bug #2 (80% of codebases). Always add: archive.on('warning', (err) = if (err.code !== 'ENOENT') throw err; )
@@ -66,7 +66,7 @@ Caller MUST attach warning event handler to catch non-blocking errors. Without w
66
66
67
67
**Condition:** Compression fails during archive creation
68
68
69
-
**Throws:**`Emits 'error' event with Error object`
69
+
**Throws:** Emits 'error' event with Error object
70
70
71
71
**Required Handling:**
72
72
@@ -79,7 +79,7 @@ Caller MUST handle compression errors via error event handler. Common causes: ou
79
79
80
80
**Condition:** File or directory is missing or inaccessible (ENOENT, EACCES)
81
81
82
-
**Throws:**`Emits 'warning' event for non-blocking errors like ENOENT`
82
+
**Throws:** Emits 'warning' event for non-blocking errors like ENOENT
83
83
84
84
**Required Handling:**
85
85
@@ -92,7 +92,7 @@ Caller MUST handle warning events to detect missing or inaccessible files. Warni
92
92
93
93
**Condition:** Archive operations performed but finalize() never called
94
94
95
-
**Throws:**`Process exits silently with code 0 when event loop empties`
95
+
**Throws:** Process exits silently with code 0 when event loop empties
96
96
97
97
**Required Handling:**
98
98
@@ -107,31 +107,31 @@ Known gotchas and sharp edges:
107
107
108
108
**⚠️ WARNING - no-error-handler**
109
109
110
-
CRITICAL (70% of codebases): No error event handler attached. Any compression error, write failure, or file access error results in an unhandled error that crashes the process. ALWAYS attach error handler BEFORE calling finalize() or appending files: archive.on('error', (err) => { console.error('Archive error:', err); throw err; });
110
+
CRITICAL (70% of codebases): No error event handler attached. Any compression error, write failure, or file access error results in an unhandled error that crashes the process. ALWAYS attach error handler BEFORE calling finalize() or appending files: archive.on('error', (err) = console.error('Archive error:', err); throw err; );
COMMON (40% of codebases): Only awaiting finalize() promise without waiting for 'close' event on output stream. With large file counts (100+), finalize() promise resolves before all files are written, resulting in corrupt/incomplete archives. MUST wait for both finalize() AND output stream 'close' event: await archive.finalize(); await new Promise(resolve => output.on('close', resolve));
134
+
COMMON (40% of codebases): Only awaiting finalize() promise without waiting for 'close' event on output stream. With large file counts (100+), finalize() promise resolves before all files are written, resulting in corrupt/incomplete archives. MUST wait for both finalize() AND output stream 'close' event: await archive.finalize(); await new Promise(resolve = output.on('close', resolve));
@@ -138,11 +138,11 @@ Caller MUST wrap bcrypt.compare() in try-catch or use .catch() handler. Type err
138
138
139
139
**Condition:** hash parameter is not a valid bcrypt hash format
140
140
141
-
**Throws:**`Error: Invalid hash provided or hash is not a valid bcrypt hash`
141
+
**Throws:** Error: Invalid hash provided or hash is not a valid bcrypt hash
142
142
143
143
**Required Handling:**
144
144
145
-
Caller MUST handle errors from malformed hash values. Database corruption, string truncation (VARCHAR < 60), or encoding issues can cause invalid hashes. This is the #1 production authentication bug.
145
+
Caller MUST handle errors from malformed hash values. Database corruption, string truncation (VARCHAR 60), or encoding issues can cause invalid hashes. This is the #1 production authentication bug.
0 commit comments