1
0
mirror of synced 2025-12-19 18:10:59 -05:00

add transformer pattern & rest transformer for API (#58388)

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
This commit is contained in:
Evan Bonsignori
2025-12-04 11:12:40 -08:00
committed by GitHub
parent c1973b0c04
commit cfb053cb67
16 changed files with 1140 additions and 19 deletions

View File

@@ -10,6 +10,7 @@ import { Tool, tags as toolTags } from './tool'
import { Spotlight, tags as spotlightTags } from './spotlight'
import { Prompt } from './prompt'
import IndentedDataReference from './indented-data-reference'
import { apiTransformerTags } from '@/article-api/liquid-renderers'
// Type assertions for .js files without type definitions
// Copilot: Remove these assertions when the corresponding .js files are converted to TypeScript
@@ -40,6 +41,11 @@ for (const tag in spotlightTags) {
engine.registerTag('prompt', anyPrompt)
// Register API transformer tags
for (const [tagName, tagClass] of Object.entries(apiTransformerTags)) {
engine.registerTag(tagName, tagClass as any)
}
/**
* Like the `size` filter, but specifically for
* getting the number of keys in an object