11// deno-lint-ignore-file require-await
2- import { validateArgs } from "../validate/validate-args.js" ;
32
43export class CssGridModule {
54 static name = Object . freeze ( "css_grid" ) ;
@@ -13,11 +12,6 @@ export class CssGridModule {
1312 * @returns {Promise<void> }
1413 */
1514 static async from ( args ) {
16- validateArgs ( args , {
17- "columns" : { type : "string" , default : "1fr" } ,
18- "rows" : { type : "string" , default : "1fr" } ,
19- } , "CssGridModule.from: " ) ;
20-
2115 return {
2216 columns : args . columns . split ( " " ) ,
2317 rows : args . rows . split ( " " ) ,
@@ -34,10 +28,6 @@ export class CssGridModule {
3428 * @returns {Promise<{columns: string, rows: string}> }
3529 */
3630 static async to ( args ) {
37- validateArgs ( args , {
38- "data" : { type : "object" , required : true } ,
39- } , "CssGridModule.to: " ) ;
40-
4131 return {
4232 columns : args . data . columns . join ( " " ) ,
4333 rows : args . data . rows . join ( " " ) ,
@@ -57,12 +47,6 @@ export class CssGridModule {
5747 * @returns {Promise<void> }
5848 */
5949 static async apply ( args ) {
60- validateArgs ( args , {
61- "data" : { type : "object" , required : true } ,
62- "element" : { type : "HTMLElement" , required : true } ,
63- } , "CssGridModule.to: " ) ;
64-
65-
6650 const { data, element} = args ;
6751 const css = await CssGridModule . to ( { data } ) ;
6852
@@ -87,11 +71,6 @@ export class CssGridModule {
8771 static async create ( args ) {
8872 args = args ?? { } ;
8973
90- validateArgs ( args , {
91- columnCount : { type : "number" , default : 1 } ,
92- rowCount : { type : "number" , default : 1 } ,
93- } , "CssGridModule.create: " ) ;
94-
9574 const columns = new Array ( args . columnCount ) . fill ( "1fr" ) ;
9675 const rows = new Array ( args . rowCount ) . fill ( "1fr" ) ;
9776
@@ -111,12 +90,6 @@ export class CssGridModule {
11190 * @returns {Promise<*> }
11291 */
11392 static async push ( args ) {
114- validateArgs ( args , {
115- data : { type : "object" , required : true } ,
116- column : { type : "string" } ,
117- row : { type : "string" } ,
118- } , "CssGridModule.push: " ) ;
119-
12093 if ( args . column ) {
12194 args . data . columns . push ( args . column ) ;
12295 }
@@ -138,10 +111,6 @@ export class CssGridModule {
138111 * @returns {Promise<string> }
139112 */
140113 static async optimize ( args ) {
141- validateArgs ( args , {
142- values : { type : "string" , required : true } ,
143- } , "CssGridModule.optimize: " ) ;
144-
145114 const parts = args . values . split ( " " ) ;
146115 const optimized = [ ] ;
147116 let count = 1 ;
@@ -189,10 +158,6 @@ export class CssGridModule {
189158 * [A2][B2][C2]
190159 */
191160 static async to_regions ( args ) {
192- validateArgs ( args , {
193- "data" : { type : "object" , required : true } ,
194- } , "CssGridModule.to_regions: " ) ;
195-
196161 const result = [ ] ;
197162
198163 for ( let i = 0 ; i < args . data . rows . length ; i ++ ) {
@@ -229,12 +194,6 @@ export class CssGridModule {
229194 * @return {Promise<*> }
230195 */
231196 static async copy_region ( args ) {
232- validateArgs ( args , {
233- "regions" : { type : "Array" , required : true } ,
234- "start" : { type : "object" , required : true } ,
235- "end" : { type : "object" , required : true } ,
236- } , "CssGridModule.copyRegion: " ) ;
237-
238197 const { regions, start, end} = args ;
239198
240199 // Validate start and end points
@@ -276,12 +235,6 @@ export class CssGridModule {
276235 * @return {Promise<*> }
277236 */
278237 static async reset_region ( args ) {
279- validateArgs ( args , {
280- "regions" : { type : "Array" , required : true } ,
281- "row" : { type : "number" , required : true } ,
282- "column" : { type : "number" , required : true } ,
283- } , "CssGridModule.copyRegion: " ) ;
284-
285238 const { regions, row, column} = args ;
286239
287240 const cellCode = regions [ row ] [ column ] ;
0 commit comments