Files
coopgo/node_modules/micromark/dist/util/normalize-identifier.js
sgauthier 6e64e138e2
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
planning
2024-10-14 09:15:30 +02:00

19 lines
630 B
JavaScript

'use strict'
function normalizeIdentifier(value) {
return (
value // Collapse Markdown whitespace.
.replace(/[\t\n\r ]+/g, ' ') // Trim.
.replace(/^ | $/g, '') // Some characters are considered “uppercase”, but if their lowercase
// counterpart is uppercased will result in a different uppercase
// character.
// Hence, to get that form, we perform both lower- and uppercase.
// Upper case makes sure keys will not interact with default prototypal
// methods: no object method is uppercase.
.toLowerCase()
.toUpperCase()
)
}
module.exports = normalizeIdentifier