namefully 1.0.9 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -674
- package/dist/example/index.js +2734 -0
- package/dist/lib/config.d.ts +121 -0
- package/dist/lib/config.js +189 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/constants.d.ts +4 -0
- package/dist/lib/constants.js +31 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/error.d.ts +172 -0
- package/dist/lib/error.js +210 -0
- package/dist/lib/error.js.map +1 -0
- package/dist/lib/{usecases/index.d.ts → example/example.d.ts} +0 -0
- package/dist/lib/full-name.d.ts +71 -0
- package/dist/lib/full-name.js +147 -0
- package/dist/lib/full-name.js.map +1 -0
- package/dist/lib/index.d.ts +16 -6
- package/dist/lib/index.js +29 -8
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/name.d.ts +177 -0
- package/dist/lib/name.js +322 -0
- package/dist/lib/name.js.map +1 -0
- package/dist/lib/namefully.d.ts +303 -208
- package/dist/lib/namefully.js +603 -442
- package/dist/lib/namefully.js.map +1 -1
- package/dist/lib/parser.d.ts +46 -0
- package/dist/lib/parser.js +173 -0
- package/dist/lib/parser.js.map +1 -0
- package/dist/lib/src/config.d.ts +121 -0
- package/dist/lib/src/constants.d.ts +4 -0
- package/dist/lib/src/error.d.ts +172 -0
- package/dist/lib/src/full-name.d.ts +71 -0
- package/dist/lib/src/index.d.ts +16 -6
- package/dist/lib/src/name.d.ts +177 -0
- package/dist/lib/src/namefully.d.ts +303 -208
- package/dist/lib/src/parser.d.ts +46 -0
- package/dist/lib/src/types.d.ts +127 -0
- package/dist/lib/src/utils.d.ts +63 -0
- package/dist/lib/src/validator.d.ts +66 -0
- package/dist/lib/types.d.ts +127 -0
- package/dist/lib/types.js +181 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +63 -0
- package/dist/lib/utils.js +138 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validator.d.ts +66 -0
- package/dist/lib/validator.js +332 -0
- package/dist/lib/validator.js.map +1 -0
- package/dist/umd/namefully.js +2191 -2111
- package/dist/umd/namefully.js.map +1 -1
- package/dist/umd/namefully.min.js +1 -1
- package/dist/umd/namefully.min.js.LICENSE.txt +8 -20
- package/dist/umd/namefully.min.js.map +1 -1
- package/package.json +50 -53
- package/readme.md +151 -175
- package/changelog.md +0 -114
- package/dist/lib/core/constants.d.ts +0 -26
- package/dist/lib/core/constants.js +0 -42
- package/dist/lib/core/constants.js.map +0 -1
- package/dist/lib/core/index.d.ts +0 -9
- package/dist/lib/core/index.js +0 -13
- package/dist/lib/core/index.js.map +0 -1
- package/dist/lib/core/parsers/array-name.parser.d.ts +0 -42
- package/dist/lib/core/parsers/array-name.parser.js +0 -84
- package/dist/lib/core/parsers/array-name.parser.js.map +0 -1
- package/dist/lib/core/parsers/array-string.parser.d.ts +0 -48
- package/dist/lib/core/parsers/array-string.parser.js +0 -96
- package/dist/lib/core/parsers/array-string.parser.js.map +0 -1
- package/dist/lib/core/parsers/index.d.ts +0 -11
- package/dist/lib/core/parsers/index.js +0 -11
- package/dist/lib/core/parsers/index.js.map +0 -1
- package/dist/lib/core/parsers/nama.parser.d.ts +0 -34
- package/dist/lib/core/parsers/nama.parser.js +0 -75
- package/dist/lib/core/parsers/nama.parser.js.map +0 -1
- package/dist/lib/core/parsers/parser.d.ts +0 -29
- package/dist/lib/core/parsers/parser.js +0 -3
- package/dist/lib/core/parsers/parser.js.map +0 -1
- package/dist/lib/core/parsers/string.parser.d.ts +0 -61
- package/dist/lib/core/parsers/string.parser.js +0 -63
- package/dist/lib/core/parsers/string.parser.js.map +0 -1
- package/dist/lib/core/utils/utils.d.ts +0 -14
- package/dist/lib/core/utils/utils.js +0 -67
- package/dist/lib/core/utils/utils.js.map +0 -1
- package/dist/lib/models/enums.d.ts +0 -91
- package/dist/lib/models/enums.js +0 -98
- package/dist/lib/models/enums.js.map +0 -1
- package/dist/lib/models/firstname.d.ts +0 -41
- package/dist/lib/models/firstname.js +0 -59
- package/dist/lib/models/firstname.js.map +0 -1
- package/dist/lib/models/index.d.ts +0 -12
- package/dist/lib/models/index.js +0 -15
- package/dist/lib/models/index.js.map +0 -1
- package/dist/lib/models/lastname.d.ts +0 -44
- package/dist/lib/models/lastname.js +0 -86
- package/dist/lib/models/lastname.js.map +0 -1
- package/dist/lib/models/misc.d.ts +0 -80
- package/dist/lib/models/misc.js +0 -3
- package/dist/lib/models/misc.js.map +0 -1
- package/dist/lib/models/name.d.ts +0 -48
- package/dist/lib/models/name.js +0 -72
- package/dist/lib/models/name.js.map +0 -1
- package/dist/lib/models/summary.d.ts +0 -23
- package/dist/lib/models/summary.js +0 -60
- package/dist/lib/models/summary.js.map +0 -1
- package/dist/lib/src/core/constants.d.ts +0 -26
- package/dist/lib/src/core/index.d.ts +0 -9
- package/dist/lib/src/core/parsers/array-name.parser.d.ts +0 -42
- package/dist/lib/src/core/parsers/array-string.parser.d.ts +0 -48
- package/dist/lib/src/core/parsers/index.d.ts +0 -11
- package/dist/lib/src/core/parsers/nama.parser.d.ts +0 -34
- package/dist/lib/src/core/parsers/parser.d.ts +0 -29
- package/dist/lib/src/core/parsers/string.parser.d.ts +0 -61
- package/dist/lib/src/core/utils/utils.d.ts +0 -14
- package/dist/lib/src/models/enums.d.ts +0 -91
- package/dist/lib/src/models/firstname.d.ts +0 -41
- package/dist/lib/src/models/index.d.ts +0 -12
- package/dist/lib/src/models/lastname.d.ts +0 -44
- package/dist/lib/src/models/misc.d.ts +0 -80
- package/dist/lib/src/models/name.d.ts +0 -48
- package/dist/lib/src/models/summary.d.ts +0 -23
- package/dist/lib/src/validators/array-name.validator.d.ts +0 -25
- package/dist/lib/src/validators/array-string.validator.d.ts +0 -43
- package/dist/lib/src/validators/common/validation-error.d.ts +0 -19
- package/dist/lib/src/validators/common/validation-rule.d.ts +0 -69
- package/dist/lib/src/validators/common/validation-type.d.ts +0 -24
- package/dist/lib/src/validators/firstname.validator.d.ts +0 -20
- package/dist/lib/src/validators/fullname.validator.d.ts +0 -21
- package/dist/lib/src/validators/index.d.ts +0 -21
- package/dist/lib/src/validators/lastname.validator.d.ts +0 -20
- package/dist/lib/src/validators/middlename.validator.d.ts +0 -20
- package/dist/lib/src/validators/nama.validator.d.ts +0 -21
- package/dist/lib/src/validators/namon.validator.d.ts +0 -20
- package/dist/lib/src/validators/prefix.validator.d.ts +0 -14
- package/dist/lib/src/validators/string-name.validator.d.ts +0 -20
- package/dist/lib/src/validators/suffix.validator.d.ts +0 -14
- package/dist/lib/src/validators/validator.d.ts +0 -13
- package/dist/lib/usecases/compress.usecase.d.ts +0 -8
- package/dist/lib/usecases/constants.d.ts +0 -7
- package/dist/lib/usecases/describe.usecase.d.ts +0 -12
- package/dist/lib/usecases/format.usecase.d.ts +0 -6
- package/dist/lib/usecases/namefully.usecase.d.ts +0 -14
- package/dist/lib/usecases/shorten.usecase.d.ts +0 -6
- package/dist/lib/validators/array-name.validator.d.ts +0 -25
- package/dist/lib/validators/array-name.validator.js +0 -82
- package/dist/lib/validators/array-name.validator.js.map +0 -1
- package/dist/lib/validators/array-string.validator.d.ts +0 -43
- package/dist/lib/validators/array-string.validator.js +0 -80
- package/dist/lib/validators/array-string.validator.js.map +0 -1
- package/dist/lib/validators/common/validation-error.d.ts +0 -19
- package/dist/lib/validators/common/validation-error.js +0 -26
- package/dist/lib/validators/common/validation-error.js.map +0 -1
- package/dist/lib/validators/common/validation-rule.d.ts +0 -69
- package/dist/lib/validators/common/validation-rule.js +0 -73
- package/dist/lib/validators/common/validation-rule.js.map +0 -1
- package/dist/lib/validators/common/validation-type.d.ts +0 -24
- package/dist/lib/validators/common/validation-type.js +0 -28
- package/dist/lib/validators/common/validation-type.js.map +0 -1
- package/dist/lib/validators/firstname.validator.d.ts +0 -20
- package/dist/lib/validators/firstname.validator.js +0 -29
- package/dist/lib/validators/firstname.validator.js.map +0 -1
- package/dist/lib/validators/fullname.validator.d.ts +0 -21
- package/dist/lib/validators/fullname.validator.js +0 -38
- package/dist/lib/validators/fullname.validator.js.map +0 -1
- package/dist/lib/validators/index.d.ts +0 -21
- package/dist/lib/validators/index.js +0 -35
- package/dist/lib/validators/index.js.map +0 -1
- package/dist/lib/validators/lastname.validator.d.ts +0 -20
- package/dist/lib/validators/lastname.validator.js +0 -29
- package/dist/lib/validators/lastname.validator.js.map +0 -1
- package/dist/lib/validators/middlename.validator.d.ts +0 -20
- package/dist/lib/validators/middlename.validator.js +0 -38
- package/dist/lib/validators/middlename.validator.js.map +0 -1
- package/dist/lib/validators/nama.validator.d.ts +0 -21
- package/dist/lib/validators/nama.validator.js +0 -43
- package/dist/lib/validators/nama.validator.js.map +0 -1
- package/dist/lib/validators/namon.validator.d.ts +0 -20
- package/dist/lib/validators/namon.validator.js +0 -29
- package/dist/lib/validators/namon.validator.js.map +0 -1
- package/dist/lib/validators/prefix.validator.d.ts +0 -14
- package/dist/lib/validators/prefix.validator.js +0 -31
- package/dist/lib/validators/prefix.validator.js.map +0 -1
- package/dist/lib/validators/string-name.validator.d.ts +0 -20
- package/dist/lib/validators/string-name.validator.js +0 -29
- package/dist/lib/validators/string-name.validator.js.map +0 -1
- package/dist/lib/validators/suffix.validator.d.ts +0 -14
- package/dist/lib/validators/suffix.validator.js +0 -31
- package/dist/lib/validators/suffix.validator.js.map +0 -1
- package/dist/lib/validators/validator.d.ts +0 -13
- package/dist/lib/validators/validator.js +0 -9
- package/dist/lib/validators/validator.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://namefully/webpack/universalModuleDefinition","webpack://namefully/webpack/bootstrap","webpack://namefully/./src/validators/index.ts","webpack://namefully/./src/models/index.ts","webpack://namefully/./node_modules/tslib/tslib.es6.js","webpack://namefully/./src/core/index.ts","webpack://namefully/./src/core/parsers/index.ts","webpack://namefully/./src/index.ts","webpack://namefully/./src/namefully.ts","webpack://namefully/./src/core/parsers/array-name.parser.ts","webpack://namefully/./src/models/name.ts","webpack://namefully/./src/models/firstname.ts","webpack://namefully/./src/models/lastname.ts","webpack://namefully/./src/models/enums.ts","webpack://namefully/./src/models/summary.ts","webpack://namefully/./src/validators/common/validation-rule.ts","webpack://namefully/./src/validators/common/validation-type.ts","webpack://namefully/./src/validators/common/validation-error.ts","webpack://namefully/./src/validators/namon.validator.ts","webpack://namefully/./src/validators/prefix.validator.ts","webpack://namefully/./src/validators/suffix.validator.ts","webpack://namefully/./src/validators/firstname.validator.ts","webpack://namefully/./src/validators/lastname.validator.ts","webpack://namefully/./src/validators/middlename.validator.ts","webpack://namefully/./src/validators/fullname.validator.ts","webpack://namefully/./src/validators/nama.validator.ts","webpack://namefully/./src/validators/array-name.validator.ts","webpack://namefully/./src/validators/array-string.validator.ts","webpack://namefully/./src/validators/string-name.validator.ts","webpack://namefully/./src/core/parsers/array-string.parser.ts","webpack://namefully/./src/core/parsers/nama.parser.ts","webpack://namefully/./src/core/parsers/string.parser.ts","webpack://namefully/./src/core/utils/utils.ts","webpack://namefully/./src/core/constants.ts"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","default","extendStatics","b","setPrototypeOf","__proto__","Array","__extends","__","this","constructor","__assign","assign","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","desc","getOwnPropertyDescriptor","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","iterator","v","op","TypeError","pop","push","__exportStar","__values","__read","ar","error","__spread","concat","__spreadArrays","il","k","a","j","jl","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","mod","__importDefault","__classPrivateFieldGet","receiver","privateMap","has","__classPrivateFieldSet","set","Namefully","options","configure","build","orderedBy","config","titling","ending","pxSep","Separator","PERIOD","EMPTY","sxSep","SPACE","nama","fullname","prefix","getFirstname","getMiddlenames","getLastname","join","suffix","firstname","tostring","format","lastname","middlename","map","namon","withMid","midInits","getInitials","console","warn","initials","forEach","what","summary","describe","Summary","limit","by","warning","getFullname","fn","ln","mn","hasmid","isArray","sep","firsts","lasts","mids","cname","compress","unames","lower","slice","how","formatted","tokens","Error","trim","CONFIG","parser","separator","bypass","lastnameFormat","parse","COMMA","HYPHEN","UNDERSCORE","upper","official","toUpperCase","initialize","StringParser","ArrayStringParser","Name","obj","ArrayNameParser","entry","entries","Namon","NamaParser","FullnameValidator","validate","full","px","getPrefix","sx","getSuffix","inits","stats","ArrayNameValidator","distribute","type","PREFIX","FIRST_NAME","Firstname","LAST_NAME","Lastname","father","mother","MIDDLE_NAME","SUFFIX","capitalized","initial","capitalize","option","toLowerCase","more","super","includeAll","Prefix","Suffix","restrictions","compute","count","frequency","top","unique","maxfreq","uniq","freqs","groupByChar","char","frequencies","keys","includes","ValidationRule","ValidatorType","ValidationError","message","NAMON","test","values","namonValidator","NamonValidator","FULL_NAME","PrefixValidator","SuffixValidator","NAMA","validators","FirstnameValidator","MiddlenameValidator","LastnameValidator","ARR_NAMES","indexing","ARR_STRING","pf","sf","index","organizeNameIndex","ArrayStringValidator","NamaValidator","split","argLength","nameIndex","NAME_INDEX","out","version"],"mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,YAAa,GAAIH,GACE,iBAAZC,QACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,IARtB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,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vI,SAAW,EACfuI,EAAI1I,UAAY,EAChB0I,EAAItI,WAAa,EACjB,MACJ,KAAK,EACDsI,EAAIhJ,OAAS,EACbgJ,EAAIvI,SAAW,EACfuI,EAAI1I,UAAY,EAChB0I,EAAItI,WAAa,EACjB,MACJ,KAAK,EACDsI,EAAIhJ,OAAS,EACbgJ,EAAIvI,SAAW,EACfuI,EAAI1I,UAAY,EAChB0I,EAAItI,WAAa,EACjBsI,EAAI3I,OAAS,EAIzB,OAAO2I,I,8ECpEX,aAMa,EAAAC,QAAU,QAQV,EAAAlG,OAAiB,CAC1B3D,UAAW,YACX6D,UAAW,EAAAxD,UAAUI,MACrBP,QAAS,KACTC,OAAQ,EAAAE,UAAUI,MAClBqD,QAAQ,EACRC,eAAgB,UASP,EAAA4F,WAAwB,CACjC/I,OAAQ,EACRM,UAAW,EACXI,WAAY,EACZD,SAAU,EACVJ,OAAQ","file":"namefully.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"namefully\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"namefully\"] = factory();\n\telse\n\t\troot[\"namefully\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","/**\n * Make all the locals available\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nexport * from './common/validation-rule';\nexport * from './common/validation-type';\nexport * from './common/validation-error';\n\nexport * from './validator';\nexport { default as NamonValidator } from './namon.validator';\nexport { default as PrefixValidator } from './prefix.validator';\nexport { default as SuffixValidator } from './suffix.validator';\nexport { default as FirstnameValidator } from './firstname.validator';\nexport { default as LastnameValidator } from './lastname.validator';\nexport { default as MiddlenameValidator } from './middlename.validator';\nexport { default as FullnameValidator } from './fullname.validator';\nexport { default as NamaValidator } from './nama.validator';\n\nexport {default as ArrayNameValidator } from './array-name.validator';\nexport {default as ArrayStringValidator } from './array-string.validator';\nexport {default as StringNameValidator } from './string-name.validator';\n","/**\n * Make all the locals available\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nexport * from './name';\nexport * from './firstname';\nexport * from './lastname';\nexport * from './enums';\nexport * from './summary';\nexport * from './misc';\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * Make all the locals available\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nexport * from './parsers/index';\nexport * from './utils/utils';\nexport * from './constants';\n","/**\n * Export the local parsers\n *\n * Created on March 03, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nexport * from './parser';\nexport { default as ArrayNameParser } from './array-name.parser';\nexport { default as ArrayStringParser } from './array-string.parser';\nexport { default as NamaParser } from './nama.parser';\nexport { default as StringParser } from './string.parser';\n","/**\n * Main entry to `Namefully`\n *\n * Created on March 03, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nexport * from './namefully';\nexport * from './core';\nexport * from './models';\nexport * from './validators';\n","/**\n * `Namefully` person name handler\n *\n * Created on March 03, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n *\n * @license GPL-3.0\n * @see {@link https://github.com/ralflorent/namefully|namefully} for more info.\n */\nimport { Parser, NamaParser, StringParser, ArrayNameParser, ArrayStringParser, CONFIG } from './core/index';\nimport { Fullname, Name, Nama, Namon, Separator, Summary, Config, NameOrder, AbbrTitle, LastnameFormat } from './models/index';\nimport { FullnameValidator } from './validators/index';\n\n/**\n * Person name handler\n * @class\n * @classdesc\n * `Namefully` does not magically guess which part of the name is what. It relies\n * actually on how the developer indicates the roles of the name parts so that\n * it, internally, can perform certain operations and saves the developer some\n * calculations/processings. Nevertheless, Namefully can be constructed using\n * distinct raw data shape. This is intended to give some flexibility to the\n * developer so that he or she is not bound to a particular data format. Please,\n * do follow closely the APIs to know how to properly use it in order to avoid\n * some errors (mainly validation's).\n *\n * `Namefully` also works like a trap door. Once a raw data is provided and\n * validated, a developer can only ACCESS in a vast amount of, yet effective ways\n * the name info. NO EDITING is possible. If the name is mistaken, a new instance\n * of `Namefully` must be created. Remember, this utility's primary objective is\n * to help to **handle** a person name.\n *\n * Note that the name standards used for the current version of this library are\n * as follows:\n * [Prefix] Firstname [Middlename] Lastname [Suffix]\n * The opening `[` and closing `]` brackets mean that these parts are optional.\n * In other words, the most basic and typical case is a name that looks like this:\n * `John Smith`, where `John` is the first name and `Smith`, the last name.\n * @see https://departments.weber.edu/qsupport&training/Data_Standards/Name.htm\n * for more info on name standards.\n *\n * **IMPORTANT**: Keep in mind that the order of appearance matters and can be\n * altered through configured parameters, which we will be seeing later on. By\n * default, the order of appearance is as shown above and will be used as a basis\n * for future examples and use cases.\n *\n * Once imported, all that is required to do is to create an instance of\n * `Namefully` and the rest will follow.\n *\n * Some terminologies used across the library are:\n * - namon: piece of a name (e.g., firstname)\n * - nama: pieces of a name (e.g., firstname + lastname)\n *\n * Happy naming!\n */\nexport class Namefully {\n /**\n * Holds a json-like high quality of data\n * @see {Fullname} description for more details\n */\n private fullname: Fullname;\n /**\n * Holds statistical info on the name\n * @see {Summary} class description for more details\n */\n private summary: Summary;\n /**\n * Holds a json-like copy of the preset configuration\n * @see {Config} description for more details\n */\n private config: Config;\n\n /**\n * Constructs an instance of the utility and helps to benefit from many helpers\n * @param {string | string[] | Array<Name> | Nama} raw element to parse or\n * construct the pieces of the name\n * @param {Config} options to configure how to run the utility\n */\n constructor(\n raw: string | Array<string> | Array<Name> | Nama,\n options?: Partial<{\n orderedBy: NameOrder, // indicate order of appearance\n separator: Separator, // how to split string names\n titling: AbbrTitle, // whether to add a period to a prefix\n ending: Separator, // for ending suffix\n bypass: boolean, // a bypass for validators\n parser: Parser<any> // (user-defined) custom parser\n lastnameFormat: LastnameFormat // how to format a surname\n }>\n ) {\n // well, first thing first\n this.configure(options);\n\n // let's try to parse this, baby!\n this.build(raw);\n }\n\n /**\n * Gets the full name ordered as configured\n * @param {'firstname'|'lastname'} orderedBy force to order by first or last\n * name by overriding the preset configuration\n * @returns {string} the suffix\n *\n * @see {format} to alter manually the order of appearance of the full name.\n * For example, ::format('l f m') outputs `lastname firstname middlename`.\n */\n getFullname(orderedBy?: NameOrder): string {\n orderedBy = orderedBy || this.config.orderedBy; // override config\n const { titling, ending } = this.config;\n const pxSep = titling === 'us' ? Separator.PERIOD : Separator.EMPTY; // Mr[.]\n const sxSep = ending !== Separator.SPACE ? ending : Separator.EMPTY; // [,] PhD\n const nama: string[] = [];\n\n if (this.fullname.prefix)\n nama.push(Separator.EMPTY.concat(this.fullname.prefix, pxSep))\n\n switch (orderedBy) {\n case 'firstname':\n nama.push(this.getFirstname());\n nama.push(...this.getMiddlenames());\n nama.push(Separator.EMPTY.concat(this.getLastname(), sxSep));\n break;\n case 'lastname':\n nama.push(this.getLastname());\n nama.push(this.getFirstname());\n nama.push(this.getMiddlenames().join(Separator.SPACE).concat(sxSep));\n break;\n }\n\n if (this.fullname.suffix)\n nama.push(this.fullname.suffix);\n\n return nama.join(Separator.SPACE);\n }\n\n /**\n * Gets the first name part of the full name\n * @returns {string} the first name\n */\n getFirstname(): string {\n return this.fullname.firstname.tostring();\n }\n\n /**\n * Gets the last name part of the full name\n * @param {LastnameFormat} [format] overrides the how-to format of a surname\n * output, considering its subparts.\n * @returns {string} the last name\n */\n getLastname(format?: LastnameFormat): string {\n return this.fullname.lastname.tostring(format);\n }\n\n /**\n * Gets the middle names part of the full name\n * @returns {Array<string>} the middle names\n */\n getMiddlenames(): string[] {\n return this.fullname.middlename ? this.fullname.middlename.map(n => n.namon) : [];\n }\n\n /**\n * Gets the prefix part of the full name\n * @returns {string} the prefix\n */\n getPrefix(): string {\n const pxSep = this.config.titling === 'us' ? Separator.PERIOD : Separator.EMPTY;\n return this.fullname.prefix ?\n Separator.EMPTY.concat(this.fullname.prefix, pxSep) :\n Separator.EMPTY;\n }\n\n /**\n * Gets the suffix part of the full name\n * @returns {string} the suffix\n */\n getSuffix(): string {\n return this.fullname.suffix || Separator.EMPTY;\n }\n\n /**\n * Gets the initials of the full name\n * @param {'firstname'|'lastname'} orderedBy force to order by first or last\n * name by overriding the preset configuration\n * @param {boolean} [withMid] whether to include middle names's\n * @returns {Array<string>} the initials\n *\n * @example\n * Given the names:\n * - `John Smith` => ['J', 'S']\n * - `John Ben Smith` => ['J', 'S']\n * when `withMid` is set to true:\n * - `John Ben Smith` => ['J', 'B', 'S']\n *\n * **NOTE**:\n * Ordered by last name obeys the following format:\n * `lastname firstname [middlename]`\n * which means that if no middle name was set, setting `withMid` to true\n * will output nothing and warn the end user about it.\n */\n getInitials(\n orderedBy?: NameOrder,\n withMid: boolean = false\n ): string[] {\n orderedBy = orderedBy || this.config.orderedBy; // override config\n const midInits = this.fullname.middlename ?\n this.fullname.middlename.map(n => n.getInitials()) : [];\n\n if (withMid && !this.fullname.middlename) {\n console.warn('No initials for middle names since none was set.');\n }\n\n const initials = [];\n switch(orderedBy) {\n case 'firstname':\n initials.push(...this.fullname.firstname.getInitials());\n if (withMid) midInits.forEach(m => initials.push(...m));\n initials.push(...this.fullname.lastname.getInitials());\n break;\n case 'lastname':\n initials.push(...this.fullname.lastname.getInitials());\n initials.push(...this.fullname.firstname.getInitials());\n if (withMid) midInits.forEach(m => initials.push(...m));\n break;\n }\n\n return initials;\n }\n\n /**\n * Gives some descriptive statistics that summarize the central tendency,\n * dispersion and shape of the characters' distribution.\n * @param what which variant to use when describe a name part\n * @returns {string} the stats behind the full name.\n *\n * Treated as a categorical dataset, the summary contains the following info:\n * `count` : the number of *unrestricted* characters of the name;\n * `frequency` : the highest frequency within the characters;\n * `top` : the character with the highest frequency;\n * `unique` : the count of unique characters of the name.\n *\n * @example\n * Given the name \"Thomas Alva Edison\", the summary will output as follows:\n *\n * Descriptive statistics for \"Thomas Alva Edison\"\n * count : 16\n * frequency: 3\n * top : A\n * unique : 12\n *\n * **NOTE:**\n * During the setup, a set of restricted characters can be defined to be removed\n * from the stats. By default, the only restricted character is the `space`.\n * That is why the `count` for the example below result in `16` instead of\n * `16`.\n * Another thing to consider is that the summary is case *insensitive*. Note\n * that the letter `a` has the top frequency, be it `3`.\n */\n describe(what: 'fullname' | 'firstname' | 'lastname' | 'middlename' = 'fullname'): Summary {\n switch(what) {\n case 'fullname':\n return this.summary;\n case 'firstname':\n return this.fullname.firstname.describe();\n case 'lastname':\n return this.fullname.lastname.describe();\n case 'middlename':\n return !this.fullname.middlename ? null :\n new Summary(this.fullname.middlename.map(n => n.namon).join(Separator.SPACE))\n }\n }\n\n /**\n * Shortens a complex full name to a simple typical name, a combination of\n * first name and last name.\n * @param {'firstname'|'lastname'} orderedBy force to order by first or last\n * name by overriding the preset configuration\n * @returns {string} a typical name\n *\n * @example\n * For a given name such as `Mr Keanu Charles Reeves`, shortening this name\n * is equivalent to making it `Keanu Reeves`.\n */\n shorten(orderedBy?: 'firstname' | 'lastname'): string {\n orderedBy = orderedBy || this.config.orderedBy; // override config\n return orderedBy === 'firstname' ?\n [\n this.fullname.firstname.namon,\n this.fullname.lastname.namon,\n ].join(Separator.SPACE) :\n [\n this.fullname.lastname.namon,\n this.fullname.firstname.namon,\n ].join(Separator.SPACE);\n }\n\n /**\n * Compresses a name by using different forms of variants\n * @param {number} [limit] a threshold to limit the number of characters\n * @param {'firstname'|'lastname'|'middlename'|'firstmid'|'midlast'} [by]\n * a variant to use when compressing the long name. The last two variants\n * represent respectively the combination of `firstname + middlename` and\n * `middlename + lastname`.\n * @param {boolean} [warning] should warn when the set limit is violated\n *\n * @example\n * The compressing operation is only executed iff there is valid entry and it\n * surpasses the limit set. In the examples below, let us assume that the\n * name goes beyond the limit value.\n *\n * Compressing a long name refers to reducing the name to the following forms:\n * 1. by firstname: 'John Moe Beau Lennon' => 'J. Moe Beau Lennon'\n * 2. by middlename: 'John Moe Beau Lennon' => 'John M. B. Lennon'\n * 3. by lastname: 'John Moe Beau Lennon' => 'John Moe Beau L.'\n * 4. by firstmid: 'John Moe Beau Lennon' => 'J. M. B. Lennon'\n * 5. by midlast: 'John Moe Beau Lennon' => 'John M. B. L.'\n *\n * By default, it compresses by 'firstmid' variant: 'J. M. B. Lennon'.\n */\n compress(\n limit: number = 20,\n by: 'firstname' | 'lastname' | 'middlename' | 'firstmid' | 'midlast' = 'middlename',\n warning: boolean = true\n ): string {\n\n if (this.getFullname().length <= limit) // no need to compress\n return this.getFullname();\n\n const { firstname: fn, lastname: ln, middlename } = this.fullname;\n const mn = this.getMiddlenames().join(Separator.SPACE);\n const hasmid: boolean = Array.isArray(middlename) && middlename.length > 0;\n const sep = this.config.titling === 'us' ? Separator.PERIOD : Separator.EMPTY;\n\n const firsts = fn.getInitials().join(sep).concat(sep);\n const lasts = ln.getInitials().join(sep).concat(sep);\n const mids = hasmid ? middlename.map(n => n.getInitials()).join(sep).concat(sep) : Separator.EMPTY;\n let cname = '';\n\n if (this.config.orderedBy === 'firstname') {\n switch (by) {\n case 'firstname':\n cname = hasmid ?\n [firsts, mn, ln.tostring()].join(Separator.SPACE) :\n [firsts, ln.tostring()].join(Separator.SPACE);\n break;\n case 'lastname':\n cname = hasmid ?\n [fn.tostring(), mn, lasts].join(Separator.SPACE) :\n [fn.tostring(), lasts].join(Separator.SPACE);\n break;\n case 'middlename':\n cname = hasmid ?\n [fn.tostring(), mids, ln.tostring()].join(Separator.SPACE) :\n [fn.tostring(), ln.tostring()].join(Separator.SPACE);\n break;\n case 'firstmid':\n cname = hasmid ?\n [firsts, mids, ln.tostring()].join(Separator.SPACE) :\n [firsts, ln.tostring()].join(Separator.SPACE);\n break;\n case 'midlast':\n cname = hasmid ?\n [fn.tostring(), mids, lasts].join(Separator.SPACE) :\n [fn.tostring(), lasts].join(Separator.SPACE);\n break;\n }\n }\n else {\n switch (by) {\n case 'firstname':\n cname = hasmid ?\n [ln.tostring(), firsts, mn].join(Separator.SPACE) :\n [ln.tostring(), firsts].join(Separator.SPACE);\n break;\n case 'lastname':\n cname = hasmid ?\n [lasts, fn.tostring(), mn].join(Separator.SPACE) :\n [lasts, fn.tostring()].join(Separator.SPACE);\n break;\n case 'middlename':\n cname = hasmid ?\n [ln.tostring(), fn.tostring(), mids].join(Separator.SPACE) :\n [ln.tostring(), fn.tostring()].join(Separator.SPACE);\n break;\n case 'firstmid':\n cname = hasmid ?\n [ln.tostring(), firsts, mids].join(Separator.SPACE) :\n [ln.tostring(), firsts].join(Separator.SPACE);\n break;\n case 'midlast':\n cname = hasmid ?\n [lasts, fn.tostring(), mids].join(Separator.SPACE) :\n [lasts, fn.tostring()].join(Separator.SPACE);\n break;\n }\n }\n\n if (warning && cname.length > limit)\n console.warn(`The compressed name <${cname}> still surpasses the set limit ${limit}`);\n\n return cname;\n }\n\n /**\n * Zips or compresses a name by using different forms of variants\n * @param by a variant to use when compressing the long name. The last two\n * variants represent respectively the combination of `firstname + middlename`\n * and `middlename + lastname`.\n */\n zip(\n by: 'fn' | 'ln'| 'mn' | 'fm' | 'ml' |\n 'firstname' | 'lastname' | 'middlename' | 'firstmid' | 'midlast' = 'mn'\n ): string {\n let v: 'firstname' | 'lastname' | 'middlename' | 'firstmid' | 'midlast';\n if (by === 'fn' || by === 'firstname') v = 'firstname';\n if (by === 'mn' || by === 'middlename') v = 'middlename';\n if (by === 'ln' || by === 'lastname') v = 'lastname';\n if (by === 'fm' || by === 'firstmid') v = 'firstmid';\n if (by === 'ml' || by === 'midlast') v = 'midlast';\n return this.compress(0, v , false);\n }\n\n /**\n * Suggests possible (randomly) usernames closest to the name\n * @returns {Array<string>} a set of usernames\n *\n * **NOTE**\n * The validity of these usernames are not checked against any social media\n * or web app online.\n */\n username(): string[] {\n const unames: Array<string> = [];\n const { firstname: f, lastname: l } = this.fullname;\n const p = Separator.PERIOD;\n\n // Given `John Smith`\n unames.push(f.lower() + l.lower()); // johnsmith\n unames.push(l.lower() + f.lower()); // smithjohn\n unames.push(f.lower()[0] + l.lower()); // jsmith\n unames.push(l.lower()[0] + f.lower()); // sjohn\n unames.push(f.lower()[0] + p + l.lower()); // j.smith\n unames.push(l.lower()[0] + p + f.lower()); // s.john\n unames.push(f.lower().slice(0, 2) + l.lower()); // josmith\n unames.push(l.lower().slice(0, 2) + f.lower()); // smjohn\n unames.push(f.lower().slice(0, 2) + p + l.lower()); // jo.smith\n unames.push(l.lower().slice(0, 2) + p + f.lower()); // sm.john\n\n return unames;\n }\n\n /**\n * Formats the name as desired\n * @param {string} how to format the full name\n * @returns {string} the formatted name as specified\n *\n * How to format it?\n * 'f': first name\n * 'F': capitalized first name\n * 'l': last name (official)\n * 'L': capitalized last name\n * 'm': middle names\n * 'M': Capitalized middle names\n * 'O': official document format\n *\n * @example\n * Given the name `Joe Jim Smith`, call the `format` with the how string.\n * - format('l f') => 'Smith Joe'\n * - format('L, f') => 'SMITH, Joe'\n * - format('fml') => 'JoeJimSmith'\n * - format('FML') => 'JOEJIMSMITH'\n * - format('L, f m') => 'SMITH, Joe Jim'\n * - format('O') => 'SMITH, Joe Jim'\n */\n format(how?: string): string {\n if (!how)\n return this.getFullname();\n\n const formatted: Array<string> = [];\n const tokens = [\n '.', ',', ' ', '-', '_', 'f', 'F', 'l', 'L', 'm', 'M',\n 'n', 'N', 'o', 'O', 'p', 'P', 's', 'S'\n ];\n for (const c of how) {\n if (tokens.indexOf(c) === -1)\n throw new Error(`<${c}> is an invalid character for the formatting.`)\n formatted.push(this.map(c));\n }\n return formatted.join(Separator.EMPTY).trim();\n }\n\n /**\n * Configures how the setup will be working\n * @param {Config} options for a customized setup\n */\n private configure(options?: Partial<Config>): void {\n // consider using deepmerge if objects no longer stay shallow\n this.config = { ...CONFIG, ...options }; // if options, it overrides CONFIG\n }\n\n /**\n * Defines the full name by having the pieces (namon) of the names ready\n * @param parser customized or user-defined parser to get the full name\n */\n private initialize<T>(parser: Parser<T>): void {\n const { orderedBy, separator, bypass, lastnameFormat } = this.config;\n this.fullname = parser.parse({ orderedBy, separator, bypass, lastnameFormat });\n }\n\n /**\n * Maps a character to a specific piece of the name\n * @param c character to be mapped\n * @return {string} piece of name\n */\n private map(c: string): string {\n switch(c) {\n case '.':\n return Separator.PERIOD;\n case ',':\n return Separator.COMMA;\n case ' ':\n return Separator.SPACE;\n case '-':\n return Separator.HYPHEN;\n case '_':\n return Separator.UNDERSCORE;\n case 'f':\n return this.fullname.firstname.namon;\n case 'F':\n return this.fullname.firstname.upper();\n case 'l':\n return this.fullname.lastname.namon;\n case 'L':\n return this.fullname.lastname.upper();\n case 'm':\n return this.fullname.middlename\n .map(n => n.namon).join(Separator.SPACE);\n case 'M':\n return this.fullname.middlename\n .map(n => n.upper()).join(Separator.SPACE);\n case 'o': case 'O':\n const { titling, ending } = this.config;\n const pxSep = titling === 'us' ? Separator.PERIOD : Separator.EMPTY;\n const sxSep = ending !== Separator.SPACE ? ending : Separator.EMPTY;\n\n const official = [\n this.fullname.prefix ? Separator.EMPTY.concat(this.fullname.prefix, pxSep) : Separator.EMPTY,\n this.fullname.lastname.upper().concat(Separator.COMMA),\n this.fullname.firstname.tostring(),\n this.fullname.middlename.map(n => n.namon).join(Separator.SPACE).concat(sxSep),\n this.fullname.suffix || Separator.EMPTY,\n ].join(Separator.SPACE).trim();\n\n return c === 'o' ? official : official.toUpperCase();\n case 'p':\n return this.fullname.prefix || Separator.EMPTY;\n case 'P':\n return this.fullname.prefix ? this.fullname.prefix.toUpperCase() : Separator.EMPTY;\n case 's':\n return this.fullname.suffix || Separator.EMPTY;\n case 'S':\n return this.fullname.suffix ? this.fullname.suffix.toUpperCase() : Separator.EMPTY;\n default:\n return Separator.EMPTY;\n }\n }\n\n /**\n * Builds a high qualitty of data using parsers and validators\n * @param {string | string[] | Array<Name> | Nama} raw data to parse or\n * construct the pieces of the name\n */\n private build(raw: string | string[] | Array<Name> | Nama): void {\n if (this.config.parser) {\n this.initialize(this.config.parser);\n } else if (typeof raw === 'string') { // check for string type\n this.initialize(new StringParser(raw));\n } else if (Array.isArray(raw) && raw.length) { // check for Array<T>\n if (typeof raw[0] === 'string') { // check for Array<string>\n\n for (const key of raw as Array<string>)\n if (typeof key !== 'string')\n throw new Error(`Cannot parse raw data as array of 'string'`);\n this.initialize(new ArrayStringParser(raw as Array<string>))\n\n } else if (raw[0] instanceof Name) { // check for Array<Name>\n\n for (const obj of raw as Array<string>)\n if (!(obj as any instanceof Name))\n throw new Error(`Cannot parse raw data as array of '${Name.name}'`);\n this.initialize(new ArrayNameParser(raw as Array<Name>));\n\n } else {\n // typescript should stop them, but let's be paranoid (for JS developers)\n throw new Error(`Cannot parse raw data as arrays that are not of '${Name.name}' or string`);\n }\n } else if (raw instanceof Object) { // check for json object\n\n for (const entry of Object.entries(raw)) { // make sure keys are correct\n const key = entry[0], value = entry[1];\n if (['firstname', 'lastname', 'middlename', 'prefix', 'suffix'].indexOf(key) === -1)\n throw new Error(`Cannot parse raw data as json object that does not contains keys of '${Namon}'`);\n\n if (typeof value !== 'string') // make sure the values are proper string\n throw new Error(`Cannot parse raw data. The key <${key}> should be a 'string' type`);\n }\n this.initialize(new NamaParser(raw as Nama));\n } else {\n // typescript should stop them, but let's be paranoid again (for JS developers)\n throw new Error(`Cannot parse raw data. Review the data type expected.`);\n }\n // paranoid coder mode: on :P\n if (!this.config.bypass) new FullnameValidator().validate(this.fullname);\n this.summary = new Summary(this.getFullname());\n }\n}\n\n/**\n * Aliases for `Namefully`\n */\nexport interface Namefully {\n full: typeof Namefully.prototype.getFullname;\n fn: typeof Namefully.prototype.getFirstname;\n ln: typeof Namefully.prototype.getLastname;\n mn: typeof Namefully.prototype.getMiddlenames;\n px: typeof Namefully.prototype.getPrefix;\n sx: typeof Namefully.prototype.getSuffix;\n inits: typeof Namefully.prototype.getInitials;\n stats: typeof Namefully.prototype.describe;\n}\n\nNamefully.prototype.full = Namefully.prototype.getFullname;\nNamefully.prototype.fn = Namefully.prototype.getFirstname;\nNamefully.prototype.ln = Namefully.prototype.getLastname;\nNamefully.prototype.mn = Namefully.prototype.getMiddlenames;\nNamefully.prototype.px = Namefully.prototype.getPrefix;\nNamefully.prototype.sx = Namefully.prototype.getSuffix;\nNamefully.prototype.inits = Namefully.prototype.getInitials;\nNamefully.prototype.stats = Namefully.prototype.describe;\n","/**\n * An array `Name` parser\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Name, Namon, Fullname, Firstname, Lastname, Prefix, Suffix, LastnameFormat } from '../../models/index';\nimport { ArrayNameValidator } from '../../validators/index';\nimport { Parser } from './parser';\n\n\n/**\n * Represents a `Name[]` parser\n * @class\n * @implements {Parser<Name[]>}\n * @classdesc\n * This parser parses an array of the class `Name` while checking that every part\n * plays the role they are supposed to play. The class `Name` is a ready-made\n * recipe that saves the how-to parsing for a raw data input.\n *\n * **NOTE**:\n * In this specific case, the user is expected to carefully set each name part\n * and submit a high-quality data. Why is this parser if the data is already\n * shaped as wanted? Well, it is better to be safe than sorry, so we implement a\n * double-check of these values and reconfirm a cleaner data. Remember, namefully\n * works like a trapdoor, once the data is set and confirmed safe, no editing is\n * possible.\n */\nexport default class ArrayNameParser implements Parser<Name[]> {\n\n /**\n * Create a parser ready to parse the raw data\n * @param {Name[]} raw data\n */\n constructor(public raw: Name[]) {}\n\n /**\n * Parses the raw data into a full name\n * @returns {Fullname}\n */\n parse(options: { bypass: boolean, lastnameFormat: LastnameFormat }): Fullname {\n const { bypass, lastnameFormat } = options;\n // validate first\n if (!bypass) new ArrayNameValidator().validate(this.raw);\n\n // then distribute all the elements accordingly\n const fullname: Fullname = this.distribute(lastnameFormat);\n\n // finally return high quality of data\n return fullname;\n }\n\n private distribute(lastnameFormat: LastnameFormat): Fullname {\n\n const fullname: Fullname = {\n firstname: null,\n lastname: null,\n middlename: [],\n prefix: null,\n suffix: null,\n };\n\n this.raw.forEach(name => {\n switch (name.type) {\n case Namon.PREFIX:\n fullname.prefix = name.namon as Prefix;\n break;\n case Namon.FIRST_NAME:\n fullname.firstname = new Firstname(name.namon);\n break;\n case Namon.LAST_NAME:\n if (name instanceof Lastname)\n fullname.lastname = new Lastname(name.father, name.mother, lastnameFormat)\n else\n fullname.lastname = new Lastname(name.namon, null, lastnameFormat);\n break;\n case Namon.MIDDLE_NAME:\n fullname.middlename.push(name);\n break;\n case Namon.SUFFIX:\n fullname.suffix = name.namon as Suffix;\n break;\n }\n });\n\n return fullname;\n }\n}\n","/**\n * Name class definition\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Summary, Namon } from './index';\n\n/**\n * Represents a namon with some extra functionalities\n * @class\n * @see {@link Namon} interface to understand the concept of namon/nama.\n */\nexport class Name {\n\n private initial: string;\n private body: string;\n\n /**\n * Constructs a `Name`\n * @param namon a piece of string that will be defined as a namon\n * @param type which namon that is\n */\n constructor(public namon: string, public type: Namon, capitalized?: 'initial' | 'all') {\n this.initial = namon[0];\n this.body = namon.slice(1, namon.length);\n if (!!capitalized) this.capitalize(capitalized);\n }\n\n /**\n * Gives some descriptive statistics that summarize the central tendency,\n * dispersion and shape of the characters' distribution.\n * @see {@link describe} in `Namefully` class for further information\n */\n describe(): Summary {\n return new Summary(this.namon);\n }\n\n /**\n * Gets the initials of the name\n * @returns {Array<string>} the initials\n */\n getInitials(): string[] {\n return [this.initial];\n }\n\n /**\n * Capitalizes a name\n * @param {'initial' | 'all'} option how to capitalize it\n */\n protected capitalize(option: 'initial' | 'all' = 'initial'): void {\n if (option === 'initial') {\n this.initial = this.initial.toUpperCase();\n this.namon = this.initial.concat(this.body);\n } else {\n this.initial = this.initial.toUpperCase();\n this.namon = this.namon.toUpperCase();\n }\n }\n\n /**\n * Converts all the alphabetic characters in a string to lowercase\n */\n lower(): string {\n return this.namon.toLowerCase();\n }\n\n /**\n * Converts all the alphabetic characters in a string to uppercase\n */\n upper(): string {\n return this.namon.toUpperCase();\n }\n}","/**\n * First name class definition\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Name, Namon, Summary, Separator } from './index';\n\n\n/**\n * Represents a first name with some extra functionalities\n * @class\n * @extends Name\n */\nexport class Firstname extends Name {\n\n /**\n * Constructs a `Firstname`\n * @param {string} namon a piece of string that will be defined as a namon\n * @param {string[]} [more] additional pieces considered as a given name\n */\n constructor(public namon: string, public more?: string[]) {\n super(namon, Namon.FIRST_NAME);\n }\n\n /**\n * Gives some descriptive statistics that summarize the central tendency,\n * dispersion and shape of the characters' distribution.\n * @param {boolean} includeAll whether to include other pieces of the first\n * name in the summary\n * @see {@link describe} in `Namefully` class for further information\n */\n describe(includeAll: boolean = false): Summary {\n return new Summary(this.tostring(includeAll));\n }\n\n /**\n * Returns a string representation of the first name\n * @param {boolean} includeAll whether to include other pieces of the first\n * name\n */\n tostring(includeAll: boolean = false): string {\n return !includeAll ?\n this.namon :\n this.namon.concat(\n Separator.SPACE,\n this.more.join(Separator.SPACE)\n );\n }\n\n /**\n * Gets the initials of the first name\n * @returns {Array<string>} the initials\n */\n getInitials(includeAll: boolean = false): string[] {\n const initials: string[] = [this.namon[0]];\n if (includeAll && Array.isArray(this.more) && this.more.length) {\n initials.push(...this.more.map(n => n[0]));\n }\n return initials;\n }\n}\n","/**\n * Last name class definition\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Name, Namon, Summary, Separator, LastnameFormat } from './index';\n\n/**\n * Represents a last name with some extra functionalities\n * @class\n * @extends Name\n */\nexport class Lastname extends Name {\n\n /**\n * Constructs a `Lastname`\n * @param {string} father a piece of string that will be defined as a namon\n * @param {string} [mother] additional pieces considered as a last name\n * @param {LastnameFormat} [format] how to output a surname considering its\n * subparts\n */\n constructor(public father: string, public mother?: string, private format: LastnameFormat = 'father') {\n super(father, Namon.LAST_NAME);\n }\n\n /**\n * Gives some descriptive statistics that summarize the central tendency,\n * dispersion and shape of the characters' distribution.\n * @param {LastnameFormat} [format] overrides the how-to format of a surname\n * output, considering its subparts.\n * @see {@link describe} in `Namefully` class for further information\n */\n describe(format?: LastnameFormat): Summary {\n format = format || this.format;\n return new Summary(this.tostring(format));\n }\n\n /**\n * Returns a string representation of the last name\n * @param {LastnameFormat} [format] overrides the how-to format of a surname\n * output, considering its subparts.\n */\n tostring(format?: LastnameFormat): string {\n format = format || this.format;\n switch(format) {\n case 'father':\n return this.father;\n case 'mother':\n return this.mother || Separator.EMPTY;\n case 'hyphenated':\n return this.mother ? this.father.concat(Separator.HYPHEN, this.mother) : this.father;\n case 'all':\n return this.mother ? this.father.concat(Separator.SPACE, this.mother) : this.father;\n // default:\n // return this.father;\n }\n }\n\n /**\n * Gets the initials of the last name\n * @returns {Array<string>} the initials\n */\n getInitials(format?: LastnameFormat): string[] {\n format = format || this.format;\n const initials: string[] = [];\n\n switch(format) {\n case 'father':\n initials.push(this.father[0]);\n break;\n case 'mother':\n if (!!this.mother && this.mother.length)\n initials.push(this.mother[0]);\n break;\n case 'hyphenated': case 'all':\n initials.push(this.father[0]);\n if (!!this.mother && this.mother.length)\n initials.push(this.mother[0]);\n break;\n }\n return initials;\n }\n}\n","/**\n * All the enums are listed here\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\n\n/**\n * Enum `Namon` contains the finite set of a representative piece of a name\n * @readonly\n * @enum {string}\n * The word `Namon` is the singular form used to refer to a chunk|part|piece of\n * a name. And the plural form is `Nama`. (Same idea as in criterion/criteria)\n */\nexport enum Namon {\n PREFIX = 'prefix',\n LAST_NAME = 'lastname',\n MIDDLE_NAME = 'middlename',\n FIRST_NAME = 'firstname',\n SUFFIX = 'suffix',\n}\n\n/**\n * Enum for the prefix values\n * @readonly\n * @enum {string}\n * American and Canadian English follow slightly different rules for abbreviated\n * titles than British and Australian English. In North American English, titles\n * before a name require a period: `Mr., Mrs., Ms., Dr.` In British and Australian\n * English, no full stops are used in these abbreviations.\n */\nexport enum Prefix {\n FIRT_LIEUTENANT = '1st Lt',\n ADMIRAL = 'Adm',\n ATTORNEY = 'Atty',\n BROTHER = 'Brother', // Religious\n CAPTAIN = 'Capt',\n CHIEF = 'Chief',\n COMMANDER = 'Cmdr',\n COLONEL = 'Col',\n UNI_DEAN = 'Dean',\n DOCTOR = 'Dr',\n ELDER = 'Elder', // Religious\n FATHER = 'Father', // Religious\n GENERAL = 'Gen',\n HONORABLE = 'Hon',\n LIEUTENANT_COLONEL = 'Lt Col',\n MAJOR = 'Maj',\n MASTER_SERGEANT = 'MSgt',\n MISTER = 'Mr',\n MARRIED_WOMAN = 'Mrs',\n SINGLE_WOMAN = 'Ms',\n PRINCE = 'Prince',\n PROFESSOR = 'Prof',\n RABBI = 'Rabbi', // Religious\n REVEREND = 'Rev', // Religious\n SISTER = 'Sister'\n}\n\n/**\n * Enum for the suffix values\n * @readonly\n * @enum {string}\n */\nexport enum Suffix {\n THE_SECOND = 'II',\n THE_THIRD = 'III',\n THE_FOURTH = 'IV',\n CERT_PUB_ACCOUNTANT = 'CPA',\n DOCTOR_DENTAL_MED = 'DDS',\n ESQUIRE = 'Esq',\n JURIST_DOCTOR = 'JD',\n JUNIOR = 'Jr',\n DOCTOR_OF_LAWS = 'LLD',\n DOCTORATE = 'PhD',\n RETIRED_ARMED_FORCES = 'Ret',\n REGISTERED_NURSE = 'RN',\n SENIOR = 'Sr',\n DOCTOR_OF_OSTEO = 'DO'\n}\n\n/**\n * Enum for the separator values representing some of the ASCII characters\n * @readonly\n * @enum {string}\n */\nexport enum Separator {\n COLON = ':',\n COMMA = ',',\n EMPTY = '',\n HYPHEN = '-',\n PERIOD = '.',\n SPACE = ' ',\n UNDERSCORE = '_',\n}\n","/**\n * Summary of descriptive stats of the name\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Separator } from './index';\n\n/**\n * Represents the statistical summary of a string representation\n * @class\n */\nexport class Summary {\n count: number;\n frequency: number;\n top: string;\n unique: number;\n\n /**\n * Creates a `Summary` of a given string of alphabetical characters\n * @param namon piece of name\n * @param restrictions a set of undesired characters\n */\n constructor(private namon: string, restrictions: string[] = [Separator.SPACE]) {\n this.compute(restrictions);\n }\n\n /**\n * Returns a string representation of the summary\n */\n tostring(): string {\n return Separator.EMPTY.concat(\n `Descriptive statistics for \"${this.namon}\" \\n`,\n `count : ${this.count} \\n`,\n `frequency: ${this.frequency} \\n`,\n `top : ${this.top} \\n`,\n `unique : ${this.unique} \\n`\n );\n }\n\n private compute(restrictions: string[] = []): void {\n // compute stats for the string\n let count = 0, maxfreq = 0, uniq = 0, top = '';\n const freqs = this.groupByChar();\n\n for (const char in freqs) {\n if (restrictions.indexOf(char) === -1) {\n count += freqs[char];\n if (freqs[char] >= maxfreq) {\n maxfreq = freqs[char];\n top = char;\n }\n uniq++;\n }\n }\n\n this.count = count;\n this.frequency = maxfreq;\n this.top = top;\n this.unique = uniq;\n }\n\n private groupByChar(): any {\n const frequencies: { [key: string]: number } = {};\n for (const char of this.namon.toUpperCase())\n if (Object.keys(frequencies).includes(char))\n frequencies[char] += 1;\n else\n frequencies[char] = 1;\n return frequencies;\n }\n}\n","/**\n * Validation rules\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\n\n/**\n * Represents a set of validation rules (regex)\n * @class\n * @static\n *\n * This regex is intented to match specific alphabets only as a person name does\n * not contain special characters. `\\w` does not cover non-Latin characters. So,\n * it is extended using unicode chars to cover more cases (e.g., Icelandic).\n * It matches as follows:\n * [a-z]: Latin alphabet from a (index 97) to z (index 122)\n * [A-Z]: Latin alphabet from A (index 65) to Z (index 90)\n * [\\u00C0-\\u00D6]: Latin/German chars from À (index 192) to Ö (index 214)\n * [\\u00D8-\\u00f6]: German/Icelandic chars from Ø (index 216) to ö (index 246)\n * [\\u00f8-\\u00ff]: German/Icelandic chars from ø (index 248) to ÿ (index 255)\n * [\\u0400-\\u04FF]: Cyrillic alphabet from Ѐ (index 1024) to ӿ (index 1279)\n * [\\u04FFΆ-ωΑ-ώ]: Greek alphabet from Ά (index 902) to ω (index 969)\n */\nexport class ValidationRule {\n /**\n * Matches one name part (namon) that is of nature:\n * - Latin (English, Spanish, French, etc.)\n * - European (Greek, Cyrillic, Icelandic, German)\n * - hyphenated\n * - with apostrophe\n */\n static namon: RegExp = /^[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]+((['-][a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ])?[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]*)*$/\n\n /**\n * Matches 1+ name parts (namon) that are of nature:\n * - Latin (English, Spanish, French, etc.)\n * - European (Greek, Cyrillic, Icelandic, German)\n * - hyphenated\n * - with apostrophe\n * - with comma\n * - with period\n * - with space\n */\n static fullname: RegExp = /^[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]+(([',. -][a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ ])?[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]*)*$/\n\n /**\n * Matches one name part (namon) that is of nature:\n * - Latin (English, Spanish, French, etc.)\n * - European (Greek, Cyrillic, Icelandic, German)\n * - hyphenated\n * - with apostrophe\n */\n static firstname: RegExp = /^[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]+((['-][a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ])?[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]*)*$/\n\n /**\n * Matches 1+ names part (namon) that are of nature:\n * - Latin (English, Spanish, French, etc.)\n * - European (Greek, Cyrillic, Icelandic, German)\n * - hyphenated\n * - with apostrophe\n * - with space\n */\n static middlename: RegExp = /^[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]+(([' -][a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ])?[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]*)*$/\n\n /**\n * Matches one name part (namon) that is of nature:\n * - Latin (English, Spanish, French, etc.)\n * - European (Greek, Cyrillic, Icelandic, German)\n * - hyphenated\n * - with apostrophe\n */\n static lastname: RegExp = /^[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]+((['-][a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ])?[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]*)*$/\n}\n","/**\n * Validation types\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\n\n/**\n * Enum for the validation types\n * @enum\n */\nexport enum ValidatorType {\n NONE,\n NAMON,\n NAMA,\n ARR_NAMES, // array of `Name`s\n ARR_STRING, // array of string\n FULL_NAME,\n PREFIX,\n FIRST_NAME,\n MIDDLE_NAME,\n LAST_NAME,\n SUFFIX,\n\n CUSTOM, // user-defined\n}","/**\n * Validation error\n *\n * Created on March 06, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\n\n/**\n * Represents a validation error\n * @class\n * @extends Error\n */\nexport class ValidationError extends Error {\n /**\n * Create a validation `Error`\n * @param message of error to display\n * @param type categorizes the error\n */\n constructor(message?: string, type?: string) {\n super(`${ type ? type + ' :: ' + message : message }`);\n this.name = 'ValidationError';\n }\n}","/**\n * Namon validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Validator, ValidatorType, ValidationError, ValidationRule } from './index';\n\n/**\n * Represents a namon validator to help to parse single pieces of string\n * @class\n * @implements {Validator}\n */\nexport default class NamonValidator implements Validator<string> {\n readonly type: ValidatorType = ValidatorType.NAMON;\n /**\n * Validates the content of a name\n * @param {string} value data to validate\n */\n validate(value: string): void {\n if (!ValidationRule.namon.test(value))\n throw new ValidationError(`invalid string content '${value}'`, 'Name');\n }\n}","/**\n * Prefix validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Prefix } from '../models/index';\nimport { Validator, ValidatorType, ValidationError } from './index';\n\n/**\n * Represents a prefix validator\n * @class\n * @implements {Validator}\n */\nexport default class PrefixValidator implements Validator<string> {\n readonly type: ValidatorType = ValidatorType.PREFIX;\n /**\n * Validates the content of a prefix name\n * @param {string} value data to validate\n */\n validate(value: string): void {\n const prefixes: Array<string> = Object.entries(Prefix).map(e => e[1].toLowerCase()); // values\n if (prefixes.indexOf(value.toLowerCase()) === -1)\n throw new ValidationError(`unknown value '${value}'`, 'Prefix');\n }\n}","/**\n * Suffix validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Suffix } from '../models/index';\nimport { Validator, ValidatorType, ValidationError } from './index';\n\n/**\n * Represents a suffix validator\n * @class\n * @implements {Validator}\n */\nexport default class SuffixValidator implements Validator<string> {\n readonly type: ValidatorType = ValidatorType.SUFFIX;\n /**\n * Validates the content of a suffix name\n * @param {string} value data to validate\n */\n validate(value: string): void {\n const suffixes: Array<string> = Object.entries(Suffix).map(e => e[1].toLowerCase()); // values\n if (suffixes.indexOf(value.toLowerCase()) === -1)\n throw new ValidationError(`unknown value '${value}'`, 'Suffix');\n }\n}","/**\n * First name validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Validator, ValidatorType, ValidationError, ValidationRule } from './index';\n\n/**\n * Represents a first name validator\n * @class\n * @implements {Validator}\n */\nexport default class FirstnameValidator implements Validator<string> {\n readonly type: ValidatorType = ValidatorType.FIRST_NAME;\n /**\n * Validates the content of a first name\n * @param {string} value data to validate\n */\n validate(value: string): void {\n if (!ValidationRule.firstname.test(value))\n throw new ValidationError(`invalid string content '${value}'`, 'First name');\n }\n}","/**\n * Last name validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Validator, ValidatorType, ValidationError, ValidationRule } from './index';\n\n/**\n * Represents a last name validator\n * @class\n * @implements {Validator}\n */\nexport default class LastnameValidator implements Validator<string> {\n readonly type: ValidatorType = ValidatorType.LAST_NAME;\n /**\n * Validates the content of a last name\n * @param {string} value data to validate\n */\n validate(value: string): void {\n if (!ValidationRule.lastname.test(value))\n throw new ValidationError(`invalid string content '${value}'`, 'Last name');\n }\n}\n","/**\n * Middle name validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Validator, ValidatorType, ValidationError, ValidationRule, NamonValidator } from './index';\n\n/**\n * Represents a middle name validator\n * @class\n * @implements {Validator}\n */\nexport default class MiddlenameValidator implements Validator<string | string[]> {\n readonly type: ValidatorType = ValidatorType.MIDDLE_NAME;\n /**\n * Validates the content of a list of middle names\n * @param {string | Array<string>} values to validate\n */\n validate(values: string | string[]): void {\n\n if (typeof values === 'string') {\n if (!ValidationRule.middlename.test(values))\n throw new ValidationError(`invalid string content '${values}'`, 'Middle name');\n } else if (values instanceof Array) {\n const namonValidator = new NamonValidator();\n (values as Array<string>).forEach(v => namonValidator.validate(v));\n } else {\n throw new Error('Expecting string or Array<string> type');\n }\n }\n}","/**\n * `Fullname` validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Fullname, Firstname, Lastname } from '../models/index';\nimport { Validator, ValidatorType, ValidationError, PrefixValidator, SuffixValidator } from './index';\n\n/**\n * Represents a `Fullname` (JSON signature) validator for provided custom parser\n * @class\n * @implements {Validator}\n */\nexport default class FullnameValidator implements Validator<Fullname> {\n readonly type: ValidatorType = ValidatorType.FULL_NAME;\n /**\n * Validates that the `Fullname` contract is met\n * @param {Fullname} value data to validate\n */\n validate(v: Fullname): void {\n if (!v.firstname || !(v.firstname instanceof Firstname))\n throw new ValidationError('first name is corrupted', 'Fullname');\n if (!v.lastname || !(v.lastname instanceof Lastname))\n throw new ValidationError('last name is corrupted', 'Fullname');\n if (v.middlename && !(v.middlename instanceof Array))\n throw new ValidationError('middle name is corrupted', 'Fullname');\n if (v.prefix)\n new PrefixValidator().validate(v.prefix)\n if (v.suffix)\n new SuffixValidator().validate(v.suffix)\n }\n}","/**\n * Nama validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Nama, Namon } from '../models/index';\nimport {\n Validator, ValidatorType, ValidationError , PrefixValidator, FirstnameValidator,\n LastnameValidator, MiddlenameValidator, SuffixValidator\n} from './index';\n\n/**\n * Represents a `Nama` validator to help the nama parser\n * @class\n * @implements {Validator}\n */\nexport default class NamaValidator implements Validator<Nama> {\n readonly type: ValidatorType = ValidatorType.NAMA;\n /**\n * Validates the content of a JSON-formatted names\n * @param {string} value data to validate\n */\n validate(value: Nama): void {\n\n const entries = Object.entries(value);\n if (entries.length <= 1 && entries.length > 5)\n throw new ValidationError('incomplete JSON object', 'Nama')\n\n const validators = {\n [Namon.PREFIX]: new PrefixValidator(),\n [Namon.FIRST_NAME]: new FirstnameValidator(),\n [Namon.MIDDLE_NAME]: new MiddlenameValidator(),\n [Namon.LAST_NAME]: new LastnameValidator(),\n [Namon.SUFFIX]: new SuffixValidator(),\n };\n for (const entry of entries) {\n const k = entry[0] as keyof Nama;\n const v = entry[1] as string;\n validators[k].validate(v);\n }\n }\n}\n","/**\n * Array of `Name` validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Name, Namon, Lastname } from '../models/index';\nimport {\n Validator, ValidatorType, ValidationError , PrefixValidator, FirstnameValidator,\n LastnameValidator, MiddlenameValidator, SuffixValidator\n} from './index';\n\n/**\n * Represents a validator to help the array `Name` parser\n * @class\n * @classdesc\n * This validator validates a array of `Name` objects following a specific order\n * based on the count of elements. It is expected that the array has to be\n * between two and five elements.\n *\n */\nexport default class ArrayNameValidator implements Validator<Name[]> {\n readonly type: ValidatorType = ValidatorType.ARR_NAMES;\n /**\n * Validates the content of a set of custom `Name`s\n * @param {Array<Name>} value data to validate\n */\n validate(values: Array<Name>): void {\n if (values.length <= 1 || values.length > 5) {\n throw new ValidationError(`must be an array of 2 - 5 'Name's`, 'Array of Names');\n }\n const validators = {\n [Namon.PREFIX]: new PrefixValidator(),\n [Namon.FIRST_NAME]: new FirstnameValidator(),\n [Namon.MIDDLE_NAME]: new MiddlenameValidator(),\n [Namon.LAST_NAME]: new LastnameValidator(),\n [Namon.SUFFIX]: new SuffixValidator(),\n };\n\n switch(values.length) {\n case 2: // first name + last name\n values.forEach(n => {\n if ( ![Namon.FIRST_NAME, Namon.LAST_NAME].includes(n.type) )\n throw new ValidationError('Both first and last names are required')\n if (n.type === Namon.LAST_NAME && n instanceof Lastname)\n validators[n.type].validate(n.mother)\n validators[n.type].validate(n.namon)\n });\n break;\n case 3: // first name + middle name + last name\n values.forEach(n => {\n if ( ![Namon.FIRST_NAME, Namon.MIDDLE_NAME, Namon.LAST_NAME].includes(n.type) )\n throw new ValidationError('First, middle and last names are required')\n if (n.type === Namon.LAST_NAME && n instanceof Lastname)\n validators[n.type].validate(n.mother)\n validators[n.type].validate(n.namon)\n });\n break;\n case 4: // first name + middle name + last name\n values.forEach(n => {\n if ( ![Namon.PREFIX, Namon.FIRST_NAME, Namon.MIDDLE_NAME,\n Namon.LAST_NAME].includes(n.type) )\n throw new ValidationError('More fields are required')\n if (n.type === Namon.LAST_NAME && n instanceof Lastname)\n validators[n.type].validate(n.mother)\n validators[n.type].validate(n.namon)\n });\n break;\n case 5: // first name + middle name + last name\n values.forEach(n => {\n if ( ![Namon.PREFIX, Namon.FIRST_NAME, Namon.MIDDLE_NAME, Namon.LAST_NAME,\n Namon.SUFFIX].includes(n.type) )\n throw new ValidationError('More fields are required')\n if (n.type === Namon.LAST_NAME && n instanceof Lastname)\n validators[n.type].validate(n.mother)\n validators[n.type].validate(n.namon)\n });\n break;\n }\n }\n}","/**\n * Array of string validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport {\n Validator, ValidatorType, ValidationError , PrefixValidator, FirstnameValidator,\n LastnameValidator, MiddlenameValidator, SuffixValidator\n} from './index';\nimport { NameIndex } from '../models/index';\n\n/**\n * Represents a validator to help the array string parser\n * @class\n * @classdesc\n * This validator validates an array of string name following a specific order\n * based on the count of elements. It is expected that the array has to be between\n * two and five elements. Also, the order of appearance set in the configuration\n * influences how this validation is carried out.\n *\n * Ordered by first name, the validator validates the following:\n * - 2 elements: firstname lastname\n * - 3 elements: firstname middlename lastname\n * - 4 elements: prefix firstname middlename lastname\n * - 5 elements: prefix firstname middlename lastname suffix\n *\n * Ordered by last name, the validator validates the following:\n * - 2 elements: lastname firstname\n * - 3 elements: lastname firstname middlename\n * - 4 elements: prefix lastname firstname middlename\n * - 5 elements: prefix lastname firstname middlename suffix\n */\nexport default class ArrayStringValidator implements Validator<string[]> {\n readonly type: ValidatorType = ValidatorType.ARR_STRING;\n\n /**\n * Creates an instance of the validator\n * @param indexing how to index the name parts\n */\n constructor(public indexing: NameIndex) {}\n\n /**\n * Validates the content of a name\n * @param {string} value data to validate\n */\n validate(values: string[]): void {\n\n if (values.length <= 1 || values.length > 5)\n throw new ValidationError('must be an array of 2 - 5 elements', 'Array of names')\n\n const pf = new PrefixValidator();\n const sf = new SuffixValidator();\n const fn = new FirstnameValidator();\n const ln = new LastnameValidator();\n const mn = new MiddlenameValidator();\n\n const index = this.indexing;\n\n switch(values.length) {\n case 2:\n fn.validate(values[index.firstname]);\n ln.validate(values[index.lastname]);\n break;\n case 3:\n fn.validate(values[index.firstname]);\n mn.validate(values[index.middlename]);\n ln.validate(values[index.lastname]);\n break;\n case 4:\n pf.validate(values[index.prefix]);\n fn.validate(values[index.firstname]);\n mn.validate(values[index.middlename]);\n ln.validate(values[index.lastname]);\n break;\n case 5:\n pf.validate(values[index.prefix]);\n fn.validate(values[index.firstname]);\n mn.validate(values[index.middlename]);\n ln.validate(values[index.lastname]);\n sf.validate(values[index.suffix])\n break;\n }\n }\n}","/**\n * String of full name validator\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Validator, ValidatorType, ValidationError, ValidationRule } from './index';\n\n/**\n * Represents a string full name validator\n * @class\n * @implements {Validator}\n */\nexport default class StringNameValidator implements Validator<string> {\n readonly type: ValidatorType = ValidatorType.FULL_NAME;\n /**\n * Validates the content of a name\n * @param {string} value data to validate\n */\n validate(value: string): void {\n if (!ValidationRule.fullname.test(value))\n throw new ValidationError(`invalid string content '${value}'`, 'Full name');\n }\n}","/**\n * An array of string parser\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Namon, Fullname, Firstname, Lastname, Name, Prefix, Suffix, NameIndex, NameOrder } from '../../models/index';\nimport { ArrayStringValidator } from '../../validators/index';\nimport { organizeNameIndex } from '../../core/index';\nimport { Parser } from './parser';\n\n\n/**\n * Represents an array string parser\n * @class\n * @implements {Parser<string[]>}\n * @classdesc\n * This parser parses an array of string name following a specific order based\n * on the count of elements. It is expected that the array has to be between two\n * and five elements. Also, the order of appearance set in the configuration\n * influences how this parsing is carried out.\n *\n * Ordered by first name, the parser works as follows:\n * - 2 elements: firstname lastname\n * - 3 elements: firstname middlename lastname\n * - 4 elements: prefix firstname middlename lastname\n * - 5 elements: prefix firstname middlename lastname suffix\n *\n * Ordered by last name, the parser works as follows:\n * - 2 elements: lastname firstname\n * - 3 elements: lastname firstname middlename\n * - 4 elements: prefix lastname firstname middlename\n * - 5 elements: prefix lastname firstname middlename suffix\n *\n */\nexport default class ArrayStringParser implements Parser<string[]> {\n\n /**\n * Create a parser ready to parse the raw data\n * @param {Array<string>} raw data\n */\n constructor(public raw: string[]) { }\n\n /**\n * Parses the raw data into a full name\n * @returns {Fullname}\n */\n parse(options: { orderedBy: NameOrder, bypass: boolean }): Fullname {\n\n // given this setting\n const { orderedBy, bypass } = options;\n\n // validate first\n const raw = this.raw.map(n => n.trim()); // cleanup\n const index = organizeNameIndex(orderedBy, raw.length);\n if (!bypass) new ArrayStringValidator(index).validate(raw);\n\n // then distribute all the elements accordingly\n const fullname = this.distribute(raw, index);\n\n // finally return high quality of data\n return fullname;\n }\n\n private distribute(raw: string[], index: NameIndex): Fullname {\n\n const fullname: Fullname = {\n firstname: null,\n lastname: null,\n middlename: [],\n prefix: null,\n suffix: null,\n };\n\n switch (raw.length) {\n case 2: // first name + last name\n fullname.firstname = new Firstname(raw[index.firstname]);\n fullname.lastname = new Lastname(raw[index.lastname]);\n break;\n case 3: // first name + middle name + last name\n fullname.firstname = new Firstname(raw[index.firstname]);\n fullname.middlename.push(new Name(raw[index.middlename], Namon.MIDDLE_NAME));\n fullname.lastname = new Lastname(raw[index.lastname]);\n break;\n case 4: // prefix + first name + middle name + last name\n fullname.prefix = raw[index.prefix] as Prefix;\n fullname.firstname = new Firstname(raw[index.firstname]);\n fullname.middlename.push(new Name(raw[index.middlename], Namon.MIDDLE_NAME));\n fullname.lastname = new Lastname(raw[index.lastname]);\n break;\n case 5: // prefix + first name + middle name + last name + suffix\n fullname.prefix = raw[index.prefix] as Prefix;\n fullname.firstname = new Firstname(raw[index.firstname]);\n fullname.middlename.push(new Name(raw[index.middlename], Namon.MIDDLE_NAME));\n fullname.lastname = new Lastname(raw[index.lastname]);\n fullname.suffix = raw[index.suffix] as Suffix;\n break;\n }\n return fullname;\n }\n}\n","/**\n * A `Nama` (JSON signature) parser\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Namon, Nama, Fullname, Firstname, Lastname, Name, Prefix, Suffix } from '../../models/index';\nimport { NamaValidator } from '../../validators/index';\nimport { Parser } from './parser';\n\n\n/**\n * Represents a `Nama` parser\n * @class\n * @implements {Parser<Nama>}\n * @classdesc\n * This parser parses a JSON signature of the name parts provided as string\n * values. This is to facilitate a developer's life that holds users' info in a\n * JSON format. In other words, the developer only needs to provide similar info\n * and the rest will follow.\n */\nexport default class NamaParser implements Parser<Nama> {\n\n /**\n * Create a parser ready to parse the raw data\n * @param {Nama} raw data as JSON object\n */\n constructor(public raw: Nama) { }\n\n /**\n * Parses the raw data into a full name\n * @returns {Fullname}\n */\n parse(options: { bypass: boolean }): Fullname {\n\n // validate first\n if (!options.bypass) new NamaValidator().validate(this.raw);\n\n // then distribute all the elements accordingly\n const fullname = this.distribute();\n\n // finally return high quality of data\n return fullname;\n }\n\n private distribute(): Fullname {\n const fullname: Fullname = {\n firstname: null,\n lastname: null,\n middlename: [],\n prefix: null,\n suffix: null,\n };\n\n for (const entry of Object.entries(this.raw)) {\n const key = entry[0] as keyof Nama;\n const value = entry[1] as string;\n switch (key) {\n case Namon.FIRST_NAME:\n fullname.firstname = new Firstname(value);\n break;\n case Namon.LAST_NAME:\n fullname.lastname = new Lastname(value);\n break;\n case Namon.MIDDLE_NAME:\n fullname.middlename.push(new Name(value, Namon.MIDDLE_NAME));\n break;\n case Namon.PREFIX:\n fullname.prefix = value as Prefix;\n break;\n case Namon.SUFFIX:\n fullname.suffix = value as Suffix;\n break;\n }\n }\n return fullname;\n }\n}\n","/**\n * A string parser\n *\n * Created on March 15, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Separator, Fullname, NameOrder } from '../../models/index';\nimport { Parser, ArrayStringParser } from './index';\n\n\n/**\n * Represents a string parser\n * @class\n * @implements {Parser}\n * @classdesc\n * This parser parses a string name using a separator, if set, or simply using\n * the space character <' '> as a basis for the split.\n *\n * **NOTE**:\n * A string name is basically a string type containing the name parts differentiated\n * with the help of a separator. The default separator is the character <space>\n * or <' '>. However, it can be very, very helpful to use a distinct separator\n * (e.g., a colon <:>) to handle multiple names for a `Namon`. That is to say,\n * a piece of name shaped as `De La Cruz` is a last name that needs to be handled\n * as a whole, and therefore requires that a different type of separator to split\n * up the name parts. Alternatively, the `ArrayStringParser` can be used by indicating\n * specifically which part of the name is what. Do note that this parser is actually\n * a wrapper of the `ArrayStringParser`.\n *\n * @example\n * Given the name `Maria De La Cruz`, using this parser without indicating a\n * separator different than <space> will definitely throw an error. So, if the proper\n * proper of doing when `De La Cruz` is the last name:\n * ```\n * > const name = new Namefully('Maria:De La Cruz', { separator: Separator.COLON })\n * > console.log(name.getLastname())\n * De La Cruz\n * ```\n * Or\n * ```\n * > const name = new Namefully(['Maria', 'De La Cruz'])\n * > console.log(name.getLastname())\n * De La Cruz\n * ```\n */\nexport default class StringParser implements Parser<string> {\n\n /**\n * Create a parser ready to parse the raw data\n * @param {string} raw data as a string representation\n */\n constructor(public raw: string) {}\n\n /**\n * Parses the raw data into a full name\n * @param options how to parse\n * @returns {Fullname}\n */\n parse(options: {\n orderedBy: NameOrder,\n separator: Separator,\n bypass: boolean,\n }): Fullname {\n\n // given this setting\n const { orderedBy, separator, bypass } = options;\n\n // then distribute all the elements accordingly\n const nama = this.raw.split(separator);\n const fullname = new ArrayStringParser(nama).parse({ orderedBy, bypass });\n\n // finally return high quality of data\n return fullname;\n }\n}\n","/**\n * Utils for the core functionalities of `Namefully`\n *\n * Created on March 16, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { NameIndex, NameOrder } from '../../models';\nimport { NAME_INDEX } from '../../core';\n\n/**\n * Reorganizes the existing global indexes for array of name parts\n * @param orderedBy by first or last name\n * @param argLength length of the provided array\n * @param nameIndex global preset of indexing\n */\nexport function organizeNameIndex(\n orderedBy: NameOrder,\n argLength: number,\n nameIndex: NameIndex = NAME_INDEX\n): NameIndex {\n const out: NameIndex = { ...nameIndex };\n\n if (orderedBy === 'firstname') {\n switch(argLength) {\n case 2: // first name + last name\n out.firstname = 0;\n out.lastname = 1;\n break;\n case 3: // first name + middle name + last name\n out.firstname = 0;\n out.middlename = 1;\n out.lastname = 2;\n break;\n case 4: // prefix + first name + middle name + last name\n out.prefix = 0;\n out.firstname = 1;\n out.middlename = 2;\n out.lastname = 3;\n break;\n case 5: // prefix + first name + middle name + last name + suffix\n out.prefix = 0;\n out.firstname = 1;\n out.middlename = 2;\n out.lastname = 3;\n out.suffix = 4;\n break;\n }\n }\n else {\n switch(argLength) {\n case 2: // last name + first name\n out.lastname = 0;\n out.firstname = 1;\n break;\n case 3: // last name + first name + middle name\n out.lastname = 0;\n out.firstname = 1;\n out.middlename = 2;\n break;\n case 4: // prefix + last name + first name + middle name\n out.prefix = 0;\n out.lastname = 1;\n out.firstname = 2;\n out.middlename = 3;\n break;\n case 5: // prefix + last name + first name + middle name + suffix\n out.prefix = 0;\n out.lastname = 1;\n out.firstname = 2;\n out.middlename = 3;\n out.suffix = 4;\n break;\n }\n }\n return out;\n}\n","/**\n * Constants\n *\n * Created on March 07, 2020\n * @author Ralph Florent <ralflornt@gmail.com>\n */\nimport { Separator, Config, NameIndex } from '../models/index';\n\n/**\n * The current version of `Namefully`.\n * @constant\n */\nexport const version = '1.0.9';\n\n/**\n * CONFIG constant\n * @constant\n * @type {Config}\n * @default\n */\nexport const CONFIG: Config = {\n orderedBy: 'firstname',\n separator: Separator.SPACE,\n titling: 'uk', // no period\n ending: Separator.SPACE,\n bypass: false,\n lastnameFormat: 'father',\n}\n\n/**\n * NAME_INDEX constant\n * @constant\n * @type {NameIndex}\n * @default\n */\nexport const NAME_INDEX: NameIndex = {\n prefix: 0,\n firstname: 1,\n middlename: 2,\n lastname: 3,\n suffix: 4,\n}\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://namefully/webpack/universalModuleDefinition","webpack://namefully/webpack/bootstrap","webpack://namefully/./src/types.ts","webpack://namefully/./src/error.ts","webpack://namefully/./src/utils.ts","webpack://namefully/./src/name.ts","webpack://namefully/./src/config.ts","webpack://namefully/./src/constants.ts","webpack://namefully/./src/full-name.ts","webpack://namefully/./src/validator.ts","webpack://namefully/./src/parser.ts","webpack://namefully/./src/index.ts","webpack://namefully/./src/namefully.ts"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Title","Surname","NameOrder","NameType","Flat","CapsRange","Namon","index","all","has","undefined","this","other","PREFIX","FIRST_NAME","MIDDLE_NAME","LAST_NAME","SUFFIX","values","Map","Separator","token","COMMA","COLON","DOUBLE_QUOTE","EMPTY","HYPHEN","PERIOD","SEMI_COLON","SINGLE_QUOTE","SPACE","UNDERSCORE","tokens","map","NameErrorType","NameError","Error","source","message","type","UNKNOWN","super","input","isNameArray","toString","join","isStringArray","trim","length","report","sourceAsString","hasMessage","error","INPUT","VALIDATION","nameType","NOT_ALLOWED","operation","origin","NameIndex","prefix","firstName","middleName","lastName","suffix","MIN_NUMBER_OF_NAME_PARTS","MAX_NUMBER_OF_NAME_PARTS","order","count","base","str","range","INITIAL","NONE","initial","toUpperCase","rest","slice","toLowerCase","concat","chars","push","Array","isArray","every","e","Name","capsRange","caps","newValue","InputError","namon","capitalize","decapitalize","FirstName","more","_more","hasMore","reduce","acc","names","first","withMore","inits","LastName","father","mother","format","FATHER","_mother","last","hasMother","MOTHER","HYPHENATED","ALL","Config","orderedBy","separator","title","UK","ending","bypass","surname","_name","_orderedBy","_separator","_title","_ending","_bypass","_surname","cache","set","config","options","genNewName","copyWith","version","ALLOWED_TOKENS","FullName","_middleName","_config","merge","_prefix","_firstName","_lastName","_suffix","json","fullName","setPrefix","setFirstName","setMiddleName","setLastName","setSuffix","UnknownError","Validators","validate","US","middle","equal","ValidationRule","RegExp","NamonValidator","validator","ValidationError","test","NamaValidator","validateKeys","nama","size","validateIndex","hasBasicNames","accumulator","isFirstName","isLastName","keys","asNames","forEach","Parser","raw","text","parts","split","StringParser","pop","middles","ArrayStringParser","Promise","resolve","build","reject","parse","when","ArrayStringValidator","asNama","entries","cast","ArrayNameValidator","isPrefix","isSuffix","isMiddleName","Namefully","toParser","buildAsync","then","parser","birth","_fullName","hasMiddle","birthName","shorten","full","sep","initials","firstInits","midInits","lastInits","mergedOptions","only","BIRTH_NAME","limit","by","withPeriod","recursive","fn","mn","ln","hasMid","f","FIRST_MID","MID_LAST","flat","next","flatten","pattern","short","long","public","group","formatted","char","indexOf","NotAllowedError","updateOrder","console","log","replace","toPascalCase","toggleCase","ArrayNameParser","NamaParser"],"mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,YAAa,GAAIH,GACE,iBAAZC,QACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,IARtB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7D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AO1F,KAAKmD,aAAajB,KAAK,KAAOsK,GAErD/G,EAAMnB,KAAKtE,KAAK0F,MAAQ8G,GAExBxM,KAAKqD,QAAQoC,EAAMnB,KAAKtE,KAAKqD,QACjC,MAAMuG,EAAOnE,EAAMvD,KAAK,KAAKE,OAC7B,MAAgB,MAATgM,EAAexE,EAAOA,EAAK5F,cACtC,IAAK,IACD,OAAOhE,KAAKiD,OAChB,IAAK,IACD,OAAkB,QAAlB,EAAOjD,KAAKiD,cAAM,eAAEe,cACxB,IAAK,IACD,OAAOhE,KAAKqD,OAChB,IAAK,IACD,OAAkB,QAAlB,EAAOrD,KAAKqD,cAAM,eAAEW,cACxB,IAAK,KACL,IAAK,KACD,OAAOhE,KAAKmM,UAAUjJ,UAAUuJ,WAAW,GAC/C,IAAK,KACL,IAAK,KACD,OAAOzM,KAAKmM,UAAU/I,SAASqJ,WAAW,GAC9C,IAAK,KACL,IAAK,KACD,OAAOzM,KAAKoM,UAAYpM,KAAKkJ,OAAO,QAAKnJ,EAC7C,QACI,SAhsBhB","file":"namefully.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"namefully\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"namefully\"] = factory();\n\telse\n\t\troot[\"namefully\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n","/**\n * Make a type nullable.\n */\nexport type Nullable<T> = T | null | undefined\n\n/**\n * The abbreviation type to indicate whether or not to add period to a prefix\n * using the American or British way.\n */\nexport enum Title {\n // A period after the prefix.\n US = 'US',\n\n // No period after the prefix.\n UK = 'UK',\n}\n\n/**\n * An option indicating how to format a surname.\n *\n * This enum can be set via `Config` or when creating a `LastName`. As this can\n * become ambiguous at the time of handling it, the value set in `Config` is\n * prioritized and viewed as the source of truth for future considerations.\n */\nexport enum Surname {\n // The fatherly surname only.\n FATHER = 'father',\n\n // The motherly surname only.\n MOTHER = 'mother',\n\n // The junction of both the fatherly and motherly surnames with a hyphen.\n HYPHENATED = 'hyphenated',\n\n // The junction of both the fatherly and motherly surnames with a space.\n ALL = 'all',\n}\n\n/**\n * The order of appearance of a `FullName`.\n */\nexport enum NameOrder {\n // The first part of a full name, usually the first piece of a person name.\n FIRST_NAME = 'firstName',\n\n // The last part of a full name, usually the last piece of a person name.\n LAST_NAME = 'lastName',\n}\n\n/**\n * The types of name handled in this according the name standards.\n */\nexport enum NameType {\n FIRST_NAME = 'firstName',\n MIDDLE_NAME = 'middleName',\n LAST_NAME = 'lastName',\n BIRTH_NAME = 'birthName',\n}\n\n/**\n * The possible variants to indicate how to flatten a `FullName`.\n */\nexport enum Flat {\n // Use the first name's initial combined with the remaining parts.\n FIRST_NAME = 'firstName',\n\n // Use the middle name's initial combined with the remaining parts.\n MIDDLE_NAME = 'middleName',\n\n // Use the last name's initial combined with the remaining parts.\n LAST_NAME = 'lastName',\n\n // Use both the first and middle names' initials combined with the remaining parts.\n FIRST_MID = 'firstMid',\n\n // Use both the last and middle names' initials combined with the remaining parts.\n MID_LAST = 'midLast',\n\n // Use the first, middle and last names' initials combined with the remaining parts.\n ALL = 'all',\n}\n\n/**\n * The range to use when capitalizing a string content.\n */\nexport enum CapsRange {\n // No capitalization.\n NONE,\n\n // Apply capitalization to the first letter.\n INITIAL,\n\n // Apply capitalization to all the letters.\n ALL,\n}\n\n/**\n * The types of name handled in this utility according the name standards.\n */\nexport class Namon {\n static readonly PREFIX = new Namon(0, 'prefix')\n static readonly FIRST_NAME = new Namon(1, 'firstName')\n static readonly MIDDLE_NAME = new Namon(2, 'middleName')\n static readonly LAST_NAME = new Namon(3, 'lastName')\n static readonly SUFFIX = new Namon(4, 'suffix')\n\n /**\n * The list of supported name types.\n */\n static readonly values: Namon[] = [Namon.PREFIX, Namon.FIRST_NAME, Namon.MIDDLE_NAME, Namon.LAST_NAME, Namon.SUFFIX]\n\n /**\n * All the predefined name types.\n */\n static readonly all = new Map<string, Namon>([\n [Namon.PREFIX.key, Namon.PREFIX],\n [Namon.FIRST_NAME.key, Namon.FIRST_NAME],\n [Namon.MIDDLE_NAME.key, Namon.MIDDLE_NAME],\n [Namon.LAST_NAME.key, Namon.LAST_NAME],\n [Namon.SUFFIX.key, Namon.SUFFIX],\n ])\n\n private constructor(readonly index: number, readonly key: string) {}\n\n /**\n * Whether this string key is part of the predefined keys.\n */\n static has(key: string): boolean {\n return Namon.all.has(key)\n }\n\n /**\n * Makes a string key a namon type.\n */\n static cast(key: string): Nullable<Namon> {\n return Namon.has(key) ? Namon.all.get(key) : undefined\n }\n\n /**\n * String representation of this object.\n */\n toString(): string {\n return `Namon.${this.key}`\n }\n\n /**\n * Whether this and the other value are equal.\n */\n equal(other: Namon | unknown): boolean {\n return other instanceof Namon && other.index === this.index && other.key === this.key\n }\n}\n\n/**\n * The token used to indicate how to split string values.\n */\nexport class Separator {\n static readonly COMMA = new Separator('comma', ',')\n static readonly COLON = new Separator('colon', ':')\n static readonly DOUBLE_QUOTE = new Separator('doubleQuote', '\"')\n static readonly EMPTY = new Separator('empty', '')\n static readonly HYPHEN = new Separator('hyphen', '-')\n static readonly PERIOD = new Separator('period', '.')\n static readonly SEMI_COLON = new Separator('semiColon', ';')\n static readonly SINGLE_QUOTE = new Separator('singleQuote', `'`)\n static readonly SPACE = new Separator('space', ' ')\n static readonly UNDERSCORE = new Separator('underscore', '_')\n\n /**\n * All the available separators.\n */\n static readonly all = new Map<string, Separator>([\n [Separator.COMMA.name, Separator.COMMA],\n [Separator.COLON.name, Separator.COLON],\n [Separator.DOUBLE_QUOTE.name, Separator.DOUBLE_QUOTE],\n [Separator.EMPTY.name, Separator.EMPTY],\n [Separator.HYPHEN.name, Separator.HYPHEN],\n [Separator.PERIOD.name, Separator.PERIOD],\n [Separator.SEMI_COLON.name, Separator.SEMI_COLON],\n [Separator.SINGLE_QUOTE.name, Separator.SINGLE_QUOTE],\n [Separator.SPACE.name, Separator.SPACE],\n [Separator.UNDERSCORE.name, Separator.UNDERSCORE],\n ])\n\n /**\n * All the available tokens.\n */\n static readonly tokens: string[] = [...Separator.all.values()].map((s) => s.token)\n\n private constructor(readonly name: string, readonly token: string) {}\n\n /**\n * String representation of this object.\n */\n toString(): string {\n return `Separator.${this.name}`\n }\n}\n","import { Name } from './name'\nimport { Nullable } from './types'\nimport { isNameArray, isStringArray } from './utils'\n\ntype NameSource = Nullable<string | string[] | Name[]>\n\ninterface ErrorMessage {\n source: NameSource\n message?: string\n}\n\n/**\n * The error types supported by `Namefully`.\n */\nexport enum NameErrorType {\n /**\n * Thrown when a name entry/argument is incorrect.\n *\n * For example, a name should have a minimum of 2 characters, so an empty\n * string or a string of one character would cause this kind of error.\n */\n INPUT,\n\n /**\n * Thrown when the name components do not match the validation rules if the\n * `Config.bypass` is not flagged up. This bypass option skips the validation\n * rules.\n *\n * See also: `ValidationError`\n */\n VALIDATION,\n\n /**\n * Thrown by not allowed operations such as in NameBuilder or name formatting.\n *\n * See also: `NotAllowedError`, `Namefully.format`.\n */\n NOT_ALLOWED,\n\n /**\n * Thrown by any other unknown sources or unexpected situation.\n */\n UNKNOWN,\n}\n\n/**\n * Base class for all name-related errors.\n *\n * A custom error is intended to convey information to the user about a failure,\n * so that it can be addressed programmatically.\n *\n * A name handling failure is not considered a native error that should cause a\n * program failure. Au contraire, it is expected that a programmer using this utility\n * would consider validating a name using its own business rules. That is not\n * this utility's job to guess those rules. So, the predefined `ValidationRules`\n * obey some common validation techniques when it comes to sanitizing a person\n * name. For this reason, the [Config.bypass] is set to `true` by default,\n * indicating that those predefined rules should be skipped for the sake of the\n * program.\n *\n * A programmer may leverage `Parser` to indicate business-tailored rules if he\n * or she wants this utility to perform those safety checks behind the scenes.\n *\n * A name error intends to provide useful information about what causes the error\n * and let the user take initiative on what happens next to the given name:\n * reconstructing it or skipping it.\n */\nexport class NameError extends Error {\n /**\n * Creates an error with a message describing the issue for a name source.\n * @param source name input that caused the error\n * @param message a message describing the failure.\n * @param type of `NameErrorType`\n */\n constructor(readonly source: NameSource, message?: string, readonly type: NameErrorType = NameErrorType.UNKNOWN) {\n super(message)\n this.name = 'NameError'\n }\n\n /**\n * The actual source input which caused the error.\n */\n get sourceAsString(): string {\n let input = ''\n if (!this.source) input = '<undefined>'\n if (typeof this.source === 'string') input = this.source\n if (isNameArray(this.source)) input = (this.source as Name[]).map((n) => n.toString()).join(' ')\n if (isStringArray(this.source)) input = (this.source as string[]).join(' ')\n return input\n }\n\n /**\n * Whether a message describing the failure exists.\n */\n get hasMessage(): boolean {\n return this.message && this.message.trim().length > 0\n }\n\n /**\n * Returns a string representation of the error.\n */\n toString(): string {\n let report = `${this.name} (${this.sourceAsString})`\n if (this.hasMessage) report = `${report}: ${this.message}`\n return report\n }\n}\n\n/**\n * An error thrown when a name source input is incorrect.\n *\n * A `Name` is a name for this utility under certain criteria (i.e., 2+ chars),\n * hence, a wrong input will cause this kind of error. Another common reason\n * may be a wrong key in a Json name parsing mechanism.\n *\n * Keep in mind that this error is different from a `ValidationError`.\n */\nexport class InputError extends NameError {\n /**\n * Creates a new `InputError` with an optional error `message`.\n *\n * The name source is by nature a string content, maybe wrapped up in a different\n * type. This string value may be extracted to form the following output:\n * \"InputError (stringName)\",\n * \"InputError (stringName): message\".\n */\n constructor(error: ErrorMessage) {\n super(error.source, error.message, NameErrorType.INPUT)\n this.name = 'InputError'\n }\n}\n\n/**\n * An error thrown to indicate that a name fails the validation rules.\n */\nexport class ValidationError extends NameError {\n /**\n * Name of the invalid `nameType` if available.\n */\n readonly nameType: string\n\n /**\n * Creates error containing the invalid `nameType` and a `message` that\n * briefly describes the problem if provided.\n *\n * For example, a validation error can be interpreted as:\n * \"ValidationError (nameType='stringName')\",\n * \"ValidationError (nameType='stringName'): message\"\n */\n constructor(error: ErrorMessage & { nameType: string }) {\n super(error.source, error.message, NameErrorType.VALIDATION)\n this.nameType = error.nameType\n this.name = 'ValidationError'\n }\n\n toString(): string {\n let report = `${this.name} (${this.nameType}='${this.sourceAsString}')`\n if (this.hasMessage) report = `${report}: ${this.message}`\n return report\n }\n}\n\n/**\n * Thrown by not allowed operations such as in name formatting.\n *\n * For example, this will occur when trying to format a name accordingly using\n * a non-supported key.\n */\nexport class NotAllowedError extends NameError {\n /**\n * The revoked operation name.\n */\n readonly operation: string\n\n /**\n * Creates a new `NotAllowedError` with an optional error `message` and the\n * `operation` name.\n *\n * For example, an error of this kind can be interpreted as:\n * \"NotAllowedError (stringName)\",\n * \"NotAllowedError (stringName) - operationName\",\n * \"NotAllowedError (stringName) - operationName: message\"\n */\n constructor(error: ErrorMessage & { operation: string }) {\n super(error.source, error.message, NameErrorType.NOT_ALLOWED)\n this.operation = error.operation\n this.name = 'NotAllowedError'\n }\n\n toString(): string {\n let report = `${this.name} (${this.sourceAsString})`\n if (this.operation && this.operation.trim().length > 0) report = `${report} - ${this.operation}`\n if (this.hasMessage) report = `${report}: ${this.message}`\n return report\n }\n}\n\n/**\n * A fallback error thrown by any unknown sources or unexpected failure that are\n * not of `NameError`.\n *\n * In this particular case, an `origin` remains useful as it provides details\n * on the sources and the true nature of the unexpected error.\n * At this point, deciding whether to exit the program or not depends on the\n * programmer.\n */\nexport class UnknownError extends NameError {\n /**\n * The possible unknown error, with trace revealing its source and reason.\n */\n readonly origin?: Error\n\n /**\n * Creates a new `UnknownError` with an optional error `message`.\n * Optionally, the original error revealing the true nature of the failure.\n */\n constructor(error: ErrorMessage & { error?: Error }) {\n super(error.source, error.message, NameErrorType.UNKNOWN)\n this.origin = error.error\n this.name = 'UnknownError'\n }\n\n toString(): string {\n let report = super.toString()\n if (this.origin) report += `\\n${this.origin.toString()}`\n return report\n }\n}\n","import { MIN_NUMBER_OF_NAME_PARTS, MAX_NUMBER_OF_NAME_PARTS } from './constants'\nimport { Name } from './name'\nimport { NameOrder, CapsRange } from './types'\n\n/**\n * A fixed set of values to handle specific positions for list of names.\n *\n * As for list of names, this helps to follow a specific order based on the\n * count of elements. It is expected that the list has to be between two and\n * five elements. Also, the order of appearance set in the configuration\n * influences how the parsing is carried out.\n *\n * Ordered by first name, the parser works as follows:\n * - 2 elements: firstName lastName\n * - 3 elements: firstName middleName lastName\n * - 4 elements: prefix firstName middleName lastName\n * - 5 elements: prefix firstName middleName lastName suffix\n *\n * Ordered by last name, the parser works as follows:\n * - 2 elements: lastName firstName\n * - 3 elements: lastName firstName middleName\n * - 4 elements: prefix lastName firstName middleName\n * - 5 elements: prefix lastName firstName middleName suffix\n *\n * For example, `Jane Smith` (ordered by first name) is expected to be indexed:\n * `['Jane', 'Smith']`.\n */\nexport class NameIndex {\n /**\n * The minimum number of parts in a list of names.\n */\n static get min(): number {\n return MIN_NUMBER_OF_NAME_PARTS\n }\n\n /**\n * The maximum number of parts in a list of names.\n */\n static get max(): number {\n return MAX_NUMBER_OF_NAME_PARTS\n }\n\n private constructor(\n readonly prefix: number,\n readonly firstName: number,\n readonly middleName: number,\n readonly lastName: number,\n readonly suffix: number,\n ) {}\n\n /**\n * The default or base indexing: firstName lastName.\n */\n static base(): NameIndex {\n return new this(-1, 0, -1, 1, -1)\n }\n\n /**\n * Gets the name index for a list of names based on the `count` of elements\n * and their `order` of appearance.\n */\n static when(order: NameOrder, count = 2): NameIndex {\n if (order === NameOrder.FIRST_NAME) {\n switch (count) {\n case 2: // first name + last name\n return new this(-1, 0, -1, 1, -1)\n case 3: // first name + middle name + last name\n return new this(-1, 0, 1, 2, -1)\n case 4: // prefix + first name + middle name + last name\n return new this(0, 1, 2, 3, -1)\n case 5: // prefix + first name + middle name + last name + suffix\n return new this(0, 1, 2, 3, 4)\n default:\n return NameIndex.base()\n }\n } else {\n switch (count) {\n case 2: // last name + first name\n return new this(-1, 1, -1, 0, -1)\n case 3: // last name + first name + middle name\n return new this(-1, 1, 2, 0, -1)\n case 4: // prefix + last name + first name + middle name\n return new this(0, 2, 3, 1, -1)\n case 5: // prefix + last name + first name + middle name + suffix\n return new this(0, 2, 3, 1, 4)\n default:\n return NameIndex.base()\n }\n }\n }\n}\n\n/**\n * Capitalizes a string via a `CapsRange` option.\n */\nexport function capitalize(str: string, range: CapsRange = CapsRange.INITIAL): string {\n if (!str || range === CapsRange.NONE) return str\n const initial = str[0].toUpperCase()\n const rest = str.slice(1).toLowerCase()\n return range === CapsRange.INITIAL ? initial.concat(rest) : str.toUpperCase()\n}\n\n/**\n * Decapitalizes a string via a `CapsRange` option.\n */\nexport function decapitalize(str: string, range: CapsRange = CapsRange.INITIAL): string {\n if (!str || range === CapsRange.NONE) return str\n const initial = str[0].toLowerCase()\n const rest = str.slice(1)\n return range === CapsRange.INITIAL ? initial.concat(rest) : str.toLowerCase()\n}\n\n/**\n * Toggles a string representation.\n */\nexport function toggleCase(str: string): string {\n const chars = []\n for (const c of str) {\n if (c === c.toUpperCase()) {\n chars.push(c.toLowerCase())\n } else {\n chars.push(c.toUpperCase())\n }\n }\n return chars.join('')\n}\n\nexport function isStringArray(value?: unknown): boolean {\n return Array.isArray(value) && value.length > 0 && value.every((e) => typeof e === 'string')\n}\n\nexport function isNameArray(value?: unknown): boolean {\n return Array.isArray(value) && value.length > 0 && value.every((e) => e instanceof Name)\n}\n","import { InputError } from './error'\nimport { CapsRange, Namon, Surname } from './types'\nimport { capitalize, decapitalize } from './utils'\n\n/**\n * Representation of a string type name with some extra capabilities.\n */\nexport class Name {\n private namon: string\n protected initial: string\n protected capsRange: CapsRange\n\n /**\n * Creates augmented names by adding extra functionality to a string name.\n * @param type must be indicated to categorize the name so it can be\n * treated accordingly.\n * @param capsRange determines how the name should be capitalized initially.\n */\n constructor(value: string, readonly type: Namon, capsRange?: CapsRange) {\n this.capsRange = capsRange ?? CapsRange.INITIAL\n this.value = value\n if (capsRange) this.caps(capsRange)\n }\n\n set value(newValue: string) {\n if (newValue.trim().length < 2) {\n throw new InputError({ source: newValue, message: 'must be 2+ characters' })\n }\n\n this.namon = newValue\n this.initial = newValue[0]\n }\n\n /**\n * The piece of string treated as a name.\n */\n get value(): string {\n return this.namon\n }\n\n /**\n * The length of the name.\n */\n get length(): number {\n return this.namon.length\n }\n\n /**\n * Whether the name is a prefix.\n */\n get isPrefix(): boolean {\n return this.type === Namon.PREFIX\n }\n\n /**\n * Whether the name is a first name.\n */\n get isFirstName(): boolean {\n return this.type === Namon.FIRST_NAME\n }\n\n /**\n * Whether the name is a middle name.\n */\n get isMiddleName(): boolean {\n return this.type === Namon.MIDDLE_NAME\n }\n\n /**\n * Whether the name is a last name.\n */\n get isLastName(): boolean {\n return this.type === Namon.LAST_NAME\n }\n\n /**\n * Whether the name is a suffix.\n */\n get isSuffix(): boolean {\n return this.type === Namon.SUFFIX\n }\n\n /**\n * Creates a prefix.\n */\n static prefix(value: string): Name {\n return new this(value, Namon.PREFIX)\n }\n\n /**\n * Creates a first name.\n */\n static first(value: string): Name {\n return new this(value, Namon.FIRST_NAME)\n }\n\n /**\n * Creates a middle name.\n */\n static middle(value: string): Name {\n return new this(value, Namon.MIDDLE_NAME)\n }\n\n /**\n * Creates a last name.\n */\n static last(value: string): Name {\n return new this(value, Namon.LAST_NAME)\n }\n\n /**\n * Creates a suffix.\n */\n static suffix(value: string): Name {\n return new this(value, Namon.SUFFIX)\n }\n\n /**\n * Gets the initials (first character) of this name.\n */\n initials(): string[] {\n return [this.initial]\n }\n\n /**\n * String representation of this object.\n */\n toString(): string {\n return this.namon\n }\n /**\n * Returns true if the other is equal to this name.\n */\n equal(other: Name | unknown): boolean {\n return other instanceof Name && other.value === this.value && other.type === this.type\n }\n\n /**\n * Capitalizes the name.\n */\n caps(range?: CapsRange): Name {\n this.value = capitalize(this.namon, range ?? this.capsRange)\n return this\n }\n\n /**\n * De-capitalizes the name.\n */\n decaps(range?: CapsRange): Name {\n this.value = decapitalize(this.namon, range ?? this.capsRange)\n return this\n }\n}\n\n/**\n * Representation of a first name with some extra functionality.\n */\nexport class FirstName extends Name {\n private _more: string[]\n\n /**\n * Creates an extended version of `Name` and flags it as a first name `type`.\n *\n * Some may consider `more` additional name parts of a given name as their\n * first names, but not as their middle names. Though, it may mean the same,\n * `more` provides the freedom to do it as it pleases.\n */\n constructor(value: string, ...more: string[]) {\n super(value, Namon.FIRST_NAME)\n\n for (const name of more) {\n if (name.trim().length < 2) {\n throw new InputError({ source: name, message: 'must be 2+ characters' })\n }\n }\n this._more = more\n }\n\n /**\n * Determines whether a first name has `more` name parts.\n */\n get hasMore(): boolean {\n return this._more.length > 0\n }\n\n get length(): number {\n return super.length + (this.hasMore ? this._more.reduce((acc, n) => acc + n).length : 0)\n }\n\n /**\n * Returns a combined version of the `value` and `more` if any.\n */\n get asNames(): Name[] {\n const names: Name[] = [Name.first(this.value)]\n if (this.hasMore) {\n names.push(...this._more.map((n) => Name.first(n)))\n }\n return names\n }\n\n /**\n * The additional name parts of the first name.\n */\n get more(): string[] {\n return this._more\n }\n\n toString(withMore = false): string {\n return withMore && this.hasMore ? `${this.value} ${this._more.join(' ')}`.trim() : this.value\n }\n\n initials(withMore = false): string[] {\n const inits: string[] = [this.initial]\n if (withMore && this.hasMore) {\n inits.push(...this._more.map((n) => n[0]))\n }\n return inits\n }\n\n caps(range?: CapsRange): FirstName {\n range = range || this.capsRange\n this.value = capitalize(this.value, range)\n if (this.hasMore) this._more = this._more.map((n) => capitalize(n, range))\n return this\n }\n\n decaps(range?: CapsRange): FirstName {\n range = range || this.capsRange\n this.value = decapitalize(this.value, range)\n if (this.hasMore) this._more = this._more.map((n) => decapitalize(n, range))\n return this\n }\n\n /**\n * Makes a copy of the current name.\n */\n copyWith(values?: { first?: string; more?: string[] }): FirstName {\n return new FirstName(values.first ?? this.value, ...(values.more ?? this._more))\n }\n}\n\n/**\n * Representation of a last name with some extra functionality.\n */\nexport class LastName extends Name {\n private _mother?: string\n\n /**\n * Creates an extended version of `Name` and flags it as a last name `type`.\n *\n * Some people may keep their `mother`'s surname and want to keep a clear cut\n * from their `father`'s surname. However, there are no clear rules about it.\n */\n constructor(father: string, mother?: string, readonly format = Surname.FATHER) {\n super(father, Namon.LAST_NAME)\n\n if (mother && mother.trim().length < 2) {\n throw new InputError({ source: mother, message: 'must be 2+ characters' })\n }\n this._mother = mother\n }\n\n /**\n * The surname inherited from a father side.\n */\n get father(): string {\n return this.value\n }\n\n /**\n * The surname inherited from a mother side.\n */\n get mother(): string | undefined {\n return this._mother\n }\n\n /**\n * Returns `true` if the mother's surname is defined.\n */\n get hasMother(): boolean {\n return !!this._mother\n }\n\n get length(): number {\n return super.length + (this._mother?.length ?? 0)\n }\n\n /**\n * Returns a combined version of the `father` and `mother` if any.\n */\n get asNames(): Name[] {\n const names: Name[] = [Name.last(this.value)]\n if (this.hasMother) {\n names.push(Name.last(this._mother))\n }\n return names\n }\n\n toString(format?: Surname): string {\n format = format ?? this.format\n switch (format) {\n case Surname.FATHER:\n return this.value\n case Surname.MOTHER:\n return this.mother ?? ''\n case Surname.HYPHENATED:\n return this.hasMother ? `${this.value}-${this._mother}` : this.value\n case Surname.ALL:\n return this.hasMother ? `${this.value} ${this._mother}` : this.value\n }\n }\n\n initials(format?: Surname): string[] {\n format = format || this.format\n const inits: string[] = []\n switch (format) {\n case Surname.MOTHER:\n if (this.hasMother) inits.push(this._mother[0])\n break\n case Surname.HYPHENATED:\n case Surname.ALL:\n inits.push(this.initial)\n if (this.hasMother) inits.push(this._mother[0])\n break\n case Surname.FATHER:\n default:\n inits.push(this.initial)\n }\n return inits\n }\n\n caps(range?: CapsRange): LastName {\n range = range || this.capsRange\n this.value = capitalize(this.value, range)\n if (this.hasMother) this._mother = capitalize(this._mother, range)\n return this\n }\n\n decaps(range?: CapsRange): LastName {\n range = range || this.capsRange\n this.value = decapitalize(this.value, range)\n if (this.hasMother) this._mother = decapitalize(this._mother, range)\n return this\n }\n\n /**\n * Makes a copy of the current name.\n */\n copyWith(values?: { father?: string; mother?: string; format?: Surname }): LastName {\n return new LastName(values.father ?? this.value, values.mother ?? this.mother, values.format ?? this.format)\n }\n}\n\n/**\n * JSON signature for `FullName` data.\n */\nexport interface JsonName {\n prefix?: string\n firstName: string\n middleName?: string[]\n lastName: string\n suffix?: string\n}\n","import { NameOrder, Separator, Title, Surname } from './types'\n\nconst defaultName = 'default'\nconst copyAlias = '_copy'\n\n/**\n * The Configuration to use across the other components.\n *\n * The multiton pattern is used to handle configurations across the `namefully`\n * setup. This adds consistency when building other components such as `FirstName`,\n * `LastName`, or `Name` of distinct types that may be of particular shapes.\n *\n * For example, a person's `FullName` may appear by:\n * - NameOrder.FIRST_NAME: `Jon Snow` or\n * - NameOrder.LAST_NAME: `Snow Jon`.\n *\n * `Config` makes it easy to set up a specific configuration for `Namefully`\n * and reuse it through other instances or components along the way. If a new\n * `Config` is needed, a named configuration may be created. It is actually\n * advised to use named `Config.create(name)` instead as it may help mitigate issues\n * and avoid confusion and ambiguity in the future. Plus, a named configuration\n * explains its purpose.\n *\n * ```ts\n * const defaultConfig = Config.create();\n * const mergedConfig = Config.merge({ name: 'other', title: Title.US });\n * const copyConfig = mergedConfig.copyWith({ ending: true });\n * ```\n *\n * Additionally, a configuration may be merged with or copied from an existing\n * configuration, prioritizing the new one's values, as shown in the example\n * above.\n */\nexport class Config {\n private _name: string\n private _orderedBy: NameOrder\n private _separator: Separator\n private _title: Title\n private _ending: boolean\n private _bypass: boolean\n private _surname: Surname\n\n /**\n * Cache for multiple instances.\n */\n private static cache = new Map<string, Config>()\n\n /**\n * The order of appearance of a full name.\n */\n get orderedBy(): NameOrder {\n return this._orderedBy\n }\n\n /**\n * The token used to indicate how to split string values.\n */\n get separator(): Separator {\n return this._separator\n }\n\n /**\n * The abbreviation type to indicate whether or not to add period to a prefix\n * using the American or British way.\n */\n get title(): Title {\n return this._title\n }\n\n /**\n * The option indicating if an ending suffix is used in a formal way.\n */\n get ending(): boolean {\n return this._ending\n }\n\n /**\n * A bypass of the validation rules with this option. This option is ideal\n * to avoid checking their validity.\n */\n get bypass(): boolean {\n return this._bypass\n }\n\n /**\n * An option indicating how to format a surname.\n *\n * The supported formats are:\n * - `FATHER` name only\n * - `MOTHER` name only\n * - `HYPHENATED`, joining both father and mother names with a hyphen\n * - `ALL`, joining both father and mother names with a space.\n *\n * Note that this option can be set when creating a `LastName`. As this can\n * become ambiguous at the time of handling it, the value set in this is\n * prioritized and viewed as the source of truth for future considerations.\n */\n get surname(): Surname {\n return this._surname\n }\n\n /**\n * The name of the cached configuration.\n */\n get name(): string {\n return this._name\n }\n\n private constructor(\n name: string,\n orderedBy = NameOrder.FIRST_NAME,\n separator = Separator.SPACE,\n title = Title.UK,\n ending = false,\n bypass = true,\n surname = Surname.FATHER,\n ) {\n this._name = name\n this._orderedBy = orderedBy\n this._separator = separator\n this._title = title\n this._ending = ending\n this._bypass = bypass\n this._surname = surname\n }\n\n /**\n * Returns a named configuration with default values.\n * @param name describing its purpose.\n */\n static create(name = defaultName): Config {\n if (!Config.cache.has(name)) {\n Config.cache.set(name, new this(name))\n }\n return Config.cache.get(name)\n }\n\n /**\n * Returns a combined version of the existing values of the default configuration\n * and the provided optional values of another configuration.\n * @param other partial config to be combined with.\n */\n static merge(other?: Partial<Config>): Config {\n if (!other) {\n return Config.create()\n } else {\n const config = Config.create(other.name)\n config._orderedBy = other.orderedBy ?? config.orderedBy\n config._separator = other.separator ?? config.separator\n config._title = other.title ?? config.title\n config._ending = other.ending ?? config.ending\n config._bypass = other.bypass ?? config.bypass\n config._surname = other.surname ?? config.surname\n return config\n }\n }\n\n /**\n * Returns a copy of this configuration merged with the provided values.\n *\n * The word `_copy` is added to the existing config's name to create the new\n * config's name if the name already exists for previous configurations. This\n * is useful to maintain the uniqueness of each configuration. For example,\n * if the new copy is made from the default configuration, this new copy will\n * be named `default_copy`.\n */\n copyWith(options: Partial<Config> = {}): Config {\n const { name, orderedBy, separator, title, ending, bypass, surname } = options\n const config = Config.create(this.genNewName(name ?? this.name + copyAlias))\n config._orderedBy = orderedBy ?? this.orderedBy\n config._separator = separator ?? this.separator\n config._title = title ?? this.title\n config._ending = ending ?? this.ending\n config._bypass = bypass ?? this.bypass\n config._surname = surname ?? this.surname\n return config\n }\n\n /**\n * Makes an exact copy of the current configuration.\n */\n clone(): Config {\n return this.copyWith()\n }\n\n /**\n * Resets the configuration by setting it back to its default values.\n */\n reset(): void {\n this._orderedBy = NameOrder.FIRST_NAME\n this._separator = Separator.SPACE\n this._title = Title.UK\n this._ending = false\n this._bypass = true\n this._surname = Surname.FATHER\n Config.cache.set(this.name, this)\n }\n\n /**\n * Alters the name order between the first and last name, and rearrange the\n * order of appearance of a name set.\n */\n updateOrder(order: NameOrder): void {\n if (order && order !== this._orderedBy) {\n Config.cache.get(this.name)._orderedBy = order\n }\n }\n\n /**\n * Generates a unique new name.\n */\n private genNewName(name: string): string {\n return name === this.name || Config.cache.has(name) ? this.genNewName(name + copyAlias) : name\n }\n}\n","export const version = '1.2.0'\nexport const MIN_NUMBER_OF_NAME_PARTS = 2\nexport const MAX_NUMBER_OF_NAME_PARTS = 5\nexport const ALLOWED_TOKENS = [\n '.',\n ',',\n ' ',\n '-',\n '_',\n 'b',\n 'B',\n 'f',\n 'F',\n 'l',\n 'L',\n 'm',\n 'M',\n 'n',\n 'N',\n 'o',\n 'O',\n 'p',\n 'P',\n 's',\n 'S',\n '$',\n]\n","import { Config } from './config'\nimport { NameError, UnknownError } from './error'\nimport { FirstName, LastName, Name, JsonName } from './name'\nimport { Nullable, Namon, Title } from './types'\nimport { Validators } from './validator'\n\n/**\n * The core component of this utility.\n *\n * This component is comprised of five entities that make it easy to handle a\n * full name set: prefix, first name, middle name, last name, and suffix.\n * This class is intended for internal processes. However, it is understandable\n * that it might be needed at some point for additional purposes. For this reason,\n * it's made available.\n *\n * It is recommended to avoid using this class unless it is highly necessary or\n * a custom parser is used for uncommon use cases. This utility tries to cover\n * as many use cases as possible.\n *\n * Additionally, an optional configuration can be used to indicate some specific\n * behaviors related to that name handling.\n */\nexport class FullName {\n private _prefix: Nullable<Name>\n private _firstName: FirstName\n private _middleName: Name[] = []\n private _lastName: LastName\n private _suffix: Nullable<Name>\n private _config: Config\n\n /**\n * Creates a full name as it goes\n * @param options optional configuration for additional features.\n */\n constructor(options?: Partial<Config>) {\n this._config = Config.merge(options)\n }\n\n /**\n * A snapshot of the configuration used to set up this full name.\n */\n get config(): Config {\n return this._config\n }\n\n /**\n * The prefix part of the full name.\n */\n get prefix(): Nullable<Name> {\n return this._prefix\n }\n\n /**\n * The first name part of the full name.\n */\n get firstName(): FirstName {\n return this._firstName\n }\n\n /**\n * The last name part of the full name.\n */\n get lastName(): LastName {\n return this._lastName\n }\n\n /**\n * The middle name part of the full name.\n */\n get middleName(): Name[] {\n return this._middleName\n }\n\n /**\n * The suffix part of the full name.\n */\n get suffix(): Nullable<Name> {\n return this._suffix\n }\n\n /**\n * Parses a json name into a full name.\n * @param json parsable name element\n * @param config optional configuration for additional features.\n */\n static parse(json: JsonName, config?: Config): FullName {\n try {\n const fullName = new FullName(config)\n fullName.setPrefix(json.prefix)\n fullName.setFirstName(json.firstName)\n fullName.setMiddleName(json.middleName)\n fullName.setLastName(json.lastName)\n fullName.setSuffix(json.suffix)\n return fullName\n } catch (error) {\n if (error instanceof NameError) {\n throw error\n } else {\n throw new UnknownError({\n source: Object.values(json).join(' '),\n message: 'could not parse JSON content',\n error,\n })\n }\n }\n }\n\n setPrefix(name: Nullable<string | Name>): FullName {\n if (!name) return this\n if (!this._config.bypass) Validators.prefix.validate(name)\n const prefix = name instanceof Name ? name.value : name\n this._prefix = Name.prefix(this._config.title === Title.US ? `${prefix}.` : prefix)\n return this\n }\n\n setFirstName(name: string | FirstName): FullName {\n if (!this._config.bypass) Validators.firstName.validate(name)\n this._firstName = name instanceof FirstName ? name : new FirstName(name)\n return this\n }\n\n setLastName(name: string | LastName): FullName {\n if (!this._config.bypass) Validators.lastName.validate(name)\n this._lastName = name instanceof LastName ? name : new LastName(name)\n return this\n }\n\n setMiddleName(names: string[] | Name[]): FullName {\n if (!Array.isArray(names)) return\n if (!this._config.bypass) Validators.middleName.validate(names)\n this._middleName = (names as Array<string | Name>).map((name) =>\n name instanceof Name ? name : Name.middle(name),\n )\n return this\n }\n\n setSuffix(name: Nullable<string | Name>): FullName {\n if (!name) return this\n if (!this._config.bypass) Validators.suffix.validate(name)\n this._suffix = Name.suffix(name instanceof Name ? name.value : name)\n return this\n }\n\n /**\n * Returns true if a namon has been set.\n */\n has(namon: Namon): boolean {\n if (namon.equal(Namon.PREFIX)) return !!this._prefix\n if (namon.equal(Namon.SUFFIX)) return !!this._suffix\n return namon.equal(Namon.MIDDLE_NAME) ? this._middleName.length > 0 : true\n }\n}\n","import { MIN_NUMBER_OF_NAME_PARTS, MAX_NUMBER_OF_NAME_PARTS } from './constants'\nimport { InputError, ValidationError } from './error'\nimport { FirstName, LastName, Name } from './name'\nimport { Namon } from './types'\nimport { NameIndex } from './utils'\n\n/**\n * Represents a set of validation rules (regex)\n *\n * This regex is intented to match specific alphabets only as a person name does\n * not contain special characters. `\\w` does not cover non-Latin characters. So,\n * it is extended using unicode chars to cover more cases (e.g., Icelandic).\n * It matches as follows:\n * [a-z]: Latin alphabet from a (index 97) to z (index 122)\n * [A-Z]: Latin alphabet from A (index 65) to Z (index 90)\n * [\\u00C0-\\u00D6]: Latin/German chars from À (index 192) to Ö (index 214)\n * [\\u00D8-\\u00f6]: German/Icelandic chars from Ø (index 216) to ö (index 246)\n * [\\u00f8-\\u00ff]: German/Icelandic chars from ø (index 248) to ÿ (index 255)\n * [\\u0400-\\u04FF]: Cyrillic alphabet from Ѐ (index 1024) to ӿ (index 1279)\n * [Ά-ωΑ-ώ]: Greek alphabet from Ά (index 902) to ω (index 969)\n */\nclass ValidationRule {\n static base: RegExp = /[a-zA-Z\\u00C0-\\u00D6\\u00D8-\\u00f6\\u00f8-\\u00ff\\u0400-\\u04FFΆ-ωΑ-ώ]/\n\n /**\n * Matches one name part (namon) that is of nature:\n * - Latin (English, Spanish, French, etc.)\n * - European (Greek, Cyrillic, Icelandic, German)\n * - hyphenated\n * - with apostrophe\n * - with space\n */\n static namon: RegExp = new RegExp(\n `^${ValidationRule.base.source}+(([' -]${ValidationRule.base.source})?${ValidationRule.base.source}*)*$`,\n )\n\n /**\n * Matches one name part (namon) that is of nature:\n * - Latin (English, Spanish, French, etc.)\n * - European (Greek, Cyrillic, Icelandic, German)\n * - hyphenated\n * - with apostrophe\n */\n static firstName: RegExp = ValidationRule.namon\n\n /**\n * Matches 1+ names part (namon) that are of nature:\n * - Latin (English, Spanish, French, etc.)\n * - European (Greek, Cyrillic, Icelandic, German)\n * - hyphenated\n * - with apostrophe\n * - with space\n */\n static middleName: RegExp = new RegExp(\n `^${ValidationRule.base.source}+(([' -]${ValidationRule.base.source})?${ValidationRule.base.source}*)*$`,\n )\n\n /**\n * Matches one name part (namon) that is of nature:\n * - Latin (English, Spanish, French, etc.)\n * - European (Greek, Cyrillic, Icelandic, German)\n * - hyphenated\n * - with apostrophe\n * - with space\n */\n static lastName: RegExp = ValidationRule.namon\n}\n\nexport interface Validator<T> {\n validate(value: T): void\n}\n\nclass ArrayValidator<T extends string | Name> implements Validator<T[]> {\n validate(values: T[]): void {\n if (\n values.length === 0 ||\n values.length < MIN_NUMBER_OF_NAME_PARTS ||\n values.length > MAX_NUMBER_OF_NAME_PARTS\n ) {\n throw new InputError({\n source: values.map((n) => n.toString()),\n message: `expecting a list of ${MIN_NUMBER_OF_NAME_PARTS}-${MIN_NUMBER_OF_NAME_PARTS} elements`,\n })\n }\n }\n}\n\nclass NamonValidator implements Validator<string | Name> {\n private static validator: NamonValidator\n private constructor() {}\n static create(): NamonValidator {\n return this.validator || (this.validator = new this())\n }\n\n validate(value: string | Name, type?: Namon): void {\n if (value instanceof Name) {\n NameValidator.create().validate(value, type)\n } else if (typeof value === 'string') {\n if (!ValidationRule.namon.test(value)) {\n throw new ValidationError({\n source: value,\n nameType: 'namon',\n message: 'invalid content',\n })\n }\n } else {\n throw new InputError({\n source: typeof value,\n message: 'expecting types of string | Name',\n })\n }\n }\n}\n\nclass FirstNameValidator implements Validator<string | FirstName> {\n private static validator: FirstNameValidator\n private constructor() {}\n static create(): FirstNameValidator {\n return this.validator || (this.validator = new this())\n }\n\n validate(value: string | FirstName): void {\n if (value instanceof FirstName) {\n value.asNames.forEach((name) => this.validate(name.value))\n } else if (typeof value === 'string') {\n if (!ValidationRule.firstName.test(value)) {\n throw new ValidationError({\n source: value,\n nameType: 'firstName',\n message: 'invalid content',\n })\n }\n } else {\n throw new InputError({\n source: typeof value,\n message: 'expecting types string | FirstName',\n })\n }\n }\n}\n\nclass MiddleNameValidator implements Validator<string | string[] | Name[]> {\n private static validator: MiddleNameValidator\n private constructor() {}\n static create(): MiddleNameValidator {\n return this.validator || (this.validator = new this())\n }\n\n validate(value: string | string[] | Name[]): void {\n if (typeof value === 'string') {\n if (!ValidationRule.middleName.test(value)) {\n throw new ValidationError({\n source: value,\n nameType: 'middleName',\n message: 'invalid content',\n })\n }\n } else if (Array.isArray(value)) {\n try {\n const validator = NamonValidator.create()\n for (const name of value) validator.validate(name, Namon.MIDDLE_NAME)\n } catch (error) {\n throw new ValidationError({\n source: value,\n nameType: 'middleName',\n message: error?.message,\n })\n }\n } else {\n throw new InputError({\n source: typeof value,\n message: 'expecting types of string | string[] | Name[]',\n })\n }\n }\n}\n\nclass LastNameValidator implements Validator<string | LastName> {\n private static validator: LastNameValidator\n private constructor() {}\n static create(): LastNameValidator {\n return this.validator || (this.validator = new this())\n }\n\n validate(value: string | LastName): void {\n if (value instanceof LastName) {\n value.asNames.forEach((name) => this.validate(name.value))\n } else if (typeof value === 'string') {\n if (!ValidationRule.lastName.test(value)) {\n throw new ValidationError({\n source: value,\n nameType: 'lastName',\n message: 'invalid content',\n })\n }\n } else {\n throw new InputError({\n source: typeof value,\n message: 'expecting types string | LastName',\n })\n }\n }\n}\n\nclass NameValidator implements Validator<Name> {\n private static validator: NameValidator\n private constructor() {}\n static create(): NameValidator {\n return this.validator || (this.validator = new this())\n }\n\n validate(name: Name, type?: Namon): void {\n if (type && name.type !== type) {\n throw new ValidationError({\n source: [name],\n nameType: name.type.toString(),\n message: 'wrong type',\n })\n }\n\n if (!ValidationRule.namon.test(name.value)) {\n throw new ValidationError({\n source: [name],\n nameType: name.type.toString(),\n message: 'invalid content',\n })\n }\n }\n}\n\nexport class NamaValidator implements Validator<Map<Namon, string>> {\n private static validator: NamaValidator\n private constructor() {}\n static create(): NamaValidator {\n return this.validator || (this.validator = new this())\n }\n\n validate(value: Map<Namon, string>): void {\n this.validateKeys(value)\n Validators.firstName.validate(value.get(Namon.FIRST_NAME))\n Validators.lastName.validate(value.get(Namon.LAST_NAME))\n\n if (value.has(Namon.PREFIX)) {\n Validators.namon.validate(value.get(Namon.PREFIX))\n }\n if (value.has(Namon.SUFFIX)) {\n Validators.namon.validate(value.get(Namon.SUFFIX))\n }\n }\n\n validateKeys(nama: Map<Namon, string>): void {\n if (!nama.size) {\n throw new InputError({ source: undefined, message: 'Map<k,v> must not be empty' })\n } else if (nama.size < MIN_NUMBER_OF_NAME_PARTS || nama.size > MAX_NUMBER_OF_NAME_PARTS) {\n throw new InputError({\n source: [...nama.values()],\n message: `expecting ${MIN_NUMBER_OF_NAME_PARTS}-${MIN_NUMBER_OF_NAME_PARTS} fields`,\n })\n }\n\n if (!nama.has(Namon.FIRST_NAME)) {\n throw new InputError({\n source: [...nama.values()],\n message: '\"firstName\" is a required key',\n })\n }\n\n if (!nama.has(Namon.LAST_NAME)) {\n throw new InputError({\n source: [...nama.values()],\n message: '\"lastName\" is a required key',\n })\n }\n }\n}\n\nexport class ArrayStringValidator extends ArrayValidator<string> {\n constructor(readonly index = NameIndex.base()) {\n super()\n }\n\n validate(values: string[]): void {\n this.validateIndex(values)\n\n switch (values.length) {\n case 2:\n Validators.firstName.validate(values[this.index.firstName])\n Validators.lastName.validate(values[this.index.lastName])\n break\n case 3:\n Validators.firstName.validate(values[this.index.firstName])\n Validators.middleName.validate(values[this.index.middleName])\n Validators.lastName.validate(values[this.index.lastName])\n break\n case 4:\n Validators.namon.validate(values[this.index.prefix])\n Validators.firstName.validate(values[this.index.firstName])\n Validators.middleName.validate(values[this.index.middleName])\n Validators.lastName.validate(values[this.index.lastName])\n break\n case 5:\n Validators.namon.validate(values[this.index.prefix])\n Validators.firstName.validate(values[this.index.firstName])\n Validators.middleName.validate(values[this.index.middleName])\n Validators.lastName.validate(values[this.index.lastName])\n Validators.namon.validate(values[this.index.suffix])\n break\n }\n }\n\n validateIndex(values: string[]): void {\n super.validate(values)\n }\n}\n\nexport class ArrayNameValidator implements Validator<Name[]> {\n private static validator: ArrayNameValidator\n private constructor() {}\n static create(): ArrayNameValidator {\n return this.validator || (this.validator = new this())\n }\n\n validate(value: Name[]): void {\n if (value.length < MIN_NUMBER_OF_NAME_PARTS) {\n throw new InputError({\n source: value,\n message: `expecting at least ${MIN_NUMBER_OF_NAME_PARTS} elements`,\n })\n }\n\n if (!this.hasBasicNames(value)) {\n throw new InputError({\n source: value,\n message: 'both first and last names are required',\n })\n }\n }\n\n private hasBasicNames(names: Name[]): boolean {\n const accumulator: { [key: string]: string } = {}\n for (const name of names) {\n if (name.isFirstName || name.isLastName) {\n accumulator[name.type.key] = name.toString()\n }\n }\n return Object.keys(accumulator).length === MIN_NUMBER_OF_NAME_PARTS\n }\n}\n\n/**\n * A list of validators for a specific namon.\n */\nexport abstract class Validators {\n static namon = NamonValidator.create()\n static nama = NamaValidator.create()\n static prefix = NamonValidator.create()\n static firstName = FirstNameValidator.create()\n static middleName = MiddleNameValidator.create()\n static lastName = LastNameValidator.create()\n static suffix = NamonValidator.create()\n}\n","import { FullName } from './full-name'\nimport { Config } from './config'\nimport { NameIndex } from './utils'\nimport { ArrayStringValidator, ArrayNameValidator, NamaValidator } from './validator'\nimport { FirstName, LastName, Name, JsonName } from './name'\nimport { Namon, Nullable, Separator } from './types'\nimport { InputError } from './error'\n\n/**\n * A parser signature that helps to organize the names accordingly.\n */\nexport abstract class Parser<T = any> {\n /**\n * Constructs a custom parser accordingly.\n * @param raw data to be parsed\n */\n constructor(public raw: T) {}\n\n /**\n * Builds a dynamic `Parser` on the fly and throws a `NameError` when unable\n * to do so. The built parser only knows how to operate birth names.\n */\n static build(text: string): Parser {\n const parts = text.trim().split(Separator.SPACE.token)\n const length = parts.length\n if (length === 0 || length === 1) {\n throw new InputError({\n source: text,\n message: 'cannot build from invalid input',\n })\n } else if (length === 2 || length === 3) {\n return new StringParser(text)\n } else {\n const last = parts.pop()\n const [first, ...middles] = parts\n return new ArrayStringParser([first, middles.join(' '), last])\n }\n }\n\n /**\n * Builds asynchronously a dynamic `Parser`.\n */\n static buildAsync(text: string): Promise<Parser> {\n try {\n return Promise.resolve(Parser.build(text))\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n /**\n * Parses the raw data into a `FullName` while considering some options.\n * @param options additional configuration to apply.\n */\n abstract parse(options?: Partial<Config>): FullName\n}\n\nexport class StringParser extends Parser<string> {\n constructor(raw: string) {\n super(raw)\n }\n\n parse(options: Partial<Config>): FullName {\n const config = Config.merge(options)\n const names = this.raw.split(config.separator.token)\n return new ArrayStringParser(names).parse(options)\n }\n}\n\nexport class ArrayStringParser extends Parser<string[]> {\n constructor(raw: string[]) {\n super(raw)\n }\n\n parse(options: Partial<Config>): FullName {\n const config = Config.merge(options)\n const fullName = new FullName(config)\n\n const raw = this.raw.map((n) => n.trim())\n const index = NameIndex.when(config.orderedBy, raw.length)\n const validator = new ArrayStringValidator(index)\n\n if (config.bypass) {\n validator.validateIndex(raw)\n } else {\n validator.validate(raw)\n }\n\n switch (raw.length) {\n case 2:\n fullName.setFirstName(new FirstName(raw[index.firstName]))\n fullName.setLastName(new LastName(raw[index.lastName]))\n break\n case 3:\n fullName.setFirstName(new FirstName(raw[index.firstName]))\n fullName.setMiddleName(this.split(raw[index.middleName], config))\n fullName.setLastName(new LastName(raw[index.lastName]))\n break\n case 4:\n fullName.setPrefix(Name.prefix(raw[index.prefix]))\n fullName.setFirstName(new FirstName(raw[index.firstName]))\n fullName.setMiddleName(this.split(raw[index.middleName], config))\n fullName.setLastName(new LastName(raw[index.lastName]))\n break\n case 5:\n fullName.setPrefix(Name.prefix(raw[index.prefix]))\n fullName.setFirstName(new FirstName(raw[index.firstName]))\n fullName.setMiddleName(this.split(raw[index.middleName], config))\n fullName.setLastName(new LastName(raw[index.lastName]))\n fullName.setSuffix(Name.suffix(raw[index.suffix]))\n break\n }\n return fullName\n }\n\n private split(raw: string, config: Config): Name[] {\n return raw.split(config.separator.token).map((name) => Name.middle(name))\n }\n}\n\nexport class NamaParser extends Parser<JsonName> {\n constructor(raw: JsonName) {\n super(raw)\n }\n\n parse(options: Partial<Config>): FullName {\n const config = Config.merge(options)\n\n if (config.bypass) {\n NamaValidator.create().validateKeys(this.asNama())\n } else {\n NamaValidator.create().validate(this.asNama())\n }\n\n return FullName.parse(this.raw, config)\n }\n\n private asNama(): Map<Namon, string> {\n return new Map<Namon, string>(\n Object.entries(this.raw).map(([key, value]) => {\n const namon: Nullable<Namon> = Namon.cast(key)\n if (!namon) {\n throw new InputError({\n source: Object.values(this.raw).join(' '),\n message: `unsupported key \"${key}\"`,\n })\n }\n return [namon, value as string]\n }),\n )\n }\n}\n\nexport class ArrayNameParser extends Parser<Name[]> {\n constructor(raw: Name[]) {\n super(raw)\n }\n\n parse(options: Partial<Config>): FullName {\n const config = Config.merge(options)\n const fullName = new FullName(config)\n\n ArrayNameValidator.create().validate(this.raw)\n\n for (const name of this.raw) {\n if (name.isPrefix) {\n fullName.setPrefix(name)\n } else if (name.isSuffix) {\n fullName.setSuffix(name)\n } else if (name.isFirstName) {\n fullName.setFirstName(name instanceof FirstName ? name : new FirstName(name.value))\n } else if (name.isMiddleName) {\n fullName.middleName.push(name)\n } else if (name.isLastName) {\n const lastName = new LastName(\n name.value,\n name instanceof LastName ? name.mother : undefined,\n config.surname,\n )\n fullName.setLastName(lastName)\n }\n }\n return fullName\n }\n}\n","/**\n * Welcome to namefully!\n *\n * `namefully` is a JavaScript utility for handing person names.\n *\n * Sources\n * - repo: https://github.com/ralflorent/namefully\n * - docs: https://namefully.netlify.app\n * - npm: https://npmjs.com/package/namefully\n *\n * @license MIT\n */\nexport * from './config'\nexport * from './error'\nexport * from './full-name'\nexport * from './name'\nexport * from './namefully'\nexport { Parser } from './parser'\nexport * from './types'\nexport { NameIndex } from './utils'\n","import { Config } from './config'\nimport { ALLOWED_TOKENS } from './constants'\nimport { InputError, NotAllowedError } from './error'\nimport { FullName } from './full-name'\nimport { Name, JsonName } from './name'\nimport { ArrayNameParser, ArrayStringParser, NamaParser, Parser, StringParser } from './parser'\nimport { Flat, NameOrder, NameType, Namon, Nullable, Surname } from './types'\nimport { capitalize, decapitalize, isNameArray, isStringArray, toggleCase } from './utils'\n\n/**\n * A helper for organizing person names in a particular order, way, or shape.\n *\n * Though `namefully` is easy to use, it does not magically guess which part of\n * the name is what (prefix, suffix, first, last, or middle names). It relies\n * actually on how the name parts are indicated (i.e., their roles) so that\n * it can perform internally certain operations and saves us some extra\n * calculations/processing. In addition, `Namefully` can be created using\n * distinct raw data shapes. This is intended to give some flexibility to the\n * developer so that he or she is not bound to a particular data format.\n * By following closely the API reference to know how to harness its usability,\n * this utility aims to save time in formatting names.\n *\n * `namefully` also works like a trapdoor. Once a raw data is provided and\n * validated, a developer can only *access* in a vast amount of, yet effective\n * ways the name info. *No editing* is possible. If the name is mistaken, a new\n * instance of `Namefully` must be created. In other words, it's immutable.\n * Remember, this utility's primary objective is to help manipulate a person name.\n *\n * Note that the name standards used for the current version of this library\n * are as follows:\n * `[prefix] firstName [middleName] lastName [suffix]`\n * The opening `[` and closing `]` symbols mean that these parts are optional.\n * In other words, the most basic and typical case is a name that looks like\n * this: `John Smith`, where `John` is the first name piece and `Smith`, the last\n * name piece.\n *\n * @see https://departments.weber.edu/qsupport&training/Data_Standards/Name.htm\n * for more info on name standards.\n *\n * **IMPORTANT**: Keep in mind that the order of appearance (or name order) matters\n * and may be altered through configured parameters, which will be seen later.\n * By default, the order of appearance is as shown above and will be used as a\n * basis for future examples and use cases.\n *\n * Once imported, all that is required to do is to create an instance of\n * `Namefully` and the rest will follow.\n *\n * Some terminologies used across the library are:\n * - namon: 1 piece of name (e.g., first name)\n * - nama: 2+ pieces of name (e.g., first name + last name)\n *\n * Happy name handling 😊!\n */\nexport class Namefully {\n /**\n * A copy of high-quality name data.\n */\n private _fullName: FullName\n\n /**\n * A copy of the default configuration (combined with a custom one if any).\n */\n private _config: Config\n\n /**\n * Creates a name with distinguishable parts from a raw string content.\n * @param names element to parse.\n * @param options additional settings.\n *\n * An optional configuration may be provided with specifics on how to treat\n * a full name during its course. By default, all name parts are validated\n * against some basic validation rules to avoid common runtime exceptions.\n */\n constructor(names: string | string[] | Name[] | JsonName | Parser, options?: Partial<Config>) {\n this.build(this.toParser(names), options)\n }\n\n /**\n * Constructs a `Namefully` instance from a text.\n *\n * It works like `parse` except that this function returns `null` where `parse`\n * would throw a `NameError`.\n */\n static tryParse(text: string): Namefully | undefined {\n try {\n return new this(Parser.build(text))\n } catch (error) {\n return undefined\n }\n }\n\n /**\n * Constructs a `Namefully` instance from a text.\n *\n * It throws a `NameError` if the text cannot be parsed. Use `tryParse`\n * instead if a `null` return is preferred over a throwable error.\n *\n * This operation is computed asynchronously, which gives more flexibility at\n * the time of catching the error (and stack trace if any). The acceptable\n * text format is a string composed of two or more name pieces. For instance,\n * `John Lennon`, or `John Winston Ono Lennon` are parsable names and follow\n * the basic name standard rules (i.e., first-middle-last).\n *\n * Keep in mind that prefix and suffix are not considered during the parsing\n * process.\n */\n static async parse(text: string): Promise<Namefully> {\n return Parser.buildAsync(text).then((parser) => new Namefully(parser))\n }\n\n /**\n * The current configuration.\n */\n get config(): Config {\n return this._config\n }\n\n /**\n * The number of characters of the `birthName`, including spaces.\n */\n get length(): number {\n return this.birth.length\n }\n\n /**\n * The prefix part.\n */\n get prefix(): Nullable<string> {\n return this._fullName.prefix?.toString()\n }\n\n /**\n * The firt name.\n */\n get first(): string {\n return this.firstName()\n }\n\n /**\n * The first middle name if any.\n */\n get middle(): Nullable<string> {\n return this.hasMiddle ? this.middleName()[0] : undefined\n }\n\n /**\n * Returns true if any middle name has been set.\n */\n get hasMiddle(): boolean {\n return this._fullName.has(Namon.MIDDLE_NAME)\n }\n\n /**\n * The last name.\n */\n get last(): string {\n return this.lastName()\n }\n\n /**\n * The suffix part.\n */\n get suffix(): Nullable<string> {\n return this._fullName.suffix?.toString()\n }\n\n /**\n * The birth name.\n */\n get birth(): string {\n return this.birthName()\n }\n\n /**\n * The shortest version of a person name.\n */\n get short(): string {\n return this.shorten()\n }\n\n /**\n * The longest version of a person name.\n */\n get long(): string {\n return this.birth\n }\n\n /**\n * The entire name set.\n */\n get full(): string {\n return this.fullName()\n }\n\n /**\n * The first name combined with the last name's initial.\n */\n get public(): string {\n return this.format('f $l')\n }\n\n /**\n * Returns the full name as set.\n */\n toString(): string {\n return this.full\n }\n\n /**\n * Fetches the raw form of a name piece.\n */\n get(namon: Namon): Nullable<Name | Name[]> {\n if (namon.equal(Namon.PREFIX)) return this._fullName.prefix\n if (namon.equal(Namon.FIRST_NAME)) return this._fullName.firstName\n if (namon.equal(Namon.MIDDLE_NAME)) return this._fullName.middleName\n if (namon.equal(Namon.LAST_NAME)) return this._fullName.lastName\n if (namon.equal(Namon.SUFFIX)) return this._fullName.suffix\n return undefined\n }\n\n /**\n * Whether this name is equal to another one from a raw-string perspective.\n */\n equal(other: Namefully): boolean {\n return this.toString() === other.toString()\n }\n\n /**\n * Gets a JSON representation of the full name.\n */\n toJson(): JsonName {\n return {\n prefix: this.prefix,\n firstName: this.first,\n middleName: this.middleName(),\n lastName: this.last,\n suffix: this.suffix,\n }\n }\n\n /**\n * Confirms that a name part has been set.\n */\n has(namon: Namon): boolean {\n return this._fullName.has(namon)\n }\n\n /**\n * Gets the full name ordered as configured.\n *\n * The name order `orderedBy` forces to order by first or last name by\n * overriding the preset configuration.\n *\n * `Namefully.format` may also be used to alter manually the order of appearance\n * of full name.\n *\n * For example:\n * ```ts\n * const name = new Namefully('Jon Stark Snow');\n * console.log(name.fullName(NameOrder.LAST_NAME)); // \"Snow Jon Stark\"\n * console.log(name.format('l f m')); // \"Snow Jon Stark\"\n * ```\n */\n fullName(orderedBy?: NameOrder): string {\n const sep = this._config.ending ? ',' : ''\n const names: string[] = []\n orderedBy = orderedBy || this._config.orderedBy\n\n if (this.prefix) names.push(this.prefix)\n if (orderedBy === NameOrder.FIRST_NAME) {\n names.push(this.first, ...this.middleName(), this.last + sep)\n } else {\n names.push(this.last, this.first, this.middleName().join(' ') + sep)\n }\n if (this.suffix) names.push(this.suffix)\n\n return names.join(' ').trim()\n }\n\n /**\n * Gets the birth name ordered as configured, no `prefix` or `suffix`.\n *\n * @param orderedBy forces to order by first or last name by overriding the\n * preset configuration.\n */\n birthName(orderedBy?: NameOrder): string {\n orderedBy = orderedBy || this._config.orderedBy\n return orderedBy === NameOrder.FIRST_NAME\n ? [this.first, ...this.middleName(), this.last].join(' ')\n : [this.last, this.first, ...this.middleName()].join(' ')\n }\n\n /**\n * Gets the first name part of the `FullName`.\n *\n * @param withMore determines whether to include other pieces of the first\n * name.\n */\n firstName(withMore = true): string {\n return this._fullName.firstName.toString(withMore)\n }\n\n /**\n * Gets the middle name part of the `FullName`.\n */\n middleName(): string[] {\n return this._fullName.middleName.map((n) => n.value)\n }\n\n /**\n * Gets the last name part of the `FullName`.\n *\n * @param format overrides the how-to formatting of a surname output,\n * considering its sub-parts.\n */\n lastName(format?: Surname): string {\n return this._fullName.lastName.toString(format)\n }\n\n /**\n * Gets the initials of the `FullName`.\n *\n * @param {options.orderedBy} forces to order by first or last name by\n * overriding the preset configuration.\n * @param\n *\n * For example, given the names:\n * - `John Smith` => `['J', 'S']`\n * - `John Ben Smith` => `['J', 'B', 'S']`.\n */\n initials(options?: { orderedBy?: NameOrder; only?: NameType }): string[] {\n const initials: string[] = []\n const firstInits = this._fullName.firstName.initials()\n const midInits = this._fullName.middleName.map((n) => n.initials()[0])\n const lastInits = this._fullName.lastName.initials()\n\n const mergedOptions = {\n orderedBy: this._config.orderedBy,\n only: NameType.BIRTH_NAME,\n ...options,\n }\n const { orderedBy, only } = mergedOptions\n\n if (only !== NameType.BIRTH_NAME) {\n if (only === NameType.FIRST_NAME) {\n initials.push(...firstInits)\n } else if (only === NameType.MIDDLE_NAME) {\n initials.push(...midInits)\n } else {\n initials.push(...lastInits)\n }\n } else if (orderedBy === NameOrder.FIRST_NAME) {\n initials.push(...firstInits, ...midInits, ...lastInits)\n } else {\n initials.push(...lastInits, ...firstInits, ...midInits)\n }\n return initials\n }\n\n /**\n * Shortens a complex full name to a simple typical name, a combination of\n * first and last name.\n *\n * @param orderedBy forces to order by first or last name by overriding the\n * preset configuration.\n *\n * For a given name such as `Mr Keanu Charles Reeves`, shortening this name\n * is equivalent to making it `Keanu Reeves`.\n *\n * As a shortened name, the namon of the first name is favored over the other\n * names forming part of the entire first names, if any. Meanwhile, for\n * the last name, the configured `surname` is prioritized.\n *\n * For a given `FirstName FatherName MotherName`, shortening this name when\n * the surname is set as `mother` is equivalent to making it:\n * `FirstName MotherName`.\n */\n shorten(orderedBy?: NameOrder): string {\n orderedBy = orderedBy || this._config.orderedBy\n return orderedBy === NameOrder.FIRST_NAME\n ? [this._fullName.firstName.value, this._fullName.lastName.toString()].join(' ')\n : [this._fullName.lastName.toString(), this._fullName.firstName.value].join(' ')\n }\n\n /**\n * Flattens a long name using the name types as variants.\n *\n * While @param limit sets a threshold as a limited number of characters\n * supported to flatten a `FullName`, @param by indicates which variant\n * to use when doing so. By default, a full name gets flattened by\n * `Flat.MIDDLE_NAME`.\n *\n * The flattening operation is only executed iff there is a valid entry and\n * it surpasses the limit set. In the examples below, let us assume that the\n * name goes beyond the limit value.\n *\n * Flattening a long name refers to reducing the name to the following forms.\n * For example, `John Winston Ono Lennon` flattened by:\n * * Flat.FIRST_NAME: => 'J. Winston Ono Lennon'\n * * Flat.MIDDLE_NAME: => 'John W. O. Lennon'\n * * Flat.LAST_NAME: => 'John Winston Ono L.'\n * * Flat.FIRST_MID: => 'J. W. O. Lennon'\n * * Flat.MID_LAST: => 'John W. O. L.'\n * * Flat.ALL: => 'J. W. O. L.'\n *\n * With the help of the @param recursive flag, the above operation can happen\n * recursively in the same order if the name is still too long. For example,\n * flattening `John Winston Ono Lennon` using the following params:\n * `flatten({ limit: 18, by: Flat.FIRST_NAME, recursive: true })`\n * will result in `John W. O. Lennon` and not `J. Winston Ono Lennon`.\n *\n * A shorter version of this method is `zip()`.\n */\n flatten(\n options: Partial<{\n limit: number\n by: Flat\n withPeriod: boolean\n recursive: boolean\n withMore: boolean\n surname: Surname\n }>,\n ): string {\n if (this.length <= options.limit) return this.full\n\n const mergedOptions = {\n limit: 20,\n by: Flat.MIDDLE_NAME,\n withPeriod: true,\n recursive: false,\n withMore: false,\n ...options,\n }\n\n const { by, limit, recursive, withMore, withPeriod, surname } = mergedOptions\n const sep = withPeriod ? '.' : ''\n const fn = this._fullName.firstName.toString()\n const mn = this.middleName().join(' ')\n const ln = this._fullName.lastName.toString()\n const hasMid = this.hasMiddle\n const f = this._fullName.firstName.initials(withMore).join(sep + ' ') + sep\n const l = this._fullName.lastName.initials(surname).join(sep + ' ') + sep\n const m = hasMid ? this._fullName.middleName.map((n) => n.initials()[0]).join(sep + ' ') + sep : ''\n let name: string[] = []\n\n if (this._config.orderedBy === NameOrder.FIRST_NAME) {\n switch (by) {\n case Flat.FIRST_NAME:\n name = hasMid ? [f, mn, ln] : [f, ln]\n break\n case Flat.LAST_NAME:\n name = hasMid ? [fn, mn, l] : [fn, l]\n break\n case Flat.MIDDLE_NAME:\n name = hasMid ? [fn, m, ln] : [fn, ln]\n break\n case Flat.FIRST_MID:\n name = hasMid ? [f, m, ln] : [f, ln]\n break\n case Flat.MID_LAST:\n name = hasMid ? [fn, m, l] : [fn, l]\n break\n case Flat.ALL:\n name = hasMid ? [f, m, l] : [f, l]\n break\n }\n } else {\n switch (by) {\n case Flat.FIRST_NAME:\n name = hasMid ? [ln, f, mn] : [ln, f]\n break\n case Flat.LAST_NAME:\n name = hasMid ? [l, fn, mn] : [l, fn]\n break\n case Flat.MIDDLE_NAME:\n name = hasMid ? [ln, fn, m] : [ln, fn]\n break\n case Flat.FIRST_MID:\n name = hasMid ? [ln, f, m] : [ln, f]\n break\n case Flat.MID_LAST:\n name = hasMid ? [l, fn, m] : [l, fn]\n break\n case Flat.ALL:\n name = hasMid ? [l, f, m] : [l, f]\n break\n }\n }\n\n const flat = name.join(' ')\n if (recursive && flat.length > limit) {\n const next =\n by === Flat.FIRST_NAME\n ? Flat.MIDDLE_NAME\n : by === Flat.MIDDLE_NAME\n ? Flat.LAST_NAME\n : by === Flat.LAST_NAME\n ? Flat.FIRST_MID\n : by === Flat.FIRST_MID\n ? Flat.MID_LAST\n : by === Flat.MID_LAST\n ? Flat.ALL\n : by === Flat.ALL\n ? Flat.ALL\n : by\n if (next === by) return flat\n return this.flatten({ ...options, by: next })\n }\n return flat\n }\n\n /**\n * Zips or compacts a name using different forms of variants.\n *\n * @see `flatten()` for more details.\n */\n zip(by = Flat.MID_LAST, withPeriod = true): string {\n return this.flatten({ limit: 0, by, withPeriod })\n }\n\n /**\n * Formats the full name as desired.\n * @param pattern character used to format it.\n *\n * string format\n * -------------\n * - 'short': typical first + last name\n * - 'long': birth name (without prefix and suffix)\n * - 'public': first name combined with the last name's initial.\n * - 'official': official document format\n *\n * char format\n * -----------\n * - 'b': birth name\n * - 'B': capitalized birth name\n * - 'f': first name\n * - 'F': capitalized first name\n * - 'l': last name\n * - 'L': capitalized last name\n * - 'm': middle names\n * - 'M': capitalized middle names\n * - 'o': official document format\n * - 'O': official document format in capital letters\n * - 'p': prefix\n * - 'P': capitalized prefix\n * - 's': suffix\n * - 'S': capitalized suffix\n *\n * punctuations\n * ------------\n * - '.': period\n * - ',': comma\n * - ' ': space\n * - '-': hyphen\n * - '_': underscore\n * - '$': an escape character to select only the initial of the next char.\n *\n * Given the name `Joe Jim Smith`, use `format` with the `pattern` string.\n * - format('l f') => 'Smith Joe'\n * - format('L, f') => 'SMITH, Joe'\n * - format('short') => 'Joe Smith'\n * - format() => 'SMITH, Joe Jim'\n * - format(r'f $l.') => 'Joe S.'.\n *\n * Do note that the escape character is only valid for the birth name parts:\n * first, middle, and last names.\n */\n format(pattern: string): string {\n if (pattern === 'short') return this.short\n if (pattern === 'long') return this.long\n if (pattern === 'public') return this.public\n if (pattern === 'official') pattern = 'o'\n\n let group = ''\n const formatted: string[] = []\n for (const char of pattern.split('')) {\n if (ALLOWED_TOKENS.indexOf(char) === -1) {\n throw new NotAllowedError({\n source: this.full,\n operation: 'format',\n message: `unsupported character <${char}> from ${pattern}.`,\n })\n }\n group += char\n if (char === '$') continue\n formatted.push(this.map(group) ?? '')\n group = ''\n }\n return formatted.join('').trim()\n }\n\n /**\n * Flips definitely the name order from the preset/current config.\n */\n flip(): void {\n if (this._config.orderedBy === NameOrder.FIRST_NAME) {\n this._config.updateOrder(NameOrder.LAST_NAME)\n console.log(`The name order is now changed to: ${NameOrder.LAST_NAME}`)\n } else {\n this._config.updateOrder(NameOrder.FIRST_NAME)\n console.log(`The name order is now changed to: ${NameOrder.FIRST_NAME}`)\n }\n }\n\n /**\n * Splits the name parts of a birth name.\n * @param separator token for the split.\n */\n split(separator: string | RegExp = /[' -]/g): string[] {\n return this.birth.replace(separator, ' ').split(' ')\n }\n\n /**\n * Joins the name parts of a birth name.\n * @param separator token for the junction.\n */\n join(separator = ''): string {\n return this.split().join(separator)\n }\n\n /**\n * Transforms a birth name into UPPERCASE\n */\n toUpperCase(): string {\n return this.birth.toUpperCase()\n }\n\n /**\n * Transforms a birth name into lowercase\n */\n toLowerCase(): string {\n return this.birth.toLowerCase()\n }\n\n /**\n * Transforms a birth name into camelCase\n */\n toCamelCase(): string {\n return decapitalize(this.toPascalCase())\n }\n\n /**\n * Transforms a birth name into PascalCase\n */\n toPascalCase(): string {\n return this.split()\n .map((n) => capitalize(n))\n .join('')\n }\n\n /**\n * Transforms a birth name into snake_case\n */\n toSnakeCase(): string {\n return this.split()\n .map((n) => n.toLowerCase())\n .join('_')\n }\n\n /**\n * Transforms a birth name into hyphen-case\n */\n toHyphenCase(): string {\n return this.split()\n .map((n) => n.toLowerCase())\n .join('-')\n }\n\n /**\n * Transforms a birth name into dot.case\n */\n toDotCase(): string {\n return this.split()\n .map((n) => n.toLowerCase())\n .join('.')\n }\n\n /**\n * Transforms a birth name into ToGgLeCaSe\n */\n toToggleCase(): string {\n return toggleCase(this.birth)\n }\n\n private build<T>(parser: Parser<T>, options?: Partial<Config>): void {\n this._config = Config.merge(options)\n this._fullName = parser.parse(this._config)\n }\n\n private toParser(raw: string | string[] | Name[] | JsonName | Parser): Parser {\n if (raw instanceof Parser) return raw\n if (typeof raw === 'string') return new StringParser(raw)\n if (isStringArray(raw)) return new ArrayStringParser(raw as string[])\n if (isNameArray(raw)) return new ArrayNameParser(raw as Name[])\n if (typeof raw === 'object') return new NamaParser(raw as JsonName)\n\n throw new InputError({\n source: raw,\n message: 'Cannot parse raw data. Review expected data types.',\n })\n }\n\n private map(char: string): Nullable<string> {\n switch (char) {\n case '.':\n case ',':\n case ' ':\n case '-':\n case '_':\n return char\n case 'b':\n return this.birth\n case 'B':\n return this.birth.toUpperCase()\n case 'f':\n return this.first\n case 'F':\n return this.first.toUpperCase()\n case 'l':\n return this.last\n case 'L':\n return this.last.toUpperCase()\n case 'm':\n case 'M':\n return char === 'm' ? this.middleName().join(' ') : this.middleName().join(' ').toUpperCase()\n case 'o':\n case 'O':\n const sep = this._config.ending ? ',' : ''\n const names: string[] = []\n if (this.prefix) names.push(this.prefix)\n names.push(`${this.last},`.toUpperCase())\n if (this.hasMiddle) {\n names.push(this.first, this.middleName().join(' ') + sep)\n } else {\n names.push(this.first + sep)\n }\n if (this.suffix) names.push(this.suffix)\n const nama = names.join(' ').trim()\n return char === 'o' ? nama : nama.toUpperCase()\n case 'p':\n return this.prefix\n case 'P':\n return this.prefix?.toUpperCase()\n case 's':\n return this.suffix\n case 'S':\n return this.suffix?.toUpperCase()\n case '$f':\n case '$F':\n return this._fullName.firstName.initials()[0]\n case '$l':\n case '$L':\n return this._fullName.lastName.initials()[0]\n case '$m':\n case '$M':\n return this.hasMiddle ? this.middle[0] : undefined\n default:\n return undefined\n }\n }\n}\n"],"sourceRoot":""}
|