@smartsoft001/auth-domain 2.101.0 → 2.102.0

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/index.js +55 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -61,6 +61,15 @@ import "reflect-metadata";
61
61
  // packages/shared/models/src/lib/decorators/field/field.decorator.ts
62
62
  import "reflect-metadata";
63
63
 
64
+ // packages/shared/utils/src/lib/services/array/array.service.ts
65
+ import * as _ from "lodash";
66
+
67
+ // packages/shared/utils/src/lib/services/guid/guid.service.ts
68
+ import { Guid } from "guid-typescript";
69
+
70
+ // packages/shared/utils/src/lib/services/object/object.service.ts
71
+ import { stringify } from "flatted";
72
+
64
73
  // packages/shared/utils/src/lib/services/password/password.service.ts
65
74
  import md5 from "md5";
66
75
  var PasswordService = class _PasswordService {
@@ -83,14 +92,52 @@ var PasswordService = class _PasswordService {
83
92
  }
84
93
  };
85
94
 
86
- // packages/shared/utils/src/lib/services/object/object.service.ts
87
- import { stringify } from "flatted";
88
-
89
- // packages/shared/utils/src/lib/services/guid/guid.service.ts
90
- import { Guid } from "guid-typescript";
91
-
92
- // packages/shared/utils/src/lib/services/array/array.service.ts
93
- import * as _ from "lodash";
95
+ // packages/shared/utils/src/lib/services/slug/slug.service.ts
96
+ var SlugService = class _SlugService {
97
+ static {
98
+ this.polishToEnglishMap = {
99
+ "\u0105": "a",
100
+ "\u0107": "c",
101
+ "\u0119": "e",
102
+ "\u0142": "l",
103
+ "\u0144": "n",
104
+ "\xF3": "o",
105
+ "\u015B": "s",
106
+ "\u017A": "z",
107
+ "\u017C": "z",
108
+ "\u0104": "A",
109
+ "\u0106": "C",
110
+ "\u0118": "E",
111
+ "\u0141": "L",
112
+ "\u0143": "N",
113
+ "\xD3": "O",
114
+ "\u015A": "S",
115
+ "\u0179": "Z",
116
+ "\u017B": "Z"
117
+ };
118
+ }
119
+ /**
120
+ * Convert text to URL-friendly slug
121
+ * - Replaces Polish characters with English equivalents
122
+ * - Converts to lowercase
123
+ * - Replaces spaces and special characters with hyphens
124
+ * - Removes multiple consecutive hyphens
125
+ * - Trims hyphens from start and end
126
+ */
127
+ static create(text) {
128
+ if (!text) {
129
+ return "";
130
+ }
131
+ let slug = text.split("").map(
132
+ (char) => _SlugService.polishToEnglishMap[char] || char
133
+ ).join("");
134
+ slug = slug.toLowerCase();
135
+ slug = slug.replace(/[^a-z0-9]+/g, "-");
136
+ slug = slug.replace(/-+/g, "-");
137
+ slug = slug.replace(/^-+|-+$/g, "");
138
+ return slug;
139
+ }
140
+ };
94
141
 
95
142
  // packages/shared/domain-core/src/lib/errors.ts
96
143
  var DomainValidationError = class _DomainValidationError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartsoft001/auth-domain",
3
- "version": "2.101.0",
3
+ "version": "2.102.0",
4
4
  "description": "Utils for authorization",
5
5
  "repository": {
6
6
  "type": "git",