Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

defineFunc

import { defineFunc } from "https://raw.githubusercontent.com/Hatscat/MetavaScript/main/index.ts";

declare a function

@example
// returns "a=_=>(42)"
defineFunc({ name: "a", body: 42 })
@example
// returns "_=>42"
defineFunc({ body: 42, safe: false })
@example
// returns "f=(a,b)=>b=a**a,a+b"
defineFunc({ name: "f", args: ["a", "b"], body: [assign("b", pow("a", "a")), add("a", "b")], safe: false })
function defineFunc({ name, args, body, safe }: FunctionDefinition): string;
§
defineFunc({ name, args, body, safe }: FunctionDefinition): string
[src]

§Parameters

§
{ name, args, body, safe }: FunctionDefinition
[src]

§Return Type

§
string
[src]