@churchapps/apphelper 0.5.9 → 0.5.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.
- package/dist/helpers/SlugHelper.d.ts.map +1 -1
- package/dist/helpers/SlugHelper.js +5 -15
- package/dist/helpers/SlugHelper.js.map +1 -1
- package/dist/public/locales/en.json +1 -0
- package/dist/public/locales/es.json +3 -0
- package/package.json +1 -1
- package/public/locales/en.json +1 -0
- package/public/locales/es.json +3 -0
- package/src/helpers/SlugHelper.ts +5 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlugHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/SlugHelper.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IAErB,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,gBAAgB,CAAC,EAAE,MAAM,EAAE;IAY7F,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"SlugHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/SlugHelper.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IAErB,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,gBAAgB,CAAC,EAAE,MAAM,EAAE;IAY7F,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM;CAUjC"}
|
|
@@ -10,23 +10,13 @@ export class SlugHelper {
|
|
|
10
10
|
const verfiedSlug = this.numerifySlug(initialSlug);
|
|
11
11
|
return verfiedSlug;
|
|
12
12
|
}
|
|
13
|
-
//remove
|
|
13
|
+
//remove long sequences of single-digit numbers (e.g., 1-2-3-4 becomes 1), but preserve normal number patterns
|
|
14
14
|
static numerifySlug(slug) {
|
|
15
15
|
let initialString = slug;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const length = data.length;
|
|
21
|
-
let splitResult = data;
|
|
22
|
-
if (length > 1) {
|
|
23
|
-
const array = data.split("");
|
|
24
|
-
splitResult = array[0];
|
|
25
|
-
}
|
|
26
|
-
const replacedString = initialString.replace(data, splitResult);
|
|
27
|
-
initialString = replacedString;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
16
|
+
// Only match sequences of 3+ single-digit numbers separated by hyphens (e.g., 1-2-3, 1-2-3-4)
|
|
17
|
+
// This avoids mangling things like chapter-verse references (6-11) or dates
|
|
18
|
+
const regex = /\b(\d)-(\d)-(\d)(?:-\d)*\b/g;
|
|
19
|
+
initialString = initialString.replace(regex, "$1");
|
|
30
20
|
return initialString;
|
|
31
21
|
}
|
|
32
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlugHelper.js","sourceRoot":"","sources":["../../src/helpers/SlugHelper.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,OAAO,UAAU;IAErB,MAAM,CAAC,aAAa,CAAC,MAAc,EAAE,IAA2B,EAAE,gBAA2B;QAC3F,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QACnI,MAAM,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,GAAG,EAAC,CAAC,CAAC,CAAC,wDAAwD;QACnF,CAAC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,GAAG,SAAS,GA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AAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEnD,OAAO,aAAa,CAAC;IACvB,CAAC;CAEF"}
|
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
"forgot": "Forgot Password",
|
|
158
158
|
"goLogin": "Go to Login",
|
|
159
159
|
"login": "Login",
|
|
160
|
+
"noAcc": "Don't have an account?",
|
|
160
161
|
"password": "Password",
|
|
161
162
|
"register": "Register",
|
|
162
163
|
"registerThankYou": "Thank you for registering! Please check your email to verify your account.",
|
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
"forgot": "Olvidó la Contraseña",
|
|
156
156
|
"goLogin": "Ir a Iniciar Sesión",
|
|
157
157
|
"login": "Iniciar Sesión",
|
|
158
|
+
"noAcc": "¿No tiene una cuenta?",
|
|
158
159
|
"password": "Contraseña",
|
|
159
160
|
"register": "Registrarse",
|
|
160
161
|
"registerThankYou": "¡Gracias por registrarse! Por favor revise su correo electrónico para verificar su cuenta.",
|
|
@@ -258,7 +259,9 @@
|
|
|
258
259
|
"chatWith": "Chatear con",
|
|
259
260
|
"deleteChurch": "Eliminar iglesia de la lista",
|
|
260
261
|
"logout": "Cerrar sesión",
|
|
262
|
+
"messages": "Mensajes",
|
|
261
263
|
"newPrivateMessage": "Nuevo Mensaje Privado",
|
|
264
|
+
"notifications": "Notificaciones",
|
|
262
265
|
"privateMessage": "Mensaje Privado",
|
|
263
266
|
"profile": "Perfil",
|
|
264
267
|
"searchForPerson": "Buscar a una persona",
|
package/package.json
CHANGED
package/public/locales/en.json
CHANGED
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
"forgot": "Forgot Password",
|
|
158
158
|
"goLogin": "Go to Login",
|
|
159
159
|
"login": "Login",
|
|
160
|
+
"noAcc": "Don't have an account?",
|
|
160
161
|
"password": "Password",
|
|
161
162
|
"register": "Register",
|
|
162
163
|
"registerThankYou": "Thank you for registering! Please check your email to verify your account.",
|
package/public/locales/es.json
CHANGED
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
"forgot": "Olvidó la Contraseña",
|
|
156
156
|
"goLogin": "Ir a Iniciar Sesión",
|
|
157
157
|
"login": "Iniciar Sesión",
|
|
158
|
+
"noAcc": "¿No tiene una cuenta?",
|
|
158
159
|
"password": "Contraseña",
|
|
159
160
|
"register": "Registrarse",
|
|
160
161
|
"registerThankYou": "¡Gracias por registrarse! Por favor revise su correo electrónico para verificar su cuenta.",
|
|
@@ -258,7 +259,9 @@
|
|
|
258
259
|
"chatWith": "Chatear con",
|
|
259
260
|
"deleteChurch": "Eliminar iglesia de la lista",
|
|
260
261
|
"logout": "Cerrar sesión",
|
|
262
|
+
"messages": "Mensajes",
|
|
261
263
|
"newPrivateMessage": "Nuevo Mensaje Privado",
|
|
264
|
+
"notifications": "Notificaciones",
|
|
262
265
|
"privateMessage": "Mensaje Privado",
|
|
263
266
|
"profile": "Perfil",
|
|
264
267
|
"searchForPerson": "Buscar a una persona",
|
|
@@ -13,25 +13,14 @@ export class SlugHelper {
|
|
|
13
13
|
return verfiedSlug;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
//remove
|
|
16
|
+
//remove long sequences of single-digit numbers (e.g., 1-2-3-4 becomes 1), but preserve normal number patterns
|
|
17
17
|
static numerifySlug(slug: string) {
|
|
18
18
|
let initialString = slug;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
// Only match sequences of 3+ single-digit numbers separated by hyphens (e.g., 1-2-3, 1-2-3-4)
|
|
20
|
+
// This avoids mangling things like chapter-verse references (6-11) or dates
|
|
21
|
+
const regex = /\b(\d)-(\d)-(\d)(?:-\d)*\b/g;
|
|
22
|
+
initialString = initialString.replace(regex, "$1");
|
|
21
23
|
|
|
22
|
-
if (matchedArray) {
|
|
23
|
-
matchedArray.forEach((data) => {
|
|
24
|
-
const length = data.length;
|
|
25
|
-
let splitResult = data;
|
|
26
|
-
if (length > 1) {
|
|
27
|
-
const array = data.split("");
|
|
28
|
-
splitResult = array[0];
|
|
29
|
-
}
|
|
30
|
-
const replacedString = initialString.replace(data, splitResult);
|
|
31
|
-
initialString = replacedString;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
24
|
return initialString;
|
|
36
25
|
}
|
|
37
26
|
|