-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathfunction-template.pq
More file actions
43 lines (36 loc) · 2.58 KB
/
function-template.pq
File metadata and controls
43 lines (36 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// --------------------------- Function ------------------------------
let
// --------------------------- Fucntion segment -----------------------------------
output =
(/* parameter as text, optional opt_parameter as text */) /* as text */ => // Input definition + Function output type definition
let // Inner function steps declaration
initStep = "",
lastStep = ""
in
lastStep, // Output from inner steps
// --------------------------- Documentation segment ------------------------------
documentation = [
Documentation.Name = " NAME OF FUNCTION ", // Name of the function
Documentation.Description = " DESCRIPTION ", // Decription of the function
Documentation.Source = " URL / SOURCE DESCRIPTION ", // Source of the function
Documentation.Version = " VERSION ", // Version of the function
Documentation.Author = " AUTHOR ", // Author of the function
Documentation.Examples = // Examples of the functions
{
[
Description = " EXAMPLE DESCRIPTION ", // Description of the example
Code = " EXAMPLE CODE ", // Code of the example
Result = " EXAMPLE RESULT " // Result of the example
]
}
]
// --------------------------- Output --------------------------------------------
in
Value.ReplaceType( // Replace type of the value
output, // Function caller
Value.ReplaceMetadata( // Replace metadata of the function
Value.Type(output), // Return output type of function
documentation // Documentation assigment
)
)
// ------------------------------------------------------------------------------------