precis-js
Version:
A JavaScript implementation of RFC 7564 (The PRECIS Framework).
17 lines (12 loc) • 549 B
text/coffeescript
EmptyStringError = require '../error/EmptyStringError'
precis = require '../constants'
module.exports = class UsernameCaseMappedProfile
stringClass: precis.STRING_CLASS.IDENTIFIER
widthMapping: precis.WIDTH_MAPPING.NONE
caseMapping: precis.CASE_MAPPING.LOWERCASE
normalization: precis.NORMALIZATION.C
directionality: precis.DIRECTIONALITY.BIDI
prePrepareMap: (codepoints, preparer) ->
preparer.widthMapper.map codepoints
validate: (codepoints) ->
throw new EmptyStringError() if codepoints.length < 1