mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 04:35:49 +00:00
Deprecate core
This commit is contained in:
@@ -37,31 +37,3 @@ exports._test = {
|
|||||||
exports.sjcl = require('./utils').sjcl;
|
exports.sjcl = require('./utils').sjcl;
|
||||||
exports.Wallet = require('ripple-wallet-generator')({sjcl: exports.sjcl});
|
exports.Wallet = require('ripple-wallet-generator')({sjcl: exports.sjcl});
|
||||||
exports.types = require('./serializedtypes');
|
exports.types = require('./serializedtypes');
|
||||||
|
|
||||||
// camelCase to under_scored API conversion
|
|
||||||
function attachUnderscored(name) {
|
|
||||||
const o = exports[name];
|
|
||||||
|
|
||||||
Object.keys(o.prototype).forEach(function(key) {
|
|
||||||
const UPPERCASE = /([A-Z]{1})[a-z]+/g;
|
|
||||||
|
|
||||||
if (!UPPERCASE.test(key)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const underscored = key.replace(UPPERCASE, function(c) {
|
|
||||||
return '_' + c.toLowerCase();
|
|
||||||
});
|
|
||||||
|
|
||||||
o.prototype[underscored] = o.prototype[key];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
['Remote',
|
|
||||||
'Request',
|
|
||||||
'Transaction',
|
|
||||||
'Account',
|
|
||||||
'Server'
|
|
||||||
].forEach(attachUnderscored);
|
|
||||||
|
|
||||||
// vim:sw=2:sts=2:ts=8:et
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const _ = require('lodash');
|
|
||||||
const core = require('./core');
|
const core = require('./core');
|
||||||
const RippleAPI = require('./api');
|
const RippleAPI = require('./api');
|
||||||
|
|
||||||
module.exports = _.assign({}, core, {RippleAPI: RippleAPI});
|
module.exports = {
|
||||||
|
RippleAPI,
|
||||||
|
_DEPRECATED: core // WARNING: this will be removed soon
|
||||||
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const responses = fixtures.responses;
|
|||||||
const addresses = require('./fixtures/addresses');
|
const addresses = require('./fixtures/addresses');
|
||||||
const hashes = require('./fixtures/hashes');
|
const hashes = require('./fixtures/hashes');
|
||||||
const MockPRNG = require('./mock-prng');
|
const MockPRNG = require('./mock-prng');
|
||||||
const sjcl = require('../src').sjcl;
|
const sjcl = require('../src/core').sjcl;
|
||||||
const address = addresses.ACCOUNT;
|
const address = addresses.ACCOUNT;
|
||||||
const common = require('../src/api/common');
|
const common = require('../src/api/common');
|
||||||
const validate = common.validate;
|
const validate = common.validate;
|
||||||
|
|||||||
2
test/node_modules/ripple-lib
generated
vendored
2
test/node_modules/ripple-lib
generated
vendored
@@ -1 +1 @@
|
|||||||
../../src/
|
../../src/core
|
||||||
Reference in New Issue
Block a user