ccusage 15.9.2 → 15.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -106,11 +106,11 @@ Full documentation is available at **[ccusage.com](https://ccusage.com/)**
106
106
 
107
107
  ### Featured Sponsor
108
108
 
109
- Check out these [47 Claude Code ProTips from Greg Baugues.](https://www.youtube.com/watch?v=TiNpzxoBPz0&lc=UgyVgQyOhfJJlheVMcB4AaABAg)
109
+ Check out [ccusage: The Claude Code cost scorecard that went viral](https://www.youtube.com/watch?v=Ak6qpQ5qdgk)
110
110
 
111
111
  <p align="center">
112
- <a href="https://www.youtube.com/watch?v=TiNpzxoBPz0&lc=UgyVgQyOhfJJlheVMcB4AaABAg">
113
- <img src="https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/public/claude_code_protips_thumbnail_v1.png" alt="47 Claude Code ProTips from Greg Baugues" width="600">
112
+ <a href="https://www.youtube.com/watch?v=Ak6qpQ5qdgk">
113
+ <img src="https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/public/ccusage_thumbnail.png" alt="ccusage: The Claude Code cost scorecard that went viral" width="600">
114
114
  </a>
115
115
  </p>
116
116
 
@@ -1,12 +1,5 @@
1
- /**
2
- * Calculates the total number of tokens across all token types
3
- * Supports both raw usage data format and aggregated data format
4
- * @param tokenCounts - Object containing counts for each token type
5
- * @returns Total number of tokens
6
- */
7
1
  function getTotalTokens(tokenCounts) {
8
- const cacheCreation = "cacheCreationInputTokens" in tokenCounts ? tokenCounts.cacheCreationInputTokens : tokenCounts.cacheCreationTokens;
9
- const cacheRead = "cacheReadInputTokens" in tokenCounts ? tokenCounts.cacheReadInputTokens : tokenCounts.cacheReadTokens;
2
+ const cacheCreation = "cacheCreationInputTokens" in tokenCounts ? tokenCounts.cacheCreationInputTokens : tokenCounts.cacheCreationTokens, cacheRead = "cacheReadInputTokens" in tokenCounts ? tokenCounts.cacheReadInputTokens : tokenCounts.cacheReadTokens;
10
3
  return tokenCounts.inputTokens + tokenCounts.outputTokens + cacheCreation + cacheRead;
11
4
  }
12
5
  export { getTotalTokens };