UNPKG

tf2-item-format

Version:
24 lines 816 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isItemsTexture = isItemsTexture; exports.getTexture = getTexture; /** * Checks if texture is the one on the item. */ function isItemsTexture(description, item) { return (description.value.startsWith('\u2714 ') && (matchesName(description, item) || isCurrentItemSkin(item))); } function matchesName(description, { itemName }) { return itemName.origin.includes(description.value.replace('\u2714 ', '')); } function isCurrentItemSkin({ tags }) { return !!tags.wear; } function getTexture(description, schema) { // Only set texture when app_data present. return description.app_data ? schema.getTextureName(description.app_data.def_index) : undefined; } //# sourceMappingURL=texture.js.map