()
| 7 | * deleting the oldest entry |
| 8 | */ |
| 9 | export function createCache() { |
| 10 | var keys = []; |
| 11 | |
| 12 | function cache( key, value ) { |
| 13 | |
| 14 | // Use (key + " ") to avoid collision with native prototype properties |
| 15 | // (see https://github.com/jquery/sizzle/issues/157) |
| 16 | if ( keys.push( key + " " ) > jQuery.expr.cacheLength ) { |
| 17 | |
| 18 | // Only keep the most recent entries |
| 19 | delete cache[ keys.shift() ]; |
| 20 | } |
| 21 | return ( cache[ key + " " ] = value ); |
| 22 | } |
| 23 | return cache; |
| 24 | } |
no outgoing calls
no test coverage detected