@monoflake/sdk 2026.1005.0 → 2026.1005.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.
@@ -33,7 +33,7 @@ export declare const ROOT_KEY = "state/index.json";
33
33
  * either. The type survives as the one thing that decides the extension: a caller asks for a
34
34
  * `content` object and the table below says that is spelled `json`.
35
35
  */
36
- export declare function artifactAddress(type: ArtifactType, hash: string): string;
36
+ export declare function artifactAddress(type: ArtifactType, cid: string): string;
37
37
  /**
38
38
  * Where an object lives: its content id, fanned out, and nothing else.
39
39
  *
@@ -36,8 +36,8 @@ const ROOT_KEY = "state/index.json";
36
36
  * either. The type survives as the one thing that decides the extension: a caller asks for a
37
37
  * `content` object and the table below says that is spelled `json`.
38
38
  */
39
- function artifactAddress(type, hash) {
40
- return `object/${hash}.${EXTENSION[type]}`;
39
+ function artifactAddress(type, cid) {
40
+ return `object/${cid}.${EXTENSION[type]}`;
41
41
  }
42
42
  /**
43
43
  * Where an object lives: its content id, fanned out, and nothing else.
@@ -71,14 +71,14 @@ function recordKey(resource) {
71
71
  function parseArtifactKey(key) {
72
72
  const match = /^([a-z]+)\/([0-9a-f]+)\.([a-z0-9]+)$/.exec(key);
73
73
  if (!match) return void 0;
74
- const [, type, hash, ext] = match;
75
- if (!type || !hash || !ext) return void 0;
76
- if (!HASH_PATTERN.test(hash)) return void 0;
74
+ const [, type, digest, ext] = match;
75
+ if (!type || !digest || !ext) return void 0;
76
+ if (!HASH_PATTERN.test(digest)) return void 0;
77
77
  if (!ARTIFACT_TYPES.includes(type)) return void 0;
78
78
  if (EXTENSION[type] !== ext) return void 0;
79
79
  return {
80
80
  type,
81
- hash,
81
+ hash: digest,
82
82
  ext
83
83
  };
84
84
  }
@@ -54,8 +54,8 @@ function longEdge(file) {
54
54
  function best(image, want) {
55
55
  const vector = image.variants.find((file) => SCALABLE_MIMES.has(file.mime));
56
56
  if (vector) return vector;
57
- const rungs = [...image.variants].sort((a, b) => longEdge(a) - longEdge(b));
58
- return rungs.find((file) => longEdge(file) >= want) ?? rungs[rungs.length - 1];
57
+ const ordered = image.variants.toSorted((a, b) => longEdge(a) - longEdge(b));
58
+ return ordered.find((file) => longEdge(file) >= want) ?? ordered.at(-1);
59
59
  }
60
60
  /**
61
61
  * What an icon's file is spelled with, keyed by what is in it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoflake/sdk",
3
- "version": "2026.1005.0",
3
+ "version": "2026.1005.1",
4
4
  "description": "Addresses and clients for the platform.",
5
5
  "keywords": [
6
6
  "cloudflare-workers",