Sha256: 1244046233ba27f5e5464b1e7e0be865fb58dc29c4f2506630e5332d87351ef6
Contents?: true
Size: 748 Bytes
Versions: 5
Compression:
Stored size: 748 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
5 entries across 5 versions & 1 rubygems