File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272 return throttledEventHandler ;
273273} ;
274274
275- // parse a comma separated list of strings which may be quoted
275+ /**
276+ * parse a comma separated list of strings which may be quoted
277+ * @param {string } line
278+ * @returns
279+ */
276280Q . parse_list = function ( line ) {
281+ // handle empty string case
282+ if ( line . length === 0 ) return [ ] ;
277283 let a = [ ] ,
278284 i = 0 ,
279285 s = "" ,
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320Q . tags_input = function ( elem_arg , options ) {
315321 /** @type {HTMLInputElement } */
316322 let elem ;
317- if ( typeof elem === "string" ) {
323+ if ( typeof elem_arg === "string" ) {
318324 // @ts -ignore
319- elem = Q ( elem ) [ 0 ] ;
325+ elem = Q ( elem_arg ) [ 0 ] ;
320326 if ( ! elem ) {
321327 console . log ( "Q.tags_input: elem " + elem_arg + " not found" ) ;
322328 return ;
Original file line number Diff line number Diff line change @@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272 return throttledEventHandler ;
273273} ;
274274
275- // parse a comma separated list of strings which may be quoted
275+ /**
276+ * parse a comma separated list of strings which may be quoted
277+ * @param {string } line
278+ * @returns
279+ */
276280Q . parse_list = function ( line ) {
281+ // handle empty string case
282+ if ( line . length === 0 ) return [ ] ;
277283 let a = [ ] ,
278284 i = 0 ,
279285 s = "" ,
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320Q . tags_input = function ( elem_arg , options ) {
315321 /** @type {HTMLInputElement } */
316322 let elem ;
317- if ( typeof elem === "string" ) {
323+ if ( typeof elem_arg === "string" ) {
318324 // @ts -ignore
319- elem = Q ( elem ) [ 0 ] ;
325+ elem = Q ( elem_arg ) [ 0 ] ;
320326 if ( ! elem ) {
321327 console . log ( "Q.tags_input: elem " + elem_arg + " not found" ) ;
322328 return ;
Original file line number Diff line number Diff line change @@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272 return throttledEventHandler ;
273273} ;
274274
275- // parse a comma separated list of strings which may be quoted
275+ /**
276+ * parse a comma separated list of strings which may be quoted
277+ * @param {string } line
278+ * @returns
279+ */
276280Q . parse_list = function ( line ) {
281+ // handle empty string case
282+ if ( line . length === 0 ) return [ ] ;
277283 let a = [ ] ,
278284 i = 0 ,
279285 s = "" ,
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320Q . tags_input = function ( elem_arg , options ) {
315321 /** @type {HTMLInputElement } */
316322 let elem ;
317- if ( typeof elem === "string" ) {
323+ if ( typeof elem_arg === "string" ) {
318324 // @ts -ignore
319- elem = Q ( elem ) [ 0 ] ;
325+ elem = Q ( elem_arg ) [ 0 ] ;
320326 if ( ! elem ) {
321327 console . log ( "Q.tags_input: elem " + elem_arg + " not found" ) ;
322328 return ;
Original file line number Diff line number Diff line change @@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272 return throttledEventHandler ;
273273} ;
274274
275- // parse a comma separated list of strings which may be quoted
275+ /**
276+ * parse a comma separated list of strings which may be quoted
277+ * @param {string } line
278+ * @returns
279+ */
276280Q . parse_list = function ( line ) {
281+ // handle empty string case
282+ if ( line . length === 0 ) return [ ] ;
277283 let a = [ ] ,
278284 i = 0 ,
279285 s = "" ,
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320Q . tags_input = function ( elem_arg , options ) {
315321 /** @type {HTMLInputElement } */
316322 let elem ;
317- if ( typeof elem === "string" ) {
323+ if ( typeof elem_arg === "string" ) {
318324 // @ts -ignore
319- elem = Q ( elem ) [ 0 ] ;
325+ elem = Q ( elem_arg ) [ 0 ] ;
320326 if ( ! elem ) {
321327 console . log ( "Q.tags_input: elem " + elem_arg + " not found" ) ;
322328 return ;
Original file line number Diff line number Diff line change @@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272 return throttledEventHandler ;
273273} ;
274274
275- // parse a comma separated list of strings which may be quoted
275+ /**
276+ * parse a comma separated list of strings which may be quoted
277+ * @param {string } line
278+ * @returns
279+ */
276280Q . parse_list = function ( line ) {
281+ // handle empty string case
282+ if ( line . length === 0 ) return [ ] ;
277283 let a = [ ] ,
278284 i = 0 ,
279285 s = "" ,
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320Q . tags_input = function ( elem_arg , options ) {
315321 /** @type {HTMLInputElement } */
316322 let elem ;
317- if ( typeof elem === "string" ) {
323+ if ( typeof elem_arg === "string" ) {
318324 // @ts -ignore
319- elem = Q ( elem ) [ 0 ] ;
325+ elem = Q ( elem_arg ) [ 0 ] ;
320326 if ( ! elem ) {
321327 console . log ( "Q.tags_input: elem " + elem_arg + " not found" ) ;
322328 return ;
Original file line number Diff line number Diff line change @@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272 return throttledEventHandler ;
273273} ;
274274
275- // parse a comma separated list of strings which may be quoted
275+ /**
276+ * parse a comma separated list of strings which may be quoted
277+ * @param {string } line
278+ * @returns
279+ */
276280Q . parse_list = function ( line ) {
281+ // handle empty string case
282+ if ( line . length === 0 ) return [ ] ;
277283 let a = [ ] ,
278284 i = 0 ,
279285 s = "" ,
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320Q . tags_input = function ( elem_arg , options ) {
315321 /** @type {HTMLInputElement } */
316322 let elem ;
317- if ( typeof elem === "string" ) {
323+ if ( typeof elem_arg === "string" ) {
318324 // @ts -ignore
319- elem = Q ( elem ) [ 0 ] ;
325+ elem = Q ( elem_arg ) [ 0 ] ;
320326 if ( ! elem ) {
321327 console . log ( "Q.tags_input: elem " + elem_arg + " not found" ) ;
322328 return ;
You can’t perform that action at this time.
0 commit comments