danocmx / node-tf2-item-format

Fully typed battle-tested library that helps you format TF2 items to the community standards.
MIT License
24 stars 4 forks source link

Add overload to `stringify` to accept sku string #254

Closed prenaissance closed 1 year ago

prenaissance commented 1 year ago

Proposal

Add an overload to stringify to directly get the item name from the SKU. In my opinion, this would make the api simpler and it's a common operation (at least for my use case).

Example:

const name = stringify("211;11;australium;kt-3;festive");
console.log(name); // "Strange Festivized Professional Killstreak Australium Medi Gun"

Current usage

const attributes = parseSKU("211;11;australium;kt-3;festive");
const name = stringify(attributes);

If you're happy with that, I can open a PR.

danocmx commented 1 year ago

Sounds like a good change, you can open a PR, if you are still interested.