sr-npm 1.7.477 → 1.7.478

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/backend/data.js CHANGED
@@ -7,10 +7,7 @@ const { getAllPositions } = require('./queries');
7
7
  const { getCompanyId, getSmartToken } = require('./secretsData');
8
8
 
9
9
  function getBrand(customField) {
10
- const brand = customField.find(field => field.fieldLabel === 'Brands')?.valueLabel;
11
- console.log("brand: ", brand);
12
- console.log("normalizeString(brand): ", normalizeString(brand));
13
- return brand ? normalizeString(brand) : '';
10
+ return customField.find(field => field.fieldLabel === 'Brands')?.valueLabel;
14
11
  }
15
12
 
16
13
  function validatePosition(position) {
@@ -37,7 +34,7 @@ async function saveJobsDataToCMS() {
37
34
  _id: position.id,
38
35
  title: position.name || '',
39
36
  department: position.department?.label || 'Other',
40
- cityText: normalizeString(position.location?.city).trim(),
37
+ cityText: normalizeString(position.location?.city),
41
38
  location: position.location && Object.keys(position.location).length > 0
42
39
  ? position.location
43
40
  : {
package/backend/utils.js CHANGED
@@ -35,7 +35,7 @@ function prepareToSaveArray(jobsPerField, cityLocations, field,citylocationAddre
35
35
  return Object.entries(jobsPerField).map(([value, amount]) => {
36
36
  const loc = cityLocations[value] || {};
37
37
  const locAddress = citylocationAddress[value] || {};
38
- value = normalizeString(value).trim();
38
+ value = normalizeString(value);
39
39
  return {
40
40
  title: value,
41
41
  _id: value.replace(/\s+/g, ''),
@@ -56,11 +56,12 @@ function prepareToSaveArray(jobsPerField, cityLocations, field,citylocationAddre
56
56
 
57
57
  function normalizeString(str) {
58
58
  if (!str) return str;
59
- // Remove accents/diacritics, keep spaces, trim whitespace
59
+ // Remove accents/diacritics, trim whitespace
60
60
  return str
61
61
  .normalize('NFD')
62
62
  .replace(/\p{Diacritic}/gu, '')
63
- .replace(/[^A-Za-z0-9-\s]/g, '');
63
+ .replace(/[^A-Za-z0-9-]/g, '')
64
+ .trim();
64
65
  }
65
66
 
66
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.477",
3
+ "version": "1.7.478",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {