mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-25 21:07:57 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.keyExtractPath = keyExtractPath;
|
||||
const DeriveJunction_js_1 = require("./DeriveJunction.js");
|
||||
const RE_JUNCTION = /\/(\/?)([^/]+)/g;
|
||||
/**
|
||||
* @description Extract derivation junctions from the supplied path
|
||||
*/
|
||||
function keyExtractPath(derivePath) {
|
||||
const parts = derivePath.match(RE_JUNCTION);
|
||||
const path = [];
|
||||
let constructed = '';
|
||||
if (parts) {
|
||||
constructed = parts.join('');
|
||||
for (const p of parts) {
|
||||
path.push(DeriveJunction_js_1.DeriveJunction.from(p.substring(1)));
|
||||
}
|
||||
}
|
||||
if (constructed !== derivePath) {
|
||||
throw new Error(`Re-constructed path "${constructed}" does not match input`);
|
||||
}
|
||||
return {
|
||||
parts,
|
||||
path
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user