@@ -70,83 +70,6 @@ local html = import 'html.libsonnet';
70
70
<code>null</code>, <code>true</code> or <code>false</code>.
71
71
||| ,
72
72
},
73
- {
74
- name: 'get' ,
75
- params: ['o' , 'f' , 'default=null' , 'inc_hidden=true' ],
76
- availableSince: '0.18.0' ,
77
- description: |||
78
- Returns the object's field if it exists or default value otherwise.
79
- <code>inc_hidden</code> controls whether to include hidden fields.
80
- ||| ,
81
- },
82
- {
83
- name: 'objectHas' ,
84
- params: ['o' , 'f' ],
85
- availableSince: '0.10.0' ,
86
- description: |||
87
- Returns <code>true</code> if the given object has the field (given as a string), otherwise
88
- <code>false</code>. Raises an error if the arguments are not object and string
89
- respectively. Returns false if the field is hidden.
90
- ||| ,
91
- },
92
- {
93
- name: 'objectFields' ,
94
- params: ['o' ],
95
- availableSince: '0.10.0' ,
96
- description: |||
97
- Returns an array of strings, each element being a field from the given object. Does not include
98
- hidden fields.
99
- ||| ,
100
- },
101
- {
102
- name: 'objectValues' ,
103
- params: ['o' ],
104
- availableSince: '0.17.0' ,
105
- description: |||
106
- Returns an array of the values in the given object. Does not include hidden fields.
107
- ||| ,
108
- },
109
- {
110
- name: 'objectKeysValues' ,
111
- params: ['o' ],
112
- availableSince: '0.20.0' ,
113
- description: |||
114
- Returns an array of objects from the given object, each object having two fields:
115
- <code>key</code> (string) and <code>value</code> (object). Does not include hidden fields.
116
- ||| ,
117
- },
118
- {
119
- name: 'objectHasAll' ,
120
- params: ['o' , 'f' ],
121
- availableSince: '0.10.0' ,
122
- description: |||
123
- As <code>std.objectHas</code> but also includes hidden fields.
124
- ||| ,
125
- },
126
- {
127
- name: 'objectFieldsAll' ,
128
- params: ['o' ],
129
- availableSince: '0.10.0' ,
130
- description: |||
131
- As <code>std.objectFields</code> but also includes hidden fields.
132
- ||| ,
133
- },
134
- {
135
- name: 'objectValuesAll' ,
136
- params: ['o' ],
137
- availableSince: '0.17.0' ,
138
- description: |||
139
- As <code>std.objectValues</code> but also includes hidden fields.
140
- ||| ,
141
- },
142
- {
143
- name: 'objectKeysValuesAll' ,
144
- params: ['o' ],
145
- availableSince: '0.20.0' ,
146
- description: |||
147
- As <code>std.objectKeysValues</code> but also includes hidden fields.
148
- ||| ,
149
- },
150
73
{
151
74
name: 'prune' ,
152
75
params: ['a' ],
@@ -157,16 +80,6 @@ local html = import 'html.libsonnet';
157
80
The argument <code>a</code> may have any type.
158
81
||| ,
159
82
},
160
- {
161
- name: 'mapWithKey' ,
162
- params: ['func' , 'obj' ],
163
- availableSince: '0.10.0' ,
164
- description: |||
165
- Apply the given function to all fields of the given object, also passing
166
- the field name. The function <code>func</code> is expected to take the
167
- field name as the first parameter and the field value as the second.
168
- ||| ,
169
- },
170
83
],
171
84
},
172
85
{
@@ -1515,6 +1428,107 @@ local html = import 'html.libsonnet';
1515
1428
},
1516
1429
],
1517
1430
},
1431
+ {
1432
+ name: 'Objects',
1433
+ id: 'objects',
1434
+ fields: [
1435
+ {
1436
+ name: 'get',
1437
+ params: ['o', 'f', 'default=null', 'inc_hidden=true'],
1438
+ availableSince: '0.18.0',
1439
+ description: |||
1440
+ Returns the object's field if it exists or default value otherwise.
1441
+ <code>inc_hidden</code> controls whether to include hidden fields.
1442
+ |||,
1443
+ },
1444
+ {
1445
+ name: 'objectHas',
1446
+ params: ['o', 'f'],
1447
+ availableSince: '0.10.0',
1448
+ description: |||
1449
+ Returns <code>true</code> if the given object has the field (given as a string), otherwise
1450
+ <code>false</code>. Raises an error if the arguments are not object and string
1451
+ respectively. Returns false if the field is hidden.
1452
+ |||,
1453
+ },
1454
+ {
1455
+ name: 'objectFields',
1456
+ params: ['o'],
1457
+ availableSince: '0.10.0',
1458
+ description: |||
1459
+ Returns an array of strings, each element being a field from the given object. Does not include
1460
+ hidden fields.
1461
+ |||,
1462
+ },
1463
+ {
1464
+ name: 'objectValues',
1465
+ params: ['o'],
1466
+ availableSince: '0.17.0',
1467
+ description: |||
1468
+ Returns an array of the values in the given object. Does not include hidden fields.
1469
+ |||,
1470
+ },
1471
+ {
1472
+ name: 'objectKeysValues',
1473
+ params: ['o'],
1474
+ availableSince: '0.20.0',
1475
+ description: |||
1476
+ Returns an array of objects from the given object, each object having two fields:
1477
+ <code>key</code> (string) and <code>value</code> (object). Does not include hidden fields.
1478
+ |||,
1479
+ },
1480
+ {
1481
+ name: 'objectHasAll',
1482
+ params: ['o', 'f'],
1483
+ availableSince: '0.10.0',
1484
+ description: |||
1485
+ As <code>std.objectHas</code> but also includes hidden fields.
1486
+ |||,
1487
+ },
1488
+ {
1489
+ name: 'objectFieldsAll',
1490
+ params: ['o'],
1491
+ availableSince: '0.10.0',
1492
+ description: |||
1493
+ As <code>std.objectFields</code> but also includes hidden fields.
1494
+ |||,
1495
+ },
1496
+ {
1497
+ name: 'objectValuesAll',
1498
+ params: ['o'],
1499
+ availableSince: '0.17.0',
1500
+ description: |||
1501
+ As <code>std.objectValues</code> but also includes hidden fields.
1502
+ |||,
1503
+ },
1504
+ {
1505
+ name: 'objectKeysValuesAll',
1506
+ params: ['o'],
1507
+ availableSince: '0.20.0',
1508
+ description: |||
1509
+ As <code>std.objectKeysValues</code> but also includes hidden fields.
1510
+ |||,
1511
+ },
1512
+ {
1513
+ name: 'objectRemoveKey',
1514
+ params: ['obj', 'key'],
1515
+ availableSince: 'upcoming',
1516
+ description: |||
1517
+ Returns a new object after removing the given key from object.
1518
+ |||,
1519
+ },
1520
+ {
1521
+ name: 'mapWithKey',
1522
+ params: ['func', 'obj'],
1523
+ availableSince: '0.10.0',
1524
+ description: |||
1525
+ Apply the given function to all fields of the given object, also passing
1526
+ the field name. The function <code>func</code> is expected to take the
1527
+ field name as the first parameter and the field value as the second.
1528
+ |||,
1529
+ },
1530
+ ],
1531
+ },
1518
1532
{
1519
1533
name: 'Encoding',
1520
1534
id: 'encoding',
0 commit comments