@shipstatic/ship 0.4.21 → 0.4.22
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/browser.d.ts +8 -3
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -422,12 +422,17 @@ declare const JUNK_DIRECTORIES: readonly ["__MACOSX", ".Trashes", ".fseventsd",
|
|
|
422
422
|
/**
|
|
423
423
|
* Filters an array of file paths, removing those considered junk
|
|
424
424
|
*
|
|
425
|
-
* A path is filtered out if
|
|
425
|
+
* A path is filtered out if any of these conditions are met:
|
|
426
426
|
* 1. The basename is identified as junk by the 'junk' package (e.g., .DS_Store, Thumbs.db)
|
|
427
|
-
* 2. Any
|
|
427
|
+
* 2. Any path segment (file or directory) starts with a dot (e.g., .env, .git, .gitattributes)
|
|
428
|
+
* 3. Any path segment exceeds 255 characters (filesystem limit)
|
|
429
|
+
* 4. Any directory segment in the path matches an entry in JUNK_DIRECTORIES (case-insensitive)
|
|
428
430
|
*
|
|
429
431
|
* All path separators are normalized to forward slashes for consistent cross-platform behavior.
|
|
430
432
|
*
|
|
433
|
+
* Note: Dot files are filtered for security - they typically contain sensitive configuration
|
|
434
|
+
* (.env, .git) or are not meant to be served publicly. This matches server-side filtering.
|
|
435
|
+
*
|
|
431
436
|
* @param filePaths - An array of file path strings to filter
|
|
432
437
|
* @returns A new array containing only non-junk file paths
|
|
433
438
|
*
|
|
@@ -436,7 +441,7 @@ declare const JUNK_DIRECTORIES: readonly ["__MACOSX", ".Trashes", ".fseventsd",
|
|
|
436
441
|
* import { filterJunk } from '@shipstatic/ship';
|
|
437
442
|
*
|
|
438
443
|
* // Filter an array of file paths
|
|
439
|
-
* const paths = ['index.html', '.DS_Store', '__MACOSX/file.txt', 'app.js'];
|
|
444
|
+
* const paths = ['index.html', '.DS_Store', '.gitattributes', '__MACOSX/file.txt', 'app.js'];
|
|
440
445
|
* const clean = filterJunk(paths);
|
|
441
446
|
* // Result: ['index.html', 'app.js']
|
|
442
447
|
* ```
|