CSNW / sql-bricks

Transparent, Schemaless SQL Generation
http://csnw.github.io/sql-bricks
MIT License
203 stars 25 forks source link

Error while using sql-bricks clone() function #135

Closed vileoleone closed 1 year ago

vileoleone commented 1 year ago

Hello, while checking to understand a bug of our project i came across whit the following error:

err: ReferenceError: arr is not defined
    at cloneObj (..../node_modules/sql-bricks/sql-bricks.js:28:24)
    at In.clone (.../node_modules/sql-bricks/sql-bricks.js:921:71)

... } }

so i came to understand that the clone() function may have a problem :

 function cloneObj(obj) {
    if (types.isArray(obj))
      return [].concat(arr);
    else
      return extend({}, obj);

See, the arr variable is not defined. If arr is replaced by variable obj. The code works.

Could you check this issue. I am still a novice developer. So Excuse me if the problem does not lies in the function but on bad use by me

prust commented 1 year ago

@vileoleone: Thanks so much for this! I integrated your fix into the v3.0.1 release and published to npm. Thanks again!

vileoleone commented 1 year ago

You are welcome Prust. I am very happy and grateful for your attention and care.