@koloseum/utils 0.2.10 → 0.2.11

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.
Files changed (2) hide show
  1. package/dist/utils.js +4 -1
  2. package/package.json +1 -1
package/dist/utils.js CHANGED
@@ -7,7 +7,6 @@ const parsePgInterval = (await import("postgres-interval")).default;
7
7
  const sanitize = (await import("sanitize-html")).default;
8
8
  const { trim, escape, isMobilePhone, isURL } = validator;
9
9
  const { KenyaAdministrativeDivisions } = (await import("kenya-administrative-divisions"));
10
- const kenyaAdmin = new KenyaAdministrativeDivisions();
11
10
  /* DUMMY DATA */
12
11
  export const Data = {
13
12
  /**
@@ -337,6 +336,8 @@ export const Utility = {
337
336
  * @returns {Promise<County[]>} A list of objects with the county `name`, `code`, and a list of `subCounties`
338
337
  */
339
338
  getKenyaCounties: async (sortBy = "name") => {
339
+ // Create Kenya administrative divisions instance
340
+ const kenyaAdmin = new KenyaAdministrativeDivisions();
340
341
  // Get all counties
341
342
  const countiesData = await kenyaAdmin.getAll();
342
343
  // Format counties
@@ -1346,6 +1347,8 @@ export const Utility = {
1346
1347
  * @returns An object with the validated `address`, or an `error` if any has occurred
1347
1348
  */
1348
1349
  validateAddress: async (formData) => {
1350
+ // Create Kenya administrative divisions instance
1351
+ const kenyaAdmin = new KenyaAdministrativeDivisions();
1349
1352
  // Building name
1350
1353
  let buildingName = formData.get("building-name");
1351
1354
  if (!buildingName)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koloseum/utils",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "author": "Koloseum Technologies Limited",
5
5
  "type": "module",
6
6
  "description": "Utility logic for use across Koloseum web apps (TypeScript)",