UNPKG

openapi-ts-json-schema

Version:

OpenAPI to JSON schema generator with TypeScript in mind

15 lines (14 loc) 653 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.idToPlaceholder = exports.PLACEHOLDER_REGEX = exports.SCHEMA_ID_SYMBOL = void 0; exports.SCHEMA_ID_SYMBOL = Symbol('id'); const SCHEMA_ID_MARKER_START = '_OTJS-START_'; const SCHEMA_ID_MARKER_END = '_OTJS-END_'; exports.PLACEHOLDER_REGEX = new RegExp(`["']${SCHEMA_ID_MARKER_START}(?<id>.+)${SCHEMA_ID_MARKER_END}["']`, 'g'); /** * Generate a string placeholder containing the internal schema id value to be retrieved later */ function idToPlaceholder(id) { return SCHEMA_ID_MARKER_START + id + SCHEMA_ID_MARKER_END; } exports.idToPlaceholder = idToPlaceholder;