@smartsoft001/auth-shell-dtos 2.101.0 → 2.103.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 +51 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -73,8 +73,11 @@ function ModelDecorator(options) {
73
73
  // packages/shared/models/src/lib/decorators/field/field.decorator.ts
74
74
  import "reflect-metadata";
75
75
 
76
- // packages/shared/utils/src/lib/services/password/password.service.ts
77
- import md5 from "md5";
76
+ // packages/shared/utils/src/lib/services/array/array.service.ts
77
+ import * as _ from "lodash";
78
+
79
+ // packages/shared/utils/src/lib/services/guid/guid.service.ts
80
+ import { Guid } from "guid-typescript";
78
81
 
79
82
  // packages/shared/utils/src/lib/services/object/object.service.ts
80
83
  import { stringify } from "flatted";
@@ -127,11 +130,53 @@ var ObjectService = class {
127
130
  }
128
131
  };
129
132
 
130
- // packages/shared/utils/src/lib/services/guid/guid.service.ts
131
- import { Guid } from "guid-typescript";
133
+ // packages/shared/utils/src/lib/services/password/password.service.ts
134
+ import md5 from "md5";
132
135
 
133
- // packages/shared/utils/src/lib/services/array/array.service.ts
134
- import * as _ from "lodash";
136
+ // packages/shared/utils/src/lib/services/slug/slug.service.ts
137
+ var SlugService = class _SlugService {
138
+ static {
139
+ this.polishToEnglishMap = {
140
+ \u0105: "a",
141
+ \u0107: "c",
142
+ \u0119: "e",
143
+ \u0142: "l",
144
+ \u0144: "n",
145
+ \u00F3: "o",
146
+ \u015B: "s",
147
+ \u017A: "z",
148
+ \u017C: "z",
149
+ \u0104: "A",
150
+ \u0106: "C",
151
+ \u0118: "E",
152
+ \u0141: "L",
153
+ \u0143: "N",
154
+ \u00D3: "O",
155
+ \u015A: "S",
156
+ \u0179: "Z",
157
+ \u017B: "Z"
158
+ };
159
+ }
160
+ /**
161
+ * Convert text to URL-friendly slug
162
+ * - Replaces Polish characters with English equivalents
163
+ * - Converts to lowercase
164
+ * - Replaces spaces and special characters with hyphens
165
+ * - Removes multiple consecutive hyphens
166
+ * - Trims hyphens from start and end
167
+ */
168
+ static create(text) {
169
+ if (!text) {
170
+ return "";
171
+ }
172
+ let slug = text.split("").map((char) => _SlugService.polishToEnglishMap[char] || char).join("");
173
+ slug = slug.toLowerCase();
174
+ slug = slug.replace(/[^a-z0-9]+/g, "-");
175
+ slug = slug.replace(/-+/g, "-");
176
+ slug = slug.replace(/^-+|-+$/g, "");
177
+ return slug;
178
+ }
179
+ };
135
180
 
136
181
  // packages/shared/models/src/lib/decorators/field/field.decorator.ts
137
182
  var Field = FieldDecorator;
package/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@smartsoft001/auth-shell-dtos",
3
- "version": "2.101.0"
3
+ "version": "2.103.0"
4
4
  }