diff --git a/docs/plugin-libpostal.md b/docs/plugin-libpostal.md index a4f4ce93..dd593385 100644 --- a/docs/plugin-libpostal.md +++ b/docs/plugin-libpostal.md @@ -17,8 +17,9 @@ npm install @ezs/libpostal #### Table of Contents - [expandAddress](#expandaddress) +- [expandAddressWith](#expandaddresswith) - [parseAddress](#parseaddress) -- [parseAddress](#parseaddress-1) +- [parseAddressWith](#parseaddresswith) ### expandAddress @@ -27,10 +28,10 @@ This will contain a standardized version of the address. Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** -### parseAddress +### expandAddressWith Takes a field of object containing an address to return the same object except for the field containing the address. -This will contain the different fields found in the address. +This will contain a standardized version of the address. #### Parameters @@ -44,3 +45,14 @@ Takes a string containing an address to return an object. This will contain the different fields present in the address. Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** + +### parseAddressWith + +Takes a field of object containing an address to return the same object except for the field containing the address. +This will contain the different fields found in the address. + +#### Parameters + +- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** path to the chosen field + +Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** diff --git a/packages/libpostal/README.md b/packages/libpostal/README.md index a4f4ce93..dd593385 100644 --- a/packages/libpostal/README.md +++ b/packages/libpostal/README.md @@ -17,8 +17,9 @@ npm install @ezs/libpostal #### Table of Contents - [expandAddress](#expandaddress) +- [expandAddressWith](#expandaddresswith) - [parseAddress](#parseaddress) -- [parseAddress](#parseaddress-1) +- [parseAddressWith](#parseaddresswith) ### expandAddress @@ -27,10 +28,10 @@ This will contain a standardized version of the address. Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** -### parseAddress +### expandAddressWith Takes a field of object containing an address to return the same object except for the field containing the address. -This will contain the different fields found in the address. +This will contain a standardized version of the address. #### Parameters @@ -44,3 +45,14 @@ Takes a string containing an address to return an object. This will contain the different fields present in the address. Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** + +### parseAddressWith + +Takes a field of object containing an address to return the same object except for the field containing the address. +This will contain the different fields found in the address. + +#### Parameters + +- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** path to the chosen field + +Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** diff --git a/packages/libpostal/src/expand-address-with.js b/packages/libpostal/src/expand-address-with.js index bd7e862c..2b8cc229 100644 --- a/packages/libpostal/src/expand-address-with.js +++ b/packages/libpostal/src/expand-address-with.js @@ -10,7 +10,7 @@ const expand = (input) => ({ .reduce((obj, cur) => ({ ...obj, [cur.component]: cur.value }), {}), }); -/* +/** * Takes a field of object containing an address to return the same object except for the field containing the address. * This will contain a standardized version of the address. * diff --git a/packages/libpostal/src/parse-address-with.js b/packages/libpostal/src/parse-address-with.js index 77396471..2d9f3b59 100644 --- a/packages/libpostal/src/parse-address-with.js +++ b/packages/libpostal/src/parse-address-with.js @@ -14,7 +14,7 @@ const parse = (input) => ({ * Takes a field of object containing an address to return the same object except for the field containing the address. * This will contain the different fields found in the address. * - * @name parseAddress + * @name parseAddressWith * @param {String} [path] path to the chosen field * @returns {Object} */