Sha256: 2a89c0c3826c967b5e0241733dedad2ecf3b3e6c4f87e4def112a0fd260d2974
Contents?: true
Size: 759 Bytes
Versions: 19
Compression:
Stored size: 759 Bytes
Contents
class TypeCache { static _instance = null; typeCache = []; constructor() { if (TypeCache._instance === null) { TypeCache._instance = this; } return TypeCache._instance; } cacheType(typRegex) { this.typeCache.push(typRegex); } isTypeCacheEmpty() { return this.typeCache.length === 0; } isTypeAllowed(typeToCheck) { for (let pattern of this.typeCache) { if (new RegExp(pattern).test(typeToCheck.name)) { return true; } } return false; } getCachedTypes() { return this.typeCache; } clearCache() { this.typeCache = []; return 0; } } module.exports = TypeCache;
Version data entries
19 entries across 14 versions & 1 rubygems