bitcore/test/adapter.js

21 lines
431 B
JavaScript
Raw Normal View History

2014-02-04 10:26:58 -08:00
'use strict';
if (typeof require === 'undefined') {
var that = this;
that.require = function(name) {
var split = name.split('/');
if (split.length > 0) {
name = split.pop();
}
var module = that[name];
if (!module) {
2014-02-20 13:59:41 -08:00
if (!bitcore[name])
2014-02-21 11:48:27 -08:00
throw new Error('Cannot find module "' + name + '"');
2014-02-20 13:59:41 -08:00
return bitcore[name];
2014-02-04 10:26:58 -08:00
}
return module;
};
2014-02-21 11:48:27 -08:00
this.Buffer = require('Buffer');
2014-02-20 13:59:41 -08:00
2014-02-21 11:48:27 -08:00
}