feat: drop keepOutputType option (#838)

Remove KeepingTypeEmitter and always stringify via SimpleEmitter. On next, map breaking commits to patch so alpha stays on 11.x.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Yang Jun
2026-07-09 22:32:18 +08:00
co-authored by Cursor
parent cc4a9ce0a7
commit 6e48c4e39f
7 changed files with 16 additions and 125 deletions
@@ -1,39 +0,0 @@
import { Liquid } from '../../../src/liquid'
describe('LiquidOptions#*keepOutputType*', function () {
it('should respect keepOutputType', async function () {
const engine = new Liquid({
keepOutputType: true
})
const context = {
'my-boolean': true,
'my-number': 42,
'my-string': 'test'
}
const booleanHtml = await engine.parseAndRender('{{my-boolean}}', context)
expect(booleanHtml).toBe(true)
const numberHtml = await engine.parseAndRender('{{my-number}}', context)
expect(numberHtml).toBe(42)
const html = await engine.parseAndRender('{{my-string}}', context)
expect(html).toBe('test')
const composedHtml = await engine.parseAndRender('{{my-string}}:{{my-number}}', context)
expect(composedHtml).toBe('test:42')
})
it('should respect keepOutputType = false as default', async function () {
const engine = new Liquid()
const context = {
'my-boolean': true,
'my-number': 42,
'my-string': 'test'
}
const booleanHtml = await engine.parseAndRender('{{my-boolean}}', context)
expect(booleanHtml).toBe('true')
const numberHtml = await engine.parseAndRender('{{my-number}}', context)
expect(numberHtml).toBe('42')
const html = await engine.parseAndRender('{{my-string}}', context)
expect(html).toBe('test')
const composedHtml = await engine.parseAndRender('{{my-string}}:{{my-number}}', context)
expect(composedHtml).toBe('test:42')
})
})