@wttp/handler
Version:
WTTP handler for fetching data from WTTP sites
42 lines • 1.55 kB
JavaScript
;
/**
* wURL - Wide URL
*
* Extended URL class that supports string aliases in the port position.
* Perfect for blockchain applications, environment-specific URLs, and any
* scenario where the port position needs non-numeric identifiers.
*
* @example
* ```typescript
* import { wURL } from 'wurl';
*
* // Blockchain chain ID
* const contract = new wURL('wttp://contract.eth:11155111/api');
* console.log(contract.alias); // "11155111"
*
* // Environment alias
* const staging = new wURL('https://api.example.com:staging/users');
* console.log(staging.alias); // "staging"
* ```
*
* @packageDocumentation
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
// Export everything from the main modules
__exportStar(require("./methods"), exports);
__exportStar(require("./handler"), exports);
//# sourceMappingURL=index.js.map