@oscarpalmer/jhunal 0.8.0 → 0.10.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.
package/dist/constants.js CHANGED
@@ -1,8 +1,9 @@
1
1
  const EXPRESSION_HAS_NUMBER = /\d+/;
2
2
  const EXPRESSION_INDEX = /\.\d+$/;
3
- const EXPRESSION_PROPERTY = /\.\$(required|type)(\.|$)/;
3
+ const EXPRESSION_PROPERTY = /\.\$(required|type|validators)(\.|$)/;
4
4
  const PROPERTY_REQUIRED = "$required";
5
5
  const PROPERTY_TYPE = "$type";
6
+ const PROPERTY_VALIDATORS = "$validators";
6
7
  const SCHEMATIC_NAME = "$schematic";
7
8
  const TYPE_OBJECT = "object";
8
9
  const TYPE_UNDEFINED = "undefined";
@@ -19,4 +20,4 @@ const TYPE_ALL = new Set([
19
20
  TYPE_OBJECT,
20
21
  TYPE_UNDEFINED
21
22
  ]);
22
- export { EXPRESSION_HAS_NUMBER, EXPRESSION_INDEX, EXPRESSION_PROPERTY, PROPERTY_REQUIRED, PROPERTY_TYPE, SCHEMATIC_NAME, TYPE_ALL, TYPE_OBJECT, TYPE_UNDEFINED };
23
+ export { EXPRESSION_HAS_NUMBER, EXPRESSION_INDEX, EXPRESSION_PROPERTY, PROPERTY_REQUIRED, PROPERTY_TYPE, PROPERTY_VALIDATORS, SCHEMATIC_NAME, TYPE_ALL, TYPE_OBJECT, TYPE_UNDEFINED };
package/dist/is.js CHANGED
@@ -1,7 +1,5 @@
1
1
  import "./constants.js";
2
- function isConstructor(value) {
3
- return typeof value === "function" && value.prototype !== void 0;
4
- }
2
+ import { isConstructor } from "@oscarpalmer/atoms/is";
5
3
  function isInstance(constructor) {
6
4
  if (!isConstructor(constructor)) throw new TypeError("Expected a constructor function");
7
5
  return (value) => {
@@ -11,4 +9,4 @@ function isInstance(constructor) {
11
9
  function isSchematic(value) {
12
10
  return typeof value === "object" && value !== null && "$schematic" in value && value["$schematic"] === true;
13
11
  }
14
- export { isConstructor, isInstance, isSchematic };
12
+ export { isInstance, isSchematic };