MCPcopy Create free account
hub / github.com/aws/constructs / sanitizeId

Function sanitizeId

src/construct.ts:648–652  ·  view source on GitHub ↗

* Return a sanitized version of an arbitrary string, so it can be used as an ID

(id: string)

Source from the content-addressed store, hash-verified

646 * Return a sanitized version of an arbitrary string, so it can be used as an ID
647 */
648function sanitizeId(id: string) {
649 // Escape the separators used by `path` and by `addr` as double dashes, so a
650 // single id never looks like multiple path components in either of them.
651 return id.replace(SEP_REGEX, '--');
652}
653
654/**
655 * Options for `construct.addMetadata()`.

Callers 2

constructorMethod · 0.85
tryFindChildMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected