mirror of
https://github.com/docmost/docmost.git
synced 2026-07-23 19:22:47 +10:00
feat(ee): bases
Table and kanban UI, formula engine package, and the base-embed editor extension
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { register } from "./registry";
|
||||
|
||||
const s = (v: unknown): string => v == null ? "" : String(v);
|
||||
|
||||
register({
|
||||
name: "concat", arity: { min: 1, max: null }, paramTypes: "variadic-any", returnType: "string",
|
||||
eval: (args) => args.map(s).join(""),
|
||||
doc: "Concatenates strings.", category: "string",
|
||||
});
|
||||
register({
|
||||
name: "length", arity: { min: 1, max: 1 }, paramTypes: ["string"], returnType: "number",
|
||||
eval: ([v]) => s(v).length,
|
||||
doc: "Length of a string.", category: "string",
|
||||
});
|
||||
register({
|
||||
name: "contains", arity: { min: 2, max: 2 }, paramTypes: ["string", "string"], returnType: "boolean",
|
||||
eval: ([a, b]) => s(a).includes(s(b)),
|
||||
doc: "Returns true if the first string contains the second.", category: "string",
|
||||
});
|
||||
register({
|
||||
name: "lower", arity: { min: 1, max: 1 }, paramTypes: ["string"], returnType: "string",
|
||||
eval: ([v]) => s(v).toLowerCase(),
|
||||
doc: "Lowercases the string.", category: "string",
|
||||
});
|
||||
register({
|
||||
name: "upper", arity: { min: 1, max: 1 }, paramTypes: ["string"], returnType: "string",
|
||||
eval: ([v]) => s(v).toUpperCase(),
|
||||
doc: "Uppercases the string.", category: "string",
|
||||
});
|
||||
register({
|
||||
name: "trim", arity: { min: 1, max: 1 }, paramTypes: ["string"], returnType: "string",
|
||||
eval: ([v]) => s(v).trim(),
|
||||
doc: "Strips whitespace from both ends.", category: "string",
|
||||
});
|
||||
Reference in New Issue
Block a user