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

Version Path
javonet-ruby-sdk-2.5.7 lib/javonet-ruby-sdk/Binaries/Nodejs/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.5.6 lib/javonet-ruby-sdk/Binaries/Nodejs/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.5.5 lib/javonet-ruby-sdk/Binaries/Nodejs/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.5.4 lib/javonet-ruby-sdk/Binaries/Nodejs/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.5.3 lib/javonet-ruby-sdk/Binaries/Nodejs/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.5.2 lib/javonet-ruby-sdk/Binaries/Nodejs/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.5.1 lib/javonet-ruby-sdk/Binaries/Nodejs/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.5.0 lib/javonet-ruby-sdk/Binaries/Nodejs/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.11 lib/javonet-ruby-sdk/Binaries/Nodejs/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.8 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.8 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.7 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.7 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.6 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/typeCache/TypeCache.js
javonet-ruby-sdk-2.4.6 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/typeCache/TypeCache.js