Skip to content

Commit

Permalink
Tiny improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
VulcanShot committed May 4, 2022
1 parent 5e75ede commit 314e5f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions csQuery.nut
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if ("csQuery" in getroottable() && typeof ::csQuery == "table" )

::csQuery <- {};

IncludeScript("csQuery/QueryArray")
IncludeScript("csQuery/QueryArray");

csQuery.SELECTOR <- {
CLASS = 46, // .
Expand Down Expand Up @@ -32,15 +32,15 @@ local all = function() {

function csQuery::Find(query) : (findBy, all) {
if (typeof query == "instance")
return QueryArray([query]);
return QueryArray( query );

if (typeof query != "string" && typeof query != "integer")
throw "The parameter's data type is invalid (Valid Types: class instance, string, char)";

local _selector = query[0];
local selector = query[0];
local body = query.slice(1);

switch (_selector) {
switch (selector) {
case SELECTOR.CLASS:
return QueryArray( findBy(Entities.FindByClassname, body) );
case SELECTOR.TARGETNAME:
Expand Down

0 comments on commit 314e5f6

Please sign in to comment.