@rebasepro/types 0.25.0-canary.ge06257e → 0.25.1
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.es.js +36 -1
- package/dist/index.es.js.map +1 -1
- package/dist/types/content_hash.d.ts +20 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a static build's file name carries a content hash: the files the
|
|
3
|
+
* runtime serves `immutable` for a year, and the ones `rebase build` writes
|
|
4
|
+
* `.br` and `.gz` beside. One rule for both, so a file is never precompressed
|
|
5
|
+
* and revalidated, or cached for a year and compressed on every request.
|
|
6
|
+
*
|
|
7
|
+
* Two shapes count:
|
|
8
|
+
*
|
|
9
|
+
* - **Vite's own**, `[name]-[hash]`: the last eight characters of the name,
|
|
10
|
+
* after a `-`. They are base64url, an alphabet with `-` and `_` in it, so
|
|
11
|
+
* about one hash in eight holds a `-` (`index-C-WpENHZ.js`,
|
|
12
|
+
* `page10-D6Dq--fD.js`), and the last `-` is not where it starts.
|
|
13
|
+
* - **A longer one** with no `-` in it, eight characters or more after the last
|
|
14
|
+
* `-` (`[hash:12]`, another bundler's names).
|
|
15
|
+
*
|
|
16
|
+
* Either must hold a digit or a capital. That is the evidence of a hash: a
|
|
17
|
+
* hand-written `vendor-analytics.js` is not taken for one, and gets revalidated
|
|
18
|
+
* rather than pinned in every visitor's cache with no way to recall it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isContentHashedFileName(fileName: string): boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export * from "./scopes.js";
|
|
|
32
32
|
export * from "./history.js";
|
|
33
33
|
export * from "./postgres_introspection.js";
|
|
34
34
|
export * from "./project_manifest.js";
|
|
35
|
+
export * from "./content_hash.js";
|
|
35
36
|
export * from "./collection_contract.js";
|
|
36
37
|
export * from "./schema_version.js";
|
|
37
38
|
export * from "./storage_authorize.js";
|