generated from Dalkak/sample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
31 lines (30 loc) · 842 Bytes
/
index.ts
File metadata and controls
31 lines (30 loc) · 842 Bytes
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
import {
Extension, Block,
} from "dalkak";
export default new Extension({
name: "JSON",
color: 0x525252,
blocks: {
parse: new Block({
name: "parse",
template: "((json) 해석하기)",
func: ({json}) => {
return JSON.parse(json);
}
}),
get: new Block({
name: "get",
template: "((input)의 (propName)값 구하기)",
func: ({input, propName}) => {
return input[propName];
}
}),
set: new Block({
name: "set",
template: "변수 (val)의 (propName)값을 (data)로 정하기",
func: ({val, propName, data}, project, local) => {
local.getVariable(val).value[propName] = data;
}
})
}
});