UNPKG

@clayui/shared

Version:
20 lines (19 loc) 375 B
function getLocatorValue({ item, locator }) { let value; if (typeof item === "number" || typeof item === "string") { return item.toString(); } else if (typeof item === "object" && locator) { if (typeof locator === "function") { value = locator(item); } else { value = item[locator]; } } return value; } export { getLocatorValue };