MCPcopy Create free account
hub / github.com/TruthHun/BookStack / createCache

Function createCache

static/wangEditor/js/lib/jquery-2.2.1.js:873–885  ·  view source on GitHub ↗

* Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry

()

Source from the content-addressed store, hash-verified

871 * deleting the oldest entry
872 */
873function createCache() {
874 var keys = [];
875
876 function cache( key, value ) {
877 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
878 if ( keys.push( key + " " ) > Expr.cacheLength ) {
879 // Only keep the most recent entries
880 delete cache[ keys.shift() ];
881 }
882 return (cache[ key + " " ] = value);
883 }
884 return cache;
885}
886
887/**
888 * Mark a function for special use by Sizzle

Callers 1

jquery-2.2.1.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected