Skip to content

Commit 12c9895

Browse files
Feature-44 : Added ToObject in the schemaArray class
1 parent 87f94fb commit 12c9895

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

schema/schema.psm1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,15 @@ class schemaArray {
226226
[array]ToArray() {
227227
return (ConvertFrom-SchemaArray -Array $this)
228228
}
229+
[array]ToArray([int]$Depth) {
230+
return (ConvertFrom-SchemaArray -Array $this -depth $Depth)
231+
}
232+
[object]ToObject() {
233+
return (ConvertFrom-SchemaArray -Array $this)[0]
234+
}
235+
[object]ToObject([int]$Depth) {
236+
return (ConvertFrom-SchemaArray -Array $this -depth $Depth)[0]
237+
}
229238
}
230239
class schemaDocument {
231240
[ValidateSet('object')]

0 commit comments

Comments
 (0)