speedly 1.2.27 → 1.2.28

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.
@@ -1,3 +1 @@
1
- declare const string: any, object: any, array: any, lazy: any;
2
- declare const paramId: any;
3
- declare const schema: any;
1
+ export {};
@@ -1,14 +1,18 @@
1
- // const makeOptional = require("../../util/makeOptional");
2
- // import makeOptional from '../../util/'
3
- const { string, object, array, lazy } = require("../../yup.config");
4
- const paramId = object({
5
- id: string().required('id is required').oid('id is invalid')
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const makeOptional_1 = __importDefault(require("../../util/makeOptional"));
7
+ const yup_config_1 = require("./../../yup.config");
8
+ const paramId = (0, yup_config_1.object)({
9
+ id: (0, yup_config_1.string)().required('id is required').oid('id is invalid')
6
10
  });
7
- const schema = object({
8
- translatedText: string().required('translatedText is required'),
11
+ const schema = (0, yup_config_1.object)({
12
+ translatedText: (0, yup_config_1.string)().required('translatedText is required'),
9
13
  });
10
14
  //? exports
11
15
  exports.put = {
12
16
  params: paramId,
13
- // body : makeOptional(schema)
17
+ body: (0, makeOptional_1.default)(schema)
14
18
  };
@@ -0,0 +1 @@
1
+ export default function (schema: any): any;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = default_1;
7
+ const yup_config_1 = __importDefault(require("./../yup.config"));
8
+ function default_1(schema) {
9
+ if (schema.fields) {
10
+ const shape = {};
11
+ for (const key in schema.fields) {
12
+ shape[key] = schema.fields[key].optional();
13
+ }
14
+ return yup_config_1.default.object().shape(shape);
15
+ }
16
+ return schema;
17
+ }
@@ -1,16 +1,18 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // const makeOptional = require("../../util/makeOptional");
4
- // import makeOptional from '../../util/'
5
- const { string, object, array, lazy } = require("../../yup.config");
6
- const paramId = object({
7
- id: string().required('id is required').oid('id is invalid')
6
+ const makeOptional_1 = __importDefault(require("../../util/makeOptional"));
7
+ const yup_config_1 = require("./../../yup.config");
8
+ const paramId = (0, yup_config_1.object)({
9
+ id: (0, yup_config_1.string)().required('id is required').oid('id is invalid')
8
10
  });
9
- const schema = object({
10
- translatedText: string().required('translatedText is required'),
11
+ const schema = (0, yup_config_1.object)({
12
+ translatedText: (0, yup_config_1.string)().required('translatedText is required'),
11
13
  });
12
14
  //? exports
13
15
  exports.put = {
14
16
  params: paramId,
15
- // body : makeOptional(schema)
17
+ body: (0, makeOptional_1.default)(schema)
16
18
  };
@@ -0,0 +1 @@
1
+ export default function (schema: any): any;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = default_1;
7
+ const yup_config_1 = __importDefault(require("./../yup.config"));
8
+ function default_1(schema) {
9
+ if (schema.fields) {
10
+ const shape = {};
11
+ for (const key in schema.fields) {
12
+ shape[key] = schema.fields[key].optional();
13
+ }
14
+ return yup_config_1.default.object().shape(shape);
15
+ }
16
+ return schema;
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speedly",
3
- "version": "1.2.27",
3
+ "version": "1.2.28",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",