@bedrockio/yada 1.0.1 → 1.0.2
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/cjs/Schema.js +265 -0
- package/dist/cjs/TypeSchema.js +30 -0
- package/dist/cjs/array.js +128 -0
- package/dist/cjs/boolean.js +29 -0
- package/dist/cjs/date.js +130 -0
- package/dist/cjs/errors.js +87 -0
- package/dist/cjs/index.js +51 -0
- package/dist/cjs/localization.js +39 -0
- package/dist/cjs/messages.js +75 -0
- package/dist/cjs/number.js +91 -0
- package/dist/cjs/object.js +104 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/password.js +52 -0
- package/dist/cjs/string.js +280 -0
- package/dist/cjs/utils.js +28 -0
- package/package.json +3 -1
- package/.eslintrc +0 -13
- package/babel.config.json +0 -17
- package/jest.config.json +0 -5
- package/scripts/build +0 -4
- package/src/__tests__/index.js +0 -1855
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.isSchemaError = exports.isSchema = void 0;
|
|
5
|
+
exports.wrapAny = wrapAny;
|
|
6
|
+
exports.wrapArgs = wrapArgs;
|
|
7
|
+
exports.wrapSchema = wrapSchema;
|
|
8
|
+
var _Schema = _interopRequireWildcard(require("./Schema"));
|
|
9
|
+
exports.isSchema = _Schema.isSchema;
|
|
10
|
+
var _errors = require("./errors");
|
|
11
|
+
exports.isSchemaError = _errors.isSchemaError;
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
function wrapSchema(Class) {
|
|
15
|
+
return (...args) => {
|
|
16
|
+
return new Class(...args);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function wrapArgs(name) {
|
|
20
|
+
return (...args) => {
|
|
21
|
+
return new _Schema.default()[name](...args);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function wrapAny() {
|
|
25
|
+
return () => {
|
|
26
|
+
return new _Schema.default();
|
|
27
|
+
};
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrockio/yada",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Validation library inspired by Joi.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
"lint": "eslint"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
|
+
"main": "dist/cjs/index.js",
|
|
12
|
+
"module": "src/index.js",
|
|
11
13
|
"repository": "https://github.com/bedrockio/yada",
|
|
12
14
|
"author": "Andrew Plummer <plummer.andrew@gmail.com>",
|
|
13
15
|
"license": "MIT",
|
package/.eslintrc
DELETED
package/babel.config.json
DELETED
package/jest.config.json
DELETED
package/scripts/build
DELETED