function __cfHardenFn(fn: Function) { Object.freeze(fn); const prototype = fn.prototype; if (prototype && typeof prototype === "object") { Object.freeze(prototype); } return fn; } import { __cfHelpers } from "commonfabric"; import { pattern } from "commonfabric"; const define = undefined; const runtimeDeps = undefined; const __cfAmdHooks = undefined; const identity = __cfHardenFn((value: T) => value); const __cfLift_1 = __cfHelpers.lift<{ item: string; }, string>(({ item }) => identity(item.toUpperCase()), { type: "object", properties: { item: { type: "string" } }, required: ["item"] } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema); const __cfPattern_1 = __cfHelpers.pattern(__cf_pattern_input => { const item = __cf_pattern_input.key("element"); return __cfLift_1({ item: item }).for("__patternResult", true); }, { type: "object", properties: { element: { type: "string" } }, required: ["element"] } as const satisfies __cfHelpers.JSONSchema, { type: "string" } as const satisfies __cfHelpers.JSONSchema); // FIXTURE: map-local-helper-call-root // Verifies: non-JSX pattern-owned map callbacks lift ordinary local helper // calls as whole callback-local lift-applied computations rather than lowering only the inner // receiver-method argument expression. // items.map((item) => identity(item.toUpperCase())) // -> mapWithPattern(..., ({ item }) => lift(({ item }) => identity(item.toUpperCase()))(...)) export default pattern((__cf_pattern_input) => { const items = __cf_pattern_input.key("items"); return items.mapWithPattern(__cfPattern_1, {}).for("__patternResult", true); }, { type: "object", properties: { items: { type: "array", items: { type: "string" } } }, required: ["items"] } as const satisfies __cfHelpers.JSONSchema, { type: "array", items: { type: "string" } } as const satisfies __cfHelpers.JSONSchema); // @ts-ignore: Internals function h(...args: any[]) { return __cfHelpers.h.apply(null, args); } __cfHardenFn(h); __cfReg({ __cfLift_1, __cfPattern_1 });