主要功能: - 修改RequirementModal支持12个订单班选择 - 添加OrderClassIconMap图标映射组件 - Store中添加selectedOrderClass状态管理 - WorkflowPage支持传递orderClass参数 - web_result添加URL参数切换功能 - 创建order-class-handler.js动态处理页面主题 技术改进: - 创建软链接关联订单班数据目录 - 生成wenlu.json和food.json数据结构 - 删除重复的web_result目录 - 添加测试页面test-order-class.html 影响范围: - 展会策划系统现支持12个订单班 - 结果展示页面自动适配不同订单班主题 - 用户可选择不同行业生成对应方案 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
3.6 KiB
quick-lru

Useful when you need to cache something and limit memory usage.
Inspired by the hashlru algorithm, but instead uses Map to support keys of any type, not just strings, and values can be undefined.
Install
$ npm install quick-lru
Usage
const QuickLRU = require('quick-lru');
const lru = new QuickLRU({maxSize: 1000});
lru.set('🦄', '🌈');
lru.has('🦄');
//=> true
lru.get('🦄');
//=> '🌈'
API
new QuickLRU(options?)
Returns a new instance.
options
Type: object
maxSize
Required
Type: number
The maximum number of items before evicting the least recently used items.
maxAge
Type: number
Default: Infinity
The maximum number of milliseconds an item should remain in cache. By default maxAge will be Infinity, which means that items will never expire.
Lazy expiration happens upon the next write or read call.
Individual expiration of an item can be specified by the set(key, value, options) method.
onEviction
Optional
Type: (key, value) => void
Called right before an item is evicted from the cache.
Useful for side effects or for items like object URLs that need explicit cleanup (revokeObjectURL).
Instance
The instance is iterable so you can use it directly in a for…of loop.
Both key and value can be of any type.
.set(key, value, options?)
Set an item. Returns the instance.
Individual expiration of an item can be specified with the maxAge option. If not specified, the global maxAge value will be used in case it is specified on the constructor, otherwise the item will never expire.
.get(key)
Get an item.
.has(key)
Check if an item exists.
.peek(key)
Get an item without marking it as recently used.
.delete(key)
Delete an item.
Returns true if the item is removed or false if the item doesn't exist.
.clear()
Delete all items.
.resize(maxSize)
Update the maxSize, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
Useful for on-the-fly tuning of cache sizes in live systems.
.keys()
Iterable for all the keys.
.values()
Iterable for all the values.
.entriesAscending()
Iterable for all entries, starting with the oldest (ascending in recency).
.entriesDescending()
Iterable for all entries, starting with the newest (descending in recency).
.size
The stored item count.
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.