UNPKG

@melchyore/adonis-cache

Version:
22 lines (21 loc) 761 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defineReplBindings = void 0; /** * Helper to define REPL state */ function setupReplState(repl, key, value) { repl.server.context[key] = value; repl.notify(`Loaded ${key} module. You can access it using the "${repl.colors.underline(key)}" variable`); } function defineReplBindings(application, Repl) { /** * Load the cache module */ Repl.addMethod('loadCache', (repl) => { setupReplState(repl, 'Cache', application.container.resolveBinding('Adonis/Addons/Cache')); }, { description: 'Load cache provider and save reference to the "Cache" variable' }); } exports.defineReplBindings = defineReplBindings;