@altostra/core
Version:
Core library for shared types and logic
1 lines • 556 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.endpointLabel=exports.assertEndpointLabel=exports.isEndpointLabel=void 0;const endpointLabelRX=/^[^'"\\]+$/;function isEndpointLabel(e){return"string"==typeof e&&endpointLabelRX.test(e)}function assertEndpointLabel(e){if(!isEndpointLabel(e))throw TypeError(`Invalid endpoint-label [${String(e)}]`)}function endpointLabel(e){return assertEndpointLabel(e),e}exports.isEndpointLabel=isEndpointLabel,exports.assertEndpointLabel=assertEndpointLabel,exports.endpointLabel=endpointLabel;