MCPcopy
hub / github.com/wooorm/starry-night / normalizeLinguistName

Function normalizeLinguistName

script/build.js:906–917  ·  view source on GitHub ↗

* @param {string} d * Name to normalize. * @returns {string} * Normalized name.

(d)

Source from the content-addressed store, hash-verified

904 * Normalized name.
905 */
906function normalizeLinguistName(d) {
907 // Names are case-insensitive, so we lowercase.
908 // For an example, see `SnipMate` which is included as an alias, but using
909 // `snipmate` or `SNIPMATE` also highlights.
910 //
911 // Spaces in names are turned into dashes.
912 // For example `DNS zone` can be used as `dns-zone`, not as `dns`, `dns_zone`,
913 // or `dnszone`.
914 const normal = d.toLowerCase().replace(/ /g, '-')
915 assert.ok(/^[-_a-z\d.#+'*()/]+$/.test(normal), normal)
916 return normal
917}
918
919/**
920 * @param {string} d

Callers 1

build.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected