MCPcopy Index your code
hub / github.com/Blogify/Blogify / createCache

Function createCache

public/assets/assets/scripts/frontend.js:859–871  ·  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

857 * deleting the oldest entry
858 */
859function createCache() {
860 var keys = [];
861
862 function cache( key, value ) {
863 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
864 if ( keys.push( key + " " ) > Expr.cacheLength ) {
865 // Only keep the most recent entries
866 delete cache[ keys.shift() ];
867 }
868 return (cache[ key + " " ] = value);
869 }
870 return cache;
871}
872
873/**
874 * Mark a function for special use by Sizzle

Callers 1

frontend.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected