apideck-libraries / portman

Port OpenAPI Specs to Postman Collections, inject test suite and run via Newman 👨🏽‍🚀
http://getportman.com/
Apache License 2.0
632 stars 60 forks source link

Replace traverse with neotraverse #615

Closed thim81 closed 2 months ago

thim81 commented 2 months ago

Replace the bloated traverse (66 child dependencies) with Neotraverse (0 dependencies) https://npmgraph.js.org/?q=%40apideck%2Fportman#zoom=w

PuruVJ commented 2 months ago

The errors are happening because type of this.key and a few others have been updated to be string | number | symbol, which is how the library worked but the old typings never reflected that, causing false-positives many times. I would suggested adding a check const key = this.key; if(typeof key !== 'string') return;.

However if it has worked perfectly until now with traverse, it probably isn't affected by being a symbol or number. In that case, const key = this.key as string would also work. In fact I'd recommend this for existing projects than adding real runtime checks listed above