{"_id":"@comparaonline/conversational-commerce-utils","_rev":"8-e8c6695504de869f6ec8f578efa7a916","name":"@comparaonline/conversational-commerce-utils","dist-tags":{"latest":"0.4.0"},"versions":{"0.2.0":{"name":"@comparaonline/conversational-commerce-utils","version":"0.2.0","keywords":["conversations","phone","email","formatter","validator"],"author":{"name":"ComparaOnline"},"license":"MIT","_id":"@comparaonline/conversational-commerce-utils@0.2.0","maintainers":[{"name":"dsuarez_compa","email":"dsuarez@comparaonline.com"},{"name":"pfariaz","email":"pfariaz011@gmail.com"},{"name":"ricardo.sosa","email":"rsosa@comparaonline.com"},{"name":"gnza","email":"go.sanchezm@gmail.com"},{"name":"suarezcumare","email":"suarezcumare@gmail.com"},{"name":"fverag","email":"fabian.vera.g@gmail.com"},{"name":"comparaonline-dev","email":"plataforma@comparaonline.com"},{"name":"comparaonlineprivate","email":"dev@comparaonline.com"},{"name":"matotias","email":"matotias@gmail.com"},{"name":"javierlara1989","email":"javier.lara@usach.cl"},{"name":"smurua","email":"smurua@comparaonline.com"},{"name":"eseceve","email":"eseceve@gmail.com"},{"name":"pablocompara","email":"pkachoski@comparaonline.com"}],"dist":{"shasum":"1e9bf8eafa29e4c6a7f9b3f8895e7e96a0daaf00","tarball":"https://registry.npmjs.org/@comparaonline/conversational-commerce-utils/-/conversational-commerce-utils-0.2.0.tgz","fileCount":130,"integrity":"sha512-VF4ZxxrSKIdT9MbquKEfeuEuCTpLIJjP/YGk9wCyVOzZ6Bgn06rybmvmqsgxAvWA024EOuUOgQ0qRQB0IsyRCA==","signatures":[{"sig":"MEQCIDNj9rYPYk27b6WbMxVAreK2DnhEjzhOLlAFyK4XpxopAiB/nxLLLw6kTEgZUmytRoRExaqHgaK8AzUkXmgp1uJqIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":104456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSpz1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAsA//eN2WEUocgdQ839RUpYy16ZEvX/+HvFqSALe9ujo8hwveZ5Gm\r\nFgJuqVizoNqeHdUhqL+c8SkPoKOh4C5ilFi24Ocj/uhsdYKTlt0ldmDdh/pE\r\nLoSpppt2zqJwnDHLA3x/QF5gjmw8ub5NdBS6QJA3gQw5QoOU3ltGSycl5Kb4\r\nJfYHEo5Z11r2nCxOA8bxlAg22tsobxlxBoXwm87F0yA27KNfKpeq0HyUiRsc\r\nWgo+TlBA4ErJmq7ToSV3EAEBHGIfWhTf1voE4iJQsQMfiAJcg1rK2QWHuK6i\r\nVnprlR/J96T90XSS8meCPO6zSE5Z85D7rQbrkb2olmxzsIa+vKl41nbbvS+l\r\njcTu4DT7h6kEyfwZVYDi7lai1Mt+EcQTUAdS2Jucvn291GWxZ9w6S9OISPS+\r\n6bVQFPsc7y4HKThRRXjizNrwFIAmNcMJL/m1IyH/WE7+uDaIis6deYa6lq2Z\r\nVA8WHRGzm3smuXj+EGWTFjCEzDxIXTKINTV3ZEq7aYMcY2sh6JgVHl0n5OKH\r\nAyud39fEldnQHxujwxcq8+qgtIjj9i6x+wkhTAxFxgfQ1oH1o1gRJuRkzCwO\r\nj6oHO0U4fAYOOgq4QSMSBYrQw1NUTXb2M/SJSzuC66/jjSPP8Swok/QDGBuS\r\no+Z3sgdaoyDfHYpQFxSOg0Q8cTX7WEukWhE=\r\n=hZxK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"build/index.d.ts","engines":{"node":">=18.0"},"gitHead":"31cb2339788c7d7af9e58894dd629ca9daa8b5b6","scripts":{"lint":"eslint \"{src,test}/**/*.ts\" --fix","test":"jest","build":"tsc","format":"prettier --write \"src/**/*.ts\" \"test/**/*.ts\"","prepare":"husky install","pretest":"npm run lint","prebuild":"rimraf build","prepublish":"npm run build"},"_npmUser":{"name":"dsuarez_compa","email":"dsuarez@comparaonline.com"},"_npmVersion":"9.5.0","description":"utils for conversational commerce at comparaonline.com","directories":{},"_nodeVersion":"18.15.0","dependencies":{"libphonenumber-js":"^1.10.28"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","husky":"^8.0.3","eslint":"^8.39.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","prettier":"^2.8.8","typescript":"^5.0.4","@types/jest":"^29.5.1","@types/node":"^18.16.1","tsconfig-paths":"^4.2.0","@commitlint/cli":"^17.6.1","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","@typescript-eslint/parser":"^5.59.1","@commitlint/config-conventional":"^17.6.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"_npmOperationalInternal":{"tmp":"tmp/conversational-commerce-utils_0.2.0_1682611444949_0.13879183082257196","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"@comparaonline/conversational-commerce-utils","version":"0.3.0","keywords":["conversations","phone","email","formatter","validator"],"author":{"name":"ComparaOnline"},"license":"MIT","_id":"@comparaonline/conversational-commerce-utils@0.3.0","maintainers":[{"name":"dsuarez_compa","email":"dsuarez@comparaonline.com"},{"name":"pfariaz","email":"pfariaz011@gmail.com"},{"name":"ricardo.sosa","email":"rsosa@comparaonline.com"},{"name":"gnza","email":"go.sanchezm@gmail.com"},{"name":"suarezcumare","email":"suarezcumare@gmail.com"},{"name":"fverag","email":"fabian.vera.g@gmail.com"},{"name":"comparaonline-dev","email":"plataforma@comparaonline.com"},{"name":"comparaonlineprivate","email":"dev@comparaonline.com"},{"name":"matotias","email":"matotias@gmail.com"},{"name":"javierlara1989","email":"javier.lara@usach.cl"},{"name":"smurua","email":"smurua@comparaonline.com"},{"name":"eseceve","email":"eseceve@gmail.com"},{"name":"pablocompara","email":"pkachoski@comparaonline.com"}],"dist":{"shasum":"5de3f9b60a8c207265d029900bc181b9c30a4d14","tarball":"https://registry.npmjs.org/@comparaonline/conversational-commerce-utils/-/conversational-commerce-utils-0.3.0.tgz","fileCount":89,"integrity":"sha512-37JF3W1xpWWkTiLGLyk69L2zo8JalXbHN1cK+f4anNQWJCZjcLuS0gvpFl2NP91rw2M8ZvfaA9Dqz59zzKkhQA==","signatures":[{"sig":"MEQCIDoGlryUkH5/R8c+lGjjJyCK7FwY7yikQKR/WaHH0ODnAiAJXUeVib8W22ul8PNRaR4yH2OHI7qOCpxSH91x8FouLg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75800},"main":"build/index.js","types":"build/index.d.ts","engines":{"node":">=18.0"},"gitHead":"ed2d71126de81eebbf7f41e2305fa3d34cbed734","scripts":{"lint":"eslint \"{src,test}/**/*.ts\" --fix","test":"jest","build":"tsc","format":"prettier --write \"src/**/*.ts\" \"test/**/*.ts\"","prepare":"husky install","pretest":"npm run lint","prebuild":"rimraf build","prepublish":"npm run build"},"_npmUser":{"name":"comparaonline-dev","email":"plataforma@comparaonline.com"},"_npmVersion":"9.5.1","description":"utils for conversational commerce at comparaonline.com","directories":{},"_nodeVersion":"18.16.0","dependencies":{"libphonenumber-js":"^1.10.28"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","husky":"^8.0.3","eslint":"^8.39.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","prettier":"^2.8.8","typescript":"^5.0.4","@types/jest":"^29.5.1","@types/node":"^18.16.1","tsconfig-paths":"^4.2.0","@commitlint/cli":"^17.6.1","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","@typescript-eslint/parser":"^5.59.1","@commitlint/config-conventional":"^17.6.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"_npmOperationalInternal":{"tmp":"tmp/conversational-commerce-utils_0.3.0_1687977775833_0.6300707164221055","host":"s3://npm-registry-packages"}},"0.4.0":{"name":"@comparaonline/conversational-commerce-utils","version":"0.4.0","keywords":["conversations","phone","email","formatter","validator"],"author":{"name":"ComparaOnline"},"license":"MIT","_id":"@comparaonline/conversational-commerce-utils@0.4.0","maintainers":[{"name":"dsuarez_compa","email":"dsuarez@comparaonline.com"},{"name":"pfariaz","email":"pfariaz011@gmail.com"},{"name":"ricardo.sosa","email":"rsosa@comparaonline.com"},{"name":"gnza","email":"go.sanchezm@gmail.com"},{"name":"suarezcumare","email":"suarezcumare@gmail.com"},{"name":"fverag","email":"fabian.vera.g@gmail.com"},{"name":"comparaonline-dev","email":"plataforma@comparaonline.com"},{"name":"comparaonlineprivate","email":"dev@comparaonline.com"},{"name":"matotias","email":"matotias@gmail.com"},{"name":"javierlara1989","email":"javier.lara@usach.cl"},{"name":"smurua","email":"smurua@comparaonline.com"},{"name":"eseceve","email":"eseceve@gmail.com"},{"name":"pablocompara","email":"pkachoski@comparaonline.com"}],"dist":{"shasum":"1a0c8fa175a201c6f5bacf8975534ac216842f37","tarball":"https://registry.npmjs.org/@comparaonline/conversational-commerce-utils/-/conversational-commerce-utils-0.4.0.tgz","fileCount":68,"integrity":"sha512-g/I8A8qgHKvJjpcrDg+5GDgss1P9HT58O99TbGzOPLw8X4Igb/TXS086zBwahSYza70XKjOoHGS+X+QfhZ1eyQ==","signatures":[{"sig":"MEQCIF7xJJSdKGS5+7dB9VzYzrHW9pap0wEjJ+MxPVqW/kDiAiAW16WSTuvRTSTZYHyJFZBCsf7KYb9Dh8ZVn1LtYD+ZLw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59976},"main":"build/index.js","types":"build/index.d.ts","engines":{"node":">=18.0"},"gitHead":"ab1d4b845b6055058f3d5ecdc4bc7fd6b633975e","scripts":{"lint":"eslint \"{src,test}/**/*.ts\" --fix","test":"jest","build":"tsc -p tsconfig.build.json","format":"prettier --write \"src/**/*.ts\" \"test/**/*.ts\"","prepare":"husky install","pretest":"npm run lint","prebuild":"rimraf build","prepublish":"npm run build"},"_npmUser":{"name":"comparaonline-dev","email":"plataforma@comparaonline.com"},"_npmVersion":"9.5.1","description":"utils for conversational commerce at comparaonline.com","directories":{},"_nodeVersion":"18.16.0","dependencies":{"libphonenumber-js":"^1.10.28"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","husky":"^8.0.3","eslint":"^8.39.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","prettier":"^2.8.8","typescript":"^5.0.4","@types/jest":"^29.5.1","@types/node":"^18.16.1","tsconfig-paths":"^4.2.0","@commitlint/cli":"^17.6.1","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","@typescript-eslint/parser":"^5.59.1","@commitlint/config-conventional":"^17.6.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"_npmOperationalInternal":{"tmp":"tmp/conversational-commerce-utils_0.4.0_1687990520906_0.2228376669474792","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-04-27T16:04:04.886Z","modified":"2025-12-30T14:00:28.318Z","0.2.0":"2023-04-27T16:04:05.128Z","0.3.0":"2023-06-28T18:42:56.003Z","0.4.0":"2023-06-28T22:15:21.114Z"},"author":{"name":"ComparaOnline"},"license":"MIT","keywords":["conversations","phone","email","formatter","validator"],"description":"utils for conversational commerce at comparaonline.com","maintainers":[{"email":"suarezcumare@gmail.com","name":"suarezcumare"},{"email":"plataforma@comparaonline.com","name":"comparaonline-dev"},{"email":"dev@comparaonline.com","name":"comparaonlineprivate"},{"email":"gnavarro@comparaonline.com","name":"gnavarro"},{"email":"matotias@gmail.com","name":"matotias"},{"email":"smurua@comparaonline.com","name":"smurua"},{"email":"eseceve@gmail.com","name":"eseceve"},{"email":"pfariaz011@gmail.com","name":"pfariaz"},{"email":"rsosa@comparaonline.com","name":"ricardo.sosa"},{"email":"dsuarez@comparaonline.com","name":"dsuarez_compa"},{"email":"emartini@comparaonline.com","name":"emartinicompara"}],"readme":"# README\n\n## @comparaonline/conversational-commerce-utils\n\nThis package contains utility functions for conversational commerce at ComparaOnline.com. It includes functionality for formatting, validating, and parsing phone and email data.\n\n### Installation\n\nTo use this package, you can install it via NPM:\n\n```\nnpm install --save @comparaonline/conversational-commerce-utils\n```\n\n### Usage\n\n#### Sanitizing\n\nTo sanitize phone and email data, you can use the following functions:\n\n```\nimport { phoneSanitize, emailSanitize } from '@comparaonline/conversational-commerce-utils';\n\nconst sanitizedPhone = phoneSanitize('123-456-7890');\nconst sanitizedEmail = emailSanitize('TEST@EXAMPLE.COM');\n```\n\n`phoneSanitize` will remove all non-numeric characters from the phone number, and `emailSanitize` will lowercase the email address, remove any whitespace, and remove any characters that are not letters, numbers, or the following special characters: `!#$%&'*+-/=?^_`{|}~@.`.\n\n#### Validation\n\nTo validate email addresses, you can use the `isEmailValid` function:\n\n```\nimport { isEmailValid } from '@comparaonline/conversational-commerce-utils';\n\nconst isValidEmail = isEmailValid('test@example.com');\n```\n\n`isEmailValid` will return `true` if the email address is valid according to the following criteria:\n\n- The email address has exactly one \"@\" symbol\n- The local part of the email address (the part before the \"@\") matches the regular expression `/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)\\*$/`\n- The domain part of the email address (the part after the \"@\") matches the regular expression defined in the `isValidDomainPart` function.\n\n#### Parsing\n\nTo parse phone numbers from different countries and formats, you can use the `phoneParser` function:\n\n```\nimport { phoneParser } from '@comparaonline/conversational-commerce-utils';\n\nconst parsedPhone = phoneParser('+1 (555) 123-4567');\n```\n\n`phoneParser` will return an object with the following properties:\n\n- `raw`: The raw input string that was passed to the function\n- `country`: The ISO 3166-1 alpha-2 country code for the country that the phone number belongs to\n- `countryCallingCode`: The calling code for the country that the phone number belongs to (e.g. \"1\" for the United States and Canada)\n- `nationalNumber`: The national significant number for the phone number (i.e. the part of the phone number that comes after the country calling code)\n- `number`: The phone number in the format used by WhatsApp (i.e. with any necessary prefixes or changes to the national number)\n- `isValid`: Whether the phone number is valid according to the rules for the country that it belongs to.\n\n### Contributing\n\nIf you would like to contribute to this project, please see the CONTRIBUTING.md file for more information.\n\n### License\n\nThis project is licensed under the MIT License. See the LICENSE.md file for more information.\n","readmeFilename":"README.md"}