mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 15:41:01 +00:00
1 line
5.4 KiB
Plaintext
1 line
5.4 KiB
Plaintext
{"dependencies":[{"name":"./addPrefix.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":4,"column":23,"index":137},"end":{"line":4,"column":48,"index":162}}],"key":"sE2jfTaHMSbdJoyREwLLh+hBwFQ=","exportNames":["*"],"imports":1}},{"name":"./stripPrefix.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":25,"index":189},"end":{"line":5,"column":52,"index":216}}],"key":"5YSjnCFRtGAQvMST/r4LR6Kzmjw=","exportNames":["*"],"imports":1}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.hexFixLength = hexFixLength;\n const addPrefix_js_1 = require(_dependencyMap[0], \"./addPrefix.js\");\n const stripPrefix_js_1 = require(_dependencyMap[1], \"./stripPrefix.js\");\n /**\n * @name hexFixLength\n * @summary Shifts a hex string to a specific bitLength\n * @description\n * Returns a `0x` prefixed string with the specified number of bits contained in the return value. (If bitLength is -1, length checking is not done). Values with more bits are trimmed to the specified length. Input values with less bits are returned as-is by default. When `withPadding` is set, shorter values are padded with `0`.\n * @example\n * <BR>\n *\n * ```javascript\n * import { hexFixLength } from '@polkadot/util';\n *\n * console.log('fixed', hexFixLength('0x12', 16)); // => 0x12\n * console.log('fixed', hexFixLength('0x12', 16, true)); // => 0x0012\n * console.log('fixed', hexFixLength('0x0012', 8)); // => 0x12\n * ```\n */\n function hexFixLength(value, bitLength = -1, withPadding = false) {\n const strLength = Math.ceil(bitLength / 4);\n const hexLength = strLength + 2;\n return (0, addPrefix_js_1.hexAddPrefix)(bitLength === -1 || value.length === hexLength || !withPadding && value.length < hexLength ? (0, stripPrefix_js_1.hexStripPrefix)(value) : value.length > hexLength ? (0, stripPrefix_js_1.hexStripPrefix)(value).slice(-1 * strLength) : `${'0'.repeat(strLength)}${(0, stripPrefix_js_1.hexStripPrefix)(value)}`.slice(-1 * strLength));\n }\n});","lineCount":31,"map":[[2,2,1,0],[2,14,1,12],[4,2,2,0,"Object"],[4,8,2,6],[4,9,2,7,"defineProperty"],[4,23,2,21],[4,24,2,22,"exports"],[4,31,2,29],[4,33,2,31],[4,45,2,43],[4,47,2,45],[5,4,2,47,"value"],[5,9,2,52],[5,11,2,54],[6,2,2,59],[6,3,2,60],[6,4,2,61],[7,2,3,0,"exports"],[7,9,3,7],[7,10,3,8,"hexFixLength"],[7,22,3,20],[7,25,3,23,"hexFixLength"],[7,37,3,35],[8,2,4,0],[8,8,4,6,"addPrefix_js_1"],[8,22,4,20],[8,25,4,23,"require"],[8,32,4,30],[8,33,4,30,"_dependencyMap"],[8,47,4,30],[8,68,4,47],[8,69,4,48],[9,2,5,0],[9,8,5,6,"stripPrefix_js_1"],[9,24,5,22],[9,27,5,25,"require"],[9,34,5,32],[9,35,5,32,"_dependencyMap"],[9,49,5,32],[9,72,5,51],[9,73,5,52],[10,2,6,0],[11,0,7,0],[12,0,8,0],[13,0,9,0],[14,0,10,0],[15,0,11,0],[16,0,12,0],[17,0,13,0],[18,0,14,0],[19,0,15,0],[20,0,16,0],[21,0,17,0],[22,0,18,0],[23,0,19,0],[24,0,20,0],[25,0,21,0],[26,2,22,0],[26,11,22,9,"hexFixLength"],[26,23,22,21,"hexFixLength"],[26,24,22,22,"value"],[26,29,22,27],[26,31,22,29,"bitLength"],[26,40,22,38],[26,43,22,41],[26,44,22,42],[26,45,22,43],[26,47,22,45,"withPadding"],[26,58,22,56],[26,61,22,59],[26,66,22,64],[26,68,22,66],[27,4,23,4],[27,10,23,10,"strLength"],[27,19,23,19],[27,22,23,22,"Math"],[27,26,23,26],[27,27,23,27,"ceil"],[27,31,23,31],[27,32,23,32,"bitLength"],[27,41,23,41],[27,44,23,44],[27,45,23,45],[27,46,23,46],[28,4,24,4],[28,10,24,10,"hexLength"],[28,19,24,19],[28,22,24,22,"strLength"],[28,31,24,31],[28,34,24,34],[28,35,24,35],[29,4,25,4],[29,11,25,11],[29,12,25,12],[29,13,25,13],[29,15,25,15,"addPrefix_js_1"],[29,29,25,29],[29,30,25,30,"hexAddPrefix"],[29,42,25,42],[29,44,25,45,"bitLength"],[29,53,25,54],[29,58,25,59],[29,59,25,60],[29,60,25,61],[29,64,25,65,"value"],[29,69,25,70],[29,70,25,71,"length"],[29,76,25,77],[29,81,25,82,"hexLength"],[29,90,25,91],[29,94,25,96],[29,95,25,97,"withPadding"],[29,106,25,108],[29,110,25,112,"value"],[29,115,25,117],[29,116,25,118,"length"],[29,122,25,124],[29,125,25,127,"hexLength"],[29,134,25,137],[29,137,26,10],[29,138,26,11],[29,139,26,12],[29,141,26,14,"stripPrefix_js_1"],[29,157,26,30],[29,158,26,31,"hexStripPrefix"],[29,172,26,45],[29,174,26,47,"value"],[29,179,26,52],[29,180,26,53],[29,183,27,11,"value"],[29,188,27,16],[29,189,27,17,"length"],[29,195,27,23],[29,198,27,26,"hexLength"],[29,207,27,35],[29,210,28,14],[29,211,28,15],[29,212,28,16],[29,214,28,18,"stripPrefix_js_1"],[29,230,28,34],[29,231,28,35,"hexStripPrefix"],[29,245,28,49],[29,247,28,51,"value"],[29,252,28,56],[29,253,28,57],[29,254,28,58,"slice"],[29,259,28,63],[29,260,28,64],[29,261,28,65],[29,262,28,66],[29,265,28,69,"strLength"],[29,274,28,78],[29,275,28,79],[29,278,29,14],[29,281,29,17],[29,284,29,20],[29,285,29,21,"repeat"],[29,291,29,27],[29,292,29,28,"strLength"],[29,301,29,37],[29,302,29,38],[29,305,29,41],[29,306,29,42],[29,307,29,43],[29,309,29,45,"stripPrefix_js_1"],[29,325,29,61],[29,326,29,62,"hexStripPrefix"],[29,340,29,76],[29,342,29,78,"value"],[29,347,29,83],[29,348,29,84],[29,350,29,86],[29,351,29,87,"slice"],[29,356,29,92],[29,357,29,93],[29,358,29,94],[29,359,29,95],[29,362,29,98,"strLength"],[29,371,29,107],[29,372,29,108],[29,373,29,109],[30,2,30,0],[31,0,30,1],[31,3]],"functionMap":{"names":["<global>","hexFixLength"],"mappings":"AAA;ACqB;CDQ"},"hasCjsExports":true},"type":"js/module"}]} |