HEX
Server: Apache
System: Linux webd004.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/f/r/e/frenchy/www/french-american.org/current/node_modules/nconf/test/mocks/mock-store.js
/*
 * mock-store.js: Mock store for ensuring certain operations are actually called.
 *
 * (C) 2011, Charlie Robbins and the Contributors.
 *
 */

var util = require('util'),
    events = require('events'),
    nconf = require('../../lib/nconf');

var Mock = nconf.Mock = function () {
  events.EventEmitter.call(this);
  this.type = 'mock';
};

// Inherit from Memory store.
util.inherits(Mock, events.EventEmitter);

//
// ### function save (value, callback)
// #### @value {Object} _Ignored_ Left here for consistency
// #### @callback {function} Continuation to respond to when complete.
// Waits `1000ms` and then calls the callback and emits the `save` event.
//
Mock.prototype.save = function (value, callback) {
  if (!callback && typeof value === 'function') {
    callback = value;
    value = null;
  }

  var self = this;

  setTimeout(function () {
    self.emit('save');
    callback();
  }, 1000);
};