mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
fix: contains regression (#677)
* fix: `contains` regression on string-like objects, #675 * chore: fix build docs on macos
This commit is contained in:
@@ -485,4 +485,18 @@ describe('Issues', function () {
|
||||
'{% endif %}', {})
|
||||
expect(result).toEqual('show')
|
||||
})
|
||||
it('#675 10.10.1 Operator: contains regression', () => {
|
||||
const engine = new Liquid()
|
||||
class StrictStringForLiquid {
|
||||
constructor (private value: string) {}
|
||||
indexOf (other: unknown) {
|
||||
return this.value.indexOf(String(other))
|
||||
}
|
||||
}
|
||||
const result = engine.parseAndRenderSync('{{ str contains sub }}', {
|
||||
str: new StrictStringForLiquid('string'),
|
||||
sub: 'str'
|
||||
})
|
||||
expect(result).toEqual('true')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user