File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,10 @@ function Doc(obj) {
7676}
7777
7878function Vars ( ...args ) {
79- args . forEach ( function ( k ) {
80- this [ k ] = new Var ( k ) ;
81- } ) ;
79+ for ( let i = 0 , j = arguments . length ; i < j ; i += 1 ) {
80+ const argumentName = args [ i ] ;
81+ this [ argumentName ] = new Var ( argumentName ) ;
82+ }
83+ }
8284
83- module . exports = { Vars, Var, Doc } ;
85+ module . exports = { Vars, Var, Doc } ;
Original file line number Diff line number Diff line change 33/// /@ts -check
44// I HAVE TO REVIEW THE Inheritance and the prototype chain
55const WOQLQuery = require ( './query/woqlBuilder' ) ;
6- const { Var, Doc } = require ( './query/woqlDoc' ) ;
6+ const { Vars , Var, Doc } = require ( './query/woqlDoc' ) ;
77/**
88 * @license Apache Version 2
99 * @module WOQL
@@ -1315,6 +1315,14 @@ WOQL.client = function (client) {
13151315 return this . _client ;
13161316} ;
13171317
1318+ /**
1319+ *
1320+ * @param {...string } varNames
1321+ * @returns object
1322+ * @example
1323+ * const v = WOQL.Vars('var01', 'var02', 'var03');
1324+ * triple(v.var01, v.var02, v.var03)
1325+ */
13181326WOQL . Vars = function ( ...varNames ) {
13191327 return new Vars ( ...varNames ) ;
13201328} ;
You can’t perform that action at this time.
0 commit comments