@elliemae/ds-props-helpers 2.0.0-alpha.9 → 2.0.0-next.4

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.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ require('core-js/modules/web.dom-collections.iterator.js');
6
+
5
7
  const getAriaProps = props => Object.fromEntries(Object.entries(props).filter(([key]) => key.includes('aria-')));
6
8
  const getDataProps = props => Object.fromEntries(Object.entries(props).filter(([key]) => key.includes('data-')));
7
9
 
@@ -6,17 +6,10 @@ require('core-js/modules/es.string.replace.js');
6
6
 
7
7
  /* eslint-disable max-params */
8
8
  const throwTypeError = (componentName, validPropKey, invalidProp, validFormat) => {
9
- throw new Error(`${componentName}:: You are trying to pass a not valid "${validPropKey}" property,
10
- please provide a valid type.
11
-
12
- Received: ${invalidProp} (${typeof invalidProp})
13
- Expected: (${validFormat.replace('\n', ' or ')})
14
- `);
9
+ throw new Error("".concat(componentName, ":: You are trying to pass a not valid \"").concat(validPropKey, "\" property, \n please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(typeof invalidProp, ")\n Expected: (").concat(validFormat.replace('\n', ' or '), ")\n "));
15
10
  };
16
11
  const throwRequiredError = (componentName, validPropKey) => {
17
- throw new Error(`${componentName}:: Please provide a/an "${validPropKey}" property to use this component.
18
- This property is required.
19
- `);
12
+ throw new Error("".concat(componentName, ":: Please provide a/an \"").concat(validPropKey, "\" property to use this component. \n This property is required.\n "));
20
13
  };
21
14
 
22
15
  exports.throwRequiredError = throwRequiredError;
@@ -2,13 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ require('core-js/modules/web.dom-collections.iterator.js');
5
6
  var react = require('react');
6
7
  var errorTemplates = require('./errorTemplates.js');
7
8
  var typescriptGuards = require('./typescriptGuards.js');
8
9
  var typescriptParsers = require('./typescriptParsers.js');
9
10
 
10
- /* eslint-disable complexity */
11
-
12
11
  // =============================================================================
13
12
  // Atom Validators
14
13
  // =============================================================================
@@ -41,7 +40,7 @@ const validateArray = (schemaName, key, value, format, validationsMemo, nextVali
41
40
 
42
41
 
43
42
  value.forEach((val, index) => {
44
- validateValueWithFormat(schemaName, `${key}[${index}]`, val, format.slice(0, -2), validationsMemo, nextValidationsMemo);
43
+ validateValueWithFormat(schemaName, "".concat(key, "[").concat(index, "]"), val, format.slice(0, -2), validationsMemo, nextValidationsMemo);
45
44
  });
46
45
  };
47
46
 
@@ -64,7 +63,7 @@ const validateObject = (schemaName, key, value, format, validationsMemo, nextVal
64
63
  }
65
64
 
66
65
  if (trueKey in value) {
67
- validateValueWithFormat(schemaName, `${key}[${trueKey}]`, value[trueKey], objectValue, validationsMemo, nextValidationsMemo);
66
+ validateValueWithFormat(schemaName, "".concat(key, "[").concat(trueKey, "]"), value[trueKey], objectValue, validationsMemo, nextValidationsMemo);
68
67
  }
69
68
  });
70
69
  };
@@ -1,3 +1,5 @@
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
+
1
3
  const getAriaProps = props => Object.fromEntries(Object.entries(props).filter(([key]) => key.includes('aria-')));
2
4
  const getDataProps = props => Object.fromEntries(Object.entries(props).filter(([key]) => key.includes('data-')));
3
5
 
@@ -2,17 +2,10 @@ import 'core-js/modules/es.string.replace.js';
2
2
 
3
3
  /* eslint-disable max-params */
4
4
  const throwTypeError = (componentName, validPropKey, invalidProp, validFormat) => {
5
- throw new Error(`${componentName}:: You are trying to pass a not valid "${validPropKey}" property,
6
- please provide a valid type.
7
-
8
- Received: ${invalidProp} (${typeof invalidProp})
9
- Expected: (${validFormat.replace('\n', ' or ')})
10
- `);
5
+ throw new Error("".concat(componentName, ":: You are trying to pass a not valid \"").concat(validPropKey, "\" property, \n please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(typeof invalidProp, ")\n Expected: (").concat(validFormat.replace('\n', ' or '), ")\n "));
11
6
  };
12
7
  const throwRequiredError = (componentName, validPropKey) => {
13
- throw new Error(`${componentName}:: Please provide a/an "${validPropKey}" property to use this component.
14
- This property is required.
15
- `);
8
+ throw new Error("".concat(componentName, ":: Please provide a/an \"").concat(validPropKey, "\" property to use this component. \n This property is required.\n "));
16
9
  };
17
10
 
18
11
  export { throwRequiredError, throwTypeError };
@@ -1,10 +1,9 @@
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
1
2
  import { useState, useMemo } from 'react';
2
3
  import { throwRequiredError, throwTypeError } from './errorTemplates.js';
3
4
  import { isUndefined, isPrimitiveType, isUnion, isString, isArray, isObject, isFunction, isJSXorNode, isSomethingWithParenthesis } from './typescriptGuards.js';
4
5
  import { typescriptObjectParser } from './typescriptParsers.js';
5
6
 
6
- /* eslint-disable complexity */
7
-
8
7
  // =============================================================================
9
8
  // Atom Validators
10
9
  // =============================================================================
@@ -37,7 +36,7 @@ const validateArray = (schemaName, key, value, format, validationsMemo, nextVali
37
36
 
38
37
 
39
38
  value.forEach((val, index) => {
40
- validateValueWithFormat(schemaName, `${key}[${index}]`, val, format.slice(0, -2), validationsMemo, nextValidationsMemo);
39
+ validateValueWithFormat(schemaName, "".concat(key, "[").concat(index, "]"), val, format.slice(0, -2), validationsMemo, nextValidationsMemo);
41
40
  });
42
41
  };
43
42
 
@@ -60,7 +59,7 @@ const validateObject = (schemaName, key, value, format, validationsMemo, nextVal
60
59
  }
61
60
 
62
61
  if (trueKey in value) {
63
- validateValueWithFormat(schemaName, `${key}[${trueKey}]`, value[trueKey], objectValue, validationsMemo, nextValidationsMemo);
62
+ validateValueWithFormat(schemaName, "".concat(key, "[").concat(trueKey, "]"), value[trueKey], objectValue, validationsMemo, nextValidationsMemo);
64
63
  }
65
64
  });
66
65
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-props-helpers",
3
- "version": "2.0.0-alpha.9",
3
+ "version": "2.0.0-next.4",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Props Helpers",
6
6
  "module": "./esm/index.js",
@@ -71,7 +71,8 @@
71
71
  "build": "node ../../scripts/build/build.js"
72
72
  },
73
73
  "dependencies": {
74
- "dequal": "~2.0.2"
74
+ "dequal": "~2.0.2",
75
+ "fast-deep-equal": "~3.1.3"
75
76
  },
76
77
  "peerDependencies": {
77
78
  "react": "~17.0.2",
package/cjs/package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "type": "commonjs",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ]
7
- }
package/esm/package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "type": "module",
3
- "sideEffects": [
4
- "*.css",
5
- "*.scss"
6
- ]
7
- }