@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.
- package/CHANGELOG.md +8 -0
- package/LICENSE.md +1 -0
- package/{lib/isEmpty.js → babel.config.cjs} +12 -15
- package/es/camelize.js +1 -1
- package/es/capitalizeFirstLetter.js +1 -1
- package/es/cloneArray.js +1 -1
- package/es/convertCase.js +3 -2
- package/es/getBrowser.js +1 -2
- package/es/index.js +18 -18
- package/es/mergeDeep.js +1 -1
- package/es/ms.js +4 -2
- package/es/parseUnit.js +1 -1
- package/es/pascalize.js +4 -3
- package/es/px.js +2 -2
- package/es/shallowEqual.js +1 -1
- package/es/within.js +1 -1
- package/package.json +7 -9
- package/src/camelize.ts +1 -1
- package/src/capitalizeFirstLetter.ts +1 -1
- package/src/cloneArray.ts +1 -1
- package/src/convertCase.ts +2 -2
- package/src/getBrowser.ts +1 -1
- package/src/index.ts +18 -18
- package/src/mergeDeep.ts +1 -1
- package/src/ms.ts +2 -2
- package/src/parseUnit.ts +1 -1
- package/src/pascalize.ts +3 -3
- package/src/px.ts +2 -2
- package/src/shallowEqual.ts +1 -1
- package/src/within.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/camelize.d.ts +1 -1
- package/types/capitalizeFirstLetter.d.ts +1 -1
- package/types/cloneArray.d.ts +1 -1
- package/types/convertCase.d.ts +2 -2
- package/types/convertCase.d.ts.map +1 -1
- package/types/getBrowser.d.ts +1 -1
- package/types/index.d.ts +18 -18
- package/types/index.d.ts.map +1 -1
- package/types/mergeDeep.d.ts +1 -1
- package/types/ms.d.ts +1 -1
- package/types/parseUnit.d.ts +1 -1
- package/types/pascalize.d.ts +1 -1
- package/types/px.d.ts +1 -1
- package/types/shallowEqual.d.ts +1 -1
- package/types/within.d.ts +1 -1
- package/lib/camelize.js +0 -53
- package/lib/capitalizeFirstLetter.js +0 -43
- package/lib/cloneArray.js +0 -52
- package/lib/combineDataCid.js +0 -41
- package/lib/convertCase.js +0 -19
- package/lib/createChainedFunction.js +0 -86
- package/lib/deepEqual.js +0 -38
- package/lib/generateId.js +0 -48
- package/lib/getBrowser.js +0 -87
- package/lib/hash.js +0 -82
- package/lib/index.js +0 -173
- package/lib/isBaseTheme.js +0 -50
- package/lib/mergeDeep.js +0 -83
- package/lib/ms.js +0 -62
- package/lib/package.json +0 -1
- package/lib/parseUnit.js +0 -57
- package/lib/pascalize.js +0 -55
- package/lib/px.js +0 -68
- package/lib/shallowEqual.js +0 -85
- package/lib/within.js +0 -48
package/lib/shallowEqual.js
DELETED
|
@@ -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;
|