yuppi 1.3.0 → 1.3.1
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/README.md +2 -2
- package/dist/main.js +6 -1
- package/dist/main.mjs +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -224,9 +224,9 @@ Declare your Yuppi schema for TypeScript.
|
|
|
224
224
|
> Example:
|
|
225
225
|
>
|
|
226
226
|
> ```typescript
|
|
227
|
-
> import type { User } from './yuppi/types/
|
|
227
|
+
> import type { User } from './yuppi/types/User';
|
|
228
228
|
>
|
|
229
|
-
> Yupp.declare(schema, '
|
|
229
|
+
> Yupp.declare(schema, 'User');
|
|
230
230
|
>
|
|
231
231
|
> const user = Yupp.validate(schema, properties) as User;
|
|
232
232
|
> /*
|
package/dist/main.js
CHANGED
|
@@ -178,6 +178,11 @@ var convertToYup = (schema, error_messages) => {
|
|
|
178
178
|
return Yup.object().shape(properties);
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
+
// src/utils/PascalCase.util.ts
|
|
182
|
+
var pascalCase = (text) => {
|
|
183
|
+
return text.replace(/[^a-zA-Z0-9]/g, " ").split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
184
|
+
};
|
|
185
|
+
|
|
181
186
|
// src/defaults/YuppiOptions.default.ts
|
|
182
187
|
var YuppiOptionsDefault = {
|
|
183
188
|
folder_path: "./",
|
|
@@ -236,7 +241,7 @@ var Yuppi = class {
|
|
|
236
241
|
return yup_schema.validateSync(properties, this.options.validate_options);
|
|
237
242
|
}
|
|
238
243
|
declare(schema, name) {
|
|
239
|
-
name = name
|
|
244
|
+
name = pascalCase(name);
|
|
240
245
|
const types_dir = import_path.default.join(this.options.folder_path ?? "./", "yuppi", "types");
|
|
241
246
|
const banner_comment = `/* eslint-disable */
|
|
242
247
|
|
package/dist/main.mjs
CHANGED
|
@@ -147,6 +147,11 @@ var convertToYup = (schema, error_messages) => {
|
|
|
147
147
|
return Yup.object().shape(properties);
|
|
148
148
|
};
|
|
149
149
|
|
|
150
|
+
// src/utils/PascalCase.util.ts
|
|
151
|
+
var pascalCase = (text) => {
|
|
152
|
+
return text.replace(/[^a-zA-Z0-9]/g, " ").split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
153
|
+
};
|
|
154
|
+
|
|
150
155
|
// src/defaults/YuppiOptions.default.ts
|
|
151
156
|
var YuppiOptionsDefault = {
|
|
152
157
|
folder_path: "./",
|
|
@@ -205,7 +210,7 @@ var Yuppi = class {
|
|
|
205
210
|
return yup_schema.validateSync(properties, this.options.validate_options);
|
|
206
211
|
}
|
|
207
212
|
declare(schema, name) {
|
|
208
|
-
name = name
|
|
213
|
+
name = pascalCase(name);
|
|
209
214
|
const types_dir = path.join(this.options.folder_path ?? "./", "yuppi", "types");
|
|
210
215
|
const banner_comment = `/* eslint-disable */
|
|
211
216
|
|