spooder 4.2.3 → 4.2.4
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/README.md +1 -1
- package/package.json +1 -1
- package/src/api.ts +3 -1
package/README.md
CHANGED
|
@@ -1008,7 +1008,7 @@ generate_hash_subs(40).then(...);
|
|
|
1008
1008
|
> [!NOTE]
|
|
1009
1009
|
> SHA-1 hashes are `40` characters. Git is transitioning to SHA-256, which are `64` characters. Short hashes of `7` are generally sufficient for cache-busting.
|
|
1010
1010
|
|
|
1011
|
-
Use a different prefix other than
|
|
1011
|
+
Use a different prefix other than `hash=` by passing it as the first parameter.
|
|
1012
1012
|
|
|
1013
1013
|
```ts
|
|
1014
1014
|
generate_hash_subs(7, '$#').then(subs => hash_sub_table = subs).catch(caution);
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -142,6 +142,8 @@ export function parse_template(template: string, replacements: Record<string, st
|
|
|
142
142
|
for (const loop_entry of loop_entries)
|
|
143
143
|
for (const index of indicies)
|
|
144
144
|
content_parts[index] = loop_entry;
|
|
145
|
+
|
|
146
|
+
result += content_parts.join('');
|
|
145
147
|
} else {
|
|
146
148
|
result += '{$' + buffer + '}' + loop_content + '{/for}';
|
|
147
149
|
}
|
|
@@ -161,7 +163,7 @@ export function parse_template(template: string, replacements: Record<string, st
|
|
|
161
163
|
return result;
|
|
162
164
|
}
|
|
163
165
|
|
|
164
|
-
export async function generate_hash_subs(length = 7, prefix = '
|
|
166
|
+
export async function generate_hash_subs(length = 7, prefix = 'hash='): Promise<Record<string, string>> {
|
|
165
167
|
const cmd = ['git', 'ls-tree', '-r', 'HEAD'];
|
|
166
168
|
const process = Bun.spawn(cmd, {
|
|
167
169
|
stdout: 'pipe',
|