@polkadot/primitives
Advanced tools
Comparing version 0.17.28 to 0.18.2
{ | ||
"name": "@polkadot/primitives", | ||
"version": "0.17.28", | ||
"version": "0.18.2", | ||
"description": "Type defintions for the Polkadot network", | ||
@@ -37,3 +37,3 @@ "main": "index.js", | ||
"@babel/runtime": "^7.0.0-beta.47", | ||
"@polkadot/util": "^0.22.11" | ||
"@polkadot/util": "^0.23.1" | ||
}, | ||
@@ -40,0 +40,0 @@ "devDependencies": { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
// Copyright 2017-2018 @polkadot/primitives authors & contributors | ||
// This software may be modified and distributed under the terms | ||
// of the ISC license. See the LICENSE file for details. | ||
module.exports = { | ||
var _default = { | ||
none: 0b00000000, | ||
@@ -12,2 +16,3 @@ full: 0b00000001, | ||
validator: 0b00001000 | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -5,18 +5,23 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = roleFromId; | ||
var _keys = _interopRequireDefault(require("@babel/runtime/core-js/object/keys")); | ||
var _assert = _interopRequireDefault(require("@polkadot/util/assert")); | ||
var _undefined = _interopRequireDefault(require("@polkadot/util/is/undefined")); | ||
var _all = _interopRequireDefault(require("./all")); | ||
// Copyright 2017-2018 @polkadot/primitives authors & contributors | ||
// This software may be modified and distributed under the terms | ||
// of the ISC license. See the LICENSE file for details. | ||
const assert = require('@polkadot/util/assert'); | ||
function roleFromId(roleId) { | ||
const role = (0, _keys.default)(_all.default).find(key => _all.default[key] === roleId); | ||
(0, _assert.default)(!(0, _undefined.default)(role), `Unable to find valid role for '${roleId}'`); // $FlowFixMe undefined check done above | ||
const isUndefined = require('@polkadot/util/is/undefined'); | ||
const all = require('./all'); | ||
module.exports = function roleFromId(roleId) { | ||
const role = (0, _keys.default)(all).find(key => all[key] === roleId); | ||
assert(!isUndefined(role), `Unable to find valid role for '${roleId}'`); // $FlowFixMe undefined check done above | ||
return role; | ||
}; | ||
} |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = roleToId; | ||
var _assert = _interopRequireDefault(require("@polkadot/util/assert")); | ||
var _undefined = _interopRequireDefault(require("@polkadot/util/is/undefined")); | ||
var _all = _interopRequireDefault(require("./all")); | ||
// Copyright 2017-2018 @polkadot/primitives authors & contributors | ||
// This software may be modified and distributed under the terms | ||
// of the ISC license. See the LICENSE file for details. | ||
const assert = require('@polkadot/util/assert'); | ||
const isUndefined = require('@polkadot/util/is/undefined'); | ||
const all = require('./all'); | ||
module.exports = function roleToId(role) { | ||
const roleId = all[role]; | ||
assert(!isUndefined(roleId), `Unable to perform mapping from role '${role}'`); | ||
function roleToId(role) { | ||
const roleId = _all.default[role]; | ||
(0, _assert.default)(!(0, _undefined.default)(roleId), `Unable to perform mapping from role '${role}'`); | ||
return roleId; | ||
}; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
// Copyright 2017-2018 @polkadot/primitives authors & contributors | ||
@@ -9,6 +13,7 @@ // This software may be modified and distributed under the terms | ||
const Index = 32; | ||
module.exports = { | ||
var _default = { | ||
Balance, | ||
BlockNumber, | ||
Index | ||
}; | ||
}; | ||
exports.default = _default; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13875
66
+ Added@polkadot/util@0.23.2(transitive)
- Removed@polkadot/util@0.22.11(transitive)
Updated@polkadot/util@^0.23.1