Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: add missing slice method to strings in expressions (#5430)

Bogdan Chadkin19cfd121845c
diff --git a/packages/sdk/src/expression.test.ts b/packages/sdk/src/expression.test.ts
index 9a0abb2812..aeab795d0e 100644
--- a/packages/sdk/src/expression.test.ts
+++ b/packages/sdk/src/expression.test.ts
@@ -226,6 +226,7 @@ describe("lint expression", () => {
"replace",
"split",
"at",
+ "slice",
"endsWith",
"includes",
"startsWith",
diff --git a/packages/sdk/src/expression.ts b/packages/sdk/src/expression.ts
index 48510fd40b..a259d5ff39 100644
--- a/packages/sdk/src/expression.ts
+++ b/packages/sdk/src/expression.ts
@@ -33,6 +33,7 @@ export const allowedStringMethods = new Set([
"toLowerCase",
"replace",
"split",
+ "slice",
"at",
"endsWith",
"includes",