@blackbelt-technology/pi-image-fit-extension 0.9.0 → 0.11.0
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/package.json +3 -3
- package/src/cache.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blackbelt-technology/pi-image-fit-extension",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Pi extension that resizes oversize images at Read-time so they fit model byte and pixel ceilings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"jimp": "^1.6.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@earendil-works/pi-coding-agent": ">=1.
|
|
37
|
+
"@earendil-works/pi-coding-agent": ">=1.3.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"@earendil-works/pi-coding-agent": {
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@earendil-works/pi-coding-agent": "^1.
|
|
45
|
+
"@earendil-works/pi-coding-agent": "^1.3.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/src/cache.ts
CHANGED
|
@@ -186,8 +186,11 @@ interface ContentPolicy {
|
|
|
186
186
|
export class ContentCache {
|
|
187
187
|
private readonly map = new Map<string, { entry: ContentEntry; cost: number }>();
|
|
188
188
|
private currentBytes = 0;
|
|
189
|
+
private readonly byteBudget: number;
|
|
189
190
|
|
|
190
|
-
constructor(
|
|
191
|
+
constructor(byteBudget: number = DEFAULT_CONTENT_CACHE_BUDGET) {
|
|
192
|
+
this.byteBudget = byteBudget;
|
|
193
|
+
}
|
|
191
194
|
|
|
192
195
|
/** Content hash for a block under the given policy. */
|
|
193
196
|
keyFor(base64: string, mimeType: string, p: ContentPolicy): string {
|