UNPKG

dropkiq

Version:

Liquid Expressions Simplified

1 lines 537 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=require("./constants"),CycleDetector=function(){function t(){this.registry={}}return t.prototype.register=function(t,e){if(this.registry[t]=this.registry[t]||0,this.registry[t]=this.registry[t]+1,this.registry[t]>constants_1.MAX_CYCLES_AT_MAX_DEPTH&&e>constants_1.ALLOW_CYCLES_UNTIL_DEPTH)throw new Error('Cycle detected for key "'+t+'"')},t.prototype.unregister=function(t){this.registry[t]=this.registry[t]-1},t}();exports.CycleDetector=CycleDetector;