@instructure/ui-utils 11.7.3 → 11.7.4-pr-snapshot-1781695314229

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE.md +1 -0
  3. package/{lib/isEmpty.js → babel.config.cjs} +12 -15
  4. package/es/camelize.js +1 -1
  5. package/es/capitalizeFirstLetter.js +1 -1
  6. package/es/cloneArray.js +1 -1
  7. package/es/convertCase.js +3 -2
  8. package/es/getBrowser.js +1 -2
  9. package/es/index.js +18 -18
  10. package/es/mergeDeep.js +1 -1
  11. package/es/ms.js +4 -2
  12. package/es/parseUnit.js +1 -1
  13. package/es/pascalize.js +4 -3
  14. package/es/px.js +2 -2
  15. package/es/shallowEqual.js +1 -1
  16. package/es/within.js +1 -1
  17. package/package.json +7 -9
  18. package/src/camelize.ts +1 -1
  19. package/src/capitalizeFirstLetter.ts +1 -1
  20. package/src/cloneArray.ts +1 -1
  21. package/src/convertCase.ts +2 -2
  22. package/src/getBrowser.ts +1 -1
  23. package/src/index.ts +18 -18
  24. package/src/mergeDeep.ts +1 -1
  25. package/src/ms.ts +2 -2
  26. package/src/parseUnit.ts +1 -1
  27. package/src/pascalize.ts +3 -3
  28. package/src/px.ts +2 -2
  29. package/src/shallowEqual.ts +1 -1
  30. package/src/within.ts +1 -1
  31. package/tsconfig.build.tsbuildinfo +1 -1
  32. package/types/camelize.d.ts +1 -1
  33. package/types/capitalizeFirstLetter.d.ts +1 -1
  34. package/types/cloneArray.d.ts +1 -1
  35. package/types/convertCase.d.ts +2 -2
  36. package/types/convertCase.d.ts.map +1 -1
  37. package/types/getBrowser.d.ts +1 -1
  38. package/types/index.d.ts +18 -18
  39. package/types/index.d.ts.map +1 -1
  40. package/types/mergeDeep.d.ts +1 -1
  41. package/types/ms.d.ts +1 -1
  42. package/types/parseUnit.d.ts +1 -1
  43. package/types/pascalize.d.ts +1 -1
  44. package/types/px.d.ts +1 -1
  45. package/types/shallowEqual.d.ts +1 -1
  46. package/types/within.d.ts +1 -1
  47. package/lib/camelize.js +0 -53
  48. package/lib/capitalizeFirstLetter.js +0 -43
  49. package/lib/cloneArray.js +0 -52
  50. package/lib/combineDataCid.js +0 -41
  51. package/lib/convertCase.js +0 -19
  52. package/lib/createChainedFunction.js +0 -86
  53. package/lib/deepEqual.js +0 -38
  54. package/lib/generateId.js +0 -48
  55. package/lib/getBrowser.js +0 -87
  56. package/lib/hash.js +0 -82
  57. package/lib/index.js +0 -173
  58. package/lib/isBaseTheme.js +0 -50
  59. package/lib/mergeDeep.js +0 -83
  60. package/lib/ms.js +0 -62
  61. package/lib/package.json +0 -1
  62. package/lib/parseUnit.js +0 -57
  63. package/lib/pascalize.js +0 -55
  64. package/lib/px.js +0 -68
  65. package/lib/shallowEqual.js +0 -85
  66. package/lib/within.js +0 -48
@@ -1,85 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- exports.shallowEqual = shallowEqual;
8
- /*
9
- * The MIT License (MIT)
10
- *
11
- * Copyright (c) 2015 - present Instructure, Inc.
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
- * copies of the Software, and to permit persons to whom the Software is
18
- * furnished to do so, subject to the following conditions:
19
- *
20
- * The above copyright notice and this permission notice shall be included in all
21
- * copies or substantial portions of the Software.
22
- *
23
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
- * SOFTWARE.
30
- */
31
-
32
- // https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js
33
- const hasOwnProperty = Object.prototype.hasOwnProperty;
34
-
35
- /**
36
- * ---
37
- * category: utilities/utils
38
- * ---
39
- * Performs equality by iterating through keys on an object and returning false
40
- * when any key has values which are not strictly equal between the arguments.
41
- *
42
- * @module shallowEqual
43
- *
44
- * @param {Object} objA
45
- * @param {Object} objB
46
- * @returns {Boolean} Returns true when the values of all keys are strictly equal
47
- */
48
- function shallowEqual(objA, objB) {
49
- if (is(objA, objB)) {
50
- return true;
51
- }
52
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
53
- return false;
54
- }
55
- const keysA = Object.keys(objA);
56
- const keysB = Object.keys(objB);
57
- if (keysA.length !== keysB.length) {
58
- return false;
59
- }
60
-
61
- // Test for A's keys different from B.
62
- for (let i = 0; i < keysA.length; i++) {
63
- if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
64
- return false;
65
- }
66
- }
67
- return true;
68
- }
69
-
70
- /*
71
- * inlined Object.is polyfill to avoid requiring consumers ship their own
72
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
73
- */
74
- function is(x, y) {
75
- // SameValue algorithm
76
- if (x === y) {
77
- // Steps 1-5, 7-10
78
- // Steps 6.b-6.e: +0 != -0
79
- return x !== 0 || y !== 0 || 1 / x === 1 / y;
80
- } else {
81
- // Step 6.a: NaN == NaN
82
- return x !== x && y !== y;
83
- }
84
- }
85
- var _default = exports.default = shallowEqual;
package/lib/within.js DELETED
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- exports.within = within;
8
- /*
9
- * The MIT License (MIT)
10
- *
11
- * Copyright (c) 2015 - present Instructure, Inc.
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
- * copies of the Software, and to permit persons to whom the Software is
18
- * furnished to do so, subject to the following conditions:
19
- *
20
- * The above copyright notice and this permission notice shall be included in all
21
- * copies or substantial portions of the Software.
22
- *
23
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
- * SOFTWARE.
30
- */
31
-
32
- /**
33
- * ---
34
- * category: utilities/utils
35
- * ---
36
- * Determines if one numerical value (a) is within a designated range (diff) of another (b)
37
- *
38
- * @module within
39
- *
40
- * @param {number} a
41
- * @param {number} b
42
- * @param {number} [diff=1]
43
- * @returns {Boolean} Returns true if a is within the diff range of b
44
- */
45
- function within(a, b, diff = 1) {
46
- return a + diff >= b && b >= a - diff;
47
- }
48
- var _default = exports.default = within;