@instructure/ui-utils 8.12.1-snapshot.44 → 8.12.1-snapshot.50
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/es/createChainedFunction.js +10 -2
- package/es/hash.js +3 -1
- package/es/mergeDeep.js +6 -1
- package/es/within.js +2 -1
- package/lib/createChainedFunction.js +10 -2
- package/lib/hash.js +4 -2
- package/lib/index.js +20 -20
- package/lib/isEmpty.js +1 -1
- package/lib/mergeDeep.js +7 -2
- package/lib/ms.js +1 -1
- package/lib/parseUnit.js +1 -1
- package/lib/pascalize.js +1 -1
- package/lib/px.js +1 -1
- package/lib/shallowEqual.js +1 -1
- package/lib/within.js +3 -2
- package/package.json +6 -6
|
@@ -36,7 +36,11 @@
|
|
|
36
36
|
* @param {function} funcs to chain
|
|
37
37
|
* @returns {function|null}
|
|
38
38
|
*/
|
|
39
|
-
function createChainedFunction(
|
|
39
|
+
function createChainedFunction() {
|
|
40
|
+
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41
|
+
funcs[_key] = arguments[_key];
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
return funcs.filter((f, i) => {
|
|
41
45
|
if (f == null) {
|
|
42
46
|
return false;
|
|
@@ -54,7 +58,11 @@ function createChainedFunction(...funcs) {
|
|
|
54
58
|
return f;
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
return function chainedFunction(
|
|
61
|
+
return function chainedFunction() {
|
|
62
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
63
|
+
args[_key2] = arguments[_key2];
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
acc.apply(this, args);
|
|
59
67
|
f.apply(this, args);
|
|
60
68
|
}; // TODO I think it can return null too
|
package/es/hash.js
CHANGED
|
@@ -58,7 +58,9 @@ function executeHash(input) {
|
|
|
58
58
|
return toBase64(String(hash));
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
function hash(value
|
|
61
|
+
function hash(value) {
|
|
62
|
+
let maxLength = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
63
|
+
|
|
62
64
|
if (typeof value === 'undefined') {
|
|
63
65
|
throw new Error('Cannot hash a value which is undefined');
|
|
64
66
|
}
|
package/es/mergeDeep.js
CHANGED
|
@@ -34,10 +34,15 @@
|
|
|
34
34
|
* @param {Object} args objects to merge
|
|
35
35
|
* @returns {Object} a new object with items from all arguments
|
|
36
36
|
*/
|
|
37
|
-
function mergeDeep(
|
|
37
|
+
function mergeDeep() {
|
|
38
38
|
// note: This could be typed as the union of its args, but since
|
|
39
39
|
// its barely used its not worth the effort currently
|
|
40
40
|
let target = {};
|
|
41
|
+
|
|
42
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
+
args[_key] = arguments[_key];
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
args.forEach(arg => {
|
|
42
47
|
target = mergeSourceIntoTarget(target, arg);
|
|
43
48
|
});
|
package/es/within.js
CHANGED
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
* @param {number} [diff=1]
|
|
36
36
|
* @returns {Boolean} Returns true if a is within the diff range of b
|
|
37
37
|
*/
|
|
38
|
-
function within(a, b
|
|
38
|
+
function within(a, b) {
|
|
39
|
+
let diff = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
|
|
39
40
|
return a + diff >= b && b >= a - diff;
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -44,7 +44,11 @@ exports.default = void 0;
|
|
|
44
44
|
* @param {function} funcs to chain
|
|
45
45
|
* @returns {function|null}
|
|
46
46
|
*/
|
|
47
|
-
function createChainedFunction(
|
|
47
|
+
function createChainedFunction() {
|
|
48
|
+
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
49
|
+
funcs[_key] = arguments[_key];
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
return funcs.filter((f, i) => {
|
|
49
53
|
if (f == null) {
|
|
50
54
|
return false;
|
|
@@ -62,7 +66,11 @@ function createChainedFunction(...funcs) {
|
|
|
62
66
|
return f;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
return function chainedFunction(
|
|
69
|
+
return function chainedFunction() {
|
|
70
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
71
|
+
args[_key2] = arguments[_key2];
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
acc.apply(this, args);
|
|
67
75
|
f.apply(this, args);
|
|
68
76
|
}; // TODO I think it can return null too
|
package/lib/hash.js
CHANGED
|
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.hash = hash;
|
|
9
8
|
exports.default = void 0;
|
|
9
|
+
exports.hash = hash;
|
|
10
10
|
|
|
11
11
|
var _jsonStableStringify = _interopRequireDefault(require("json-stable-stringify"));
|
|
12
12
|
|
|
@@ -68,7 +68,9 @@ function executeHash(input) {
|
|
|
68
68
|
return toBase64(String(hash));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
function hash(value
|
|
71
|
+
function hash(value) {
|
|
72
|
+
let maxLength = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
73
|
+
|
|
72
74
|
if (typeof value === 'undefined') {
|
|
73
75
|
throw new Error('Cannot hash a value which is undefined');
|
|
74
76
|
}
|
package/lib/index.js
CHANGED
|
@@ -9,16 +9,10 @@ Object.defineProperty(exports, "Browser", {
|
|
|
9
9
|
return _Browser.Browser;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _isEdge.isEdge;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "isIE11", {
|
|
12
|
+
Object.defineProperty(exports, "camelize", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function () {
|
|
21
|
-
return
|
|
15
|
+
return _camelize.camelize;
|
|
22
16
|
}
|
|
23
17
|
});
|
|
24
18
|
Object.defineProperty(exports, "capitalizeFirstLetter", {
|
|
@@ -51,12 +45,24 @@ Object.defineProperty(exports, "hash", {
|
|
|
51
45
|
return _hash.hash;
|
|
52
46
|
}
|
|
53
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "isEdge", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _isEdge.isEdge;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
54
|
Object.defineProperty(exports, "isEmpty", {
|
|
55
55
|
enumerable: true,
|
|
56
56
|
get: function () {
|
|
57
57
|
return _isEmpty.isEmpty;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "isIE11", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _isIE.isIE11;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
60
66
|
Object.defineProperty(exports, "mergeDeep", {
|
|
61
67
|
enumerable: true,
|
|
62
68
|
get: function () {
|
|
@@ -75,6 +81,12 @@ Object.defineProperty(exports, "parseUnit", {
|
|
|
75
81
|
return _parseUnit.parseUnit;
|
|
76
82
|
}
|
|
77
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "pascalize", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _pascalize.pascalize;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
78
90
|
Object.defineProperty(exports, "px", {
|
|
79
91
|
enumerable: true,
|
|
80
92
|
get: function () {
|
|
@@ -93,18 +105,6 @@ Object.defineProperty(exports, "within", {
|
|
|
93
105
|
return _within.within;
|
|
94
106
|
}
|
|
95
107
|
});
|
|
96
|
-
Object.defineProperty(exports, "camelize", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return _camelize.camelize;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(exports, "pascalize", {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function () {
|
|
105
|
-
return _pascalize.pascalize;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
108
|
|
|
109
109
|
var _Browser = require("./Browser");
|
|
110
110
|
|
package/lib/isEmpty.js
CHANGED
package/lib/mergeDeep.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.mergeDeep = mergeDeep;
|
|
7
6
|
exports.default = void 0;
|
|
7
|
+
exports.mergeDeep = mergeDeep;
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
@@ -42,10 +42,15 @@ exports.default = void 0;
|
|
|
42
42
|
* @param {Object} args objects to merge
|
|
43
43
|
* @returns {Object} a new object with items from all arguments
|
|
44
44
|
*/
|
|
45
|
-
function mergeDeep(
|
|
45
|
+
function mergeDeep() {
|
|
46
46
|
// note: This could be typed as the union of its args, but since
|
|
47
47
|
// its barely used its not worth the effort currently
|
|
48
48
|
let target = {};
|
|
49
|
+
|
|
50
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
|
+
args[_key] = arguments[_key];
|
|
52
|
+
}
|
|
53
|
+
|
|
49
54
|
args.forEach(arg => {
|
|
50
55
|
target = mergeSourceIntoTarget(target, arg);
|
|
51
56
|
});
|
package/lib/ms.js
CHANGED
|
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.ms = ms;
|
|
9
8
|
exports.default = void 0;
|
|
9
|
+
exports.ms = ms;
|
|
10
10
|
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
|
package/lib/parseUnit.js
CHANGED
package/lib/pascalize.js
CHANGED
package/lib/px.js
CHANGED
|
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.px = px;
|
|
9
8
|
exports.default = void 0;
|
|
9
|
+
exports.px = px;
|
|
10
10
|
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
|
package/lib/shallowEqual.js
CHANGED
package/lib/within.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.within = within;
|
|
7
6
|
exports.default = void 0;
|
|
7
|
+
exports.within = within;
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
@@ -43,7 +43,8 @@ exports.default = void 0;
|
|
|
43
43
|
* @param {number} [diff=1]
|
|
44
44
|
* @returns {Boolean} Returns true if a is within the diff range of b
|
|
45
45
|
*/
|
|
46
|
-
function within(a, b
|
|
46
|
+
function within(a, b) {
|
|
47
|
+
let diff = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
|
|
47
48
|
return a + diff >= b && b >= a - diff;
|
|
48
49
|
}
|
|
49
50
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-utils",
|
|
3
|
-
"version": "8.12.1-snapshot.
|
|
3
|
+
"version": "8.12.1-snapshot.50+3786369ec",
|
|
4
4
|
"description": "A collection of utilities for UI components",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.12.1-snapshot.
|
|
27
|
-
"@instructure/ui-test-utils": "8.12.1-snapshot.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.12.1-snapshot.50+3786369ec",
|
|
27
|
+
"@instructure/ui-test-utils": "8.12.1-snapshot.50+3786369ec",
|
|
28
28
|
"@types/json-stable-stringify": "^1.0.1"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.13.10",
|
|
32
|
-
"@instructure/console": "8.12.1-snapshot.
|
|
33
|
-
"@instructure/ui-dom-utils": "8.12.1-snapshot.
|
|
32
|
+
"@instructure/console": "8.12.1-snapshot.50+3786369ec",
|
|
33
|
+
"@instructure/ui-dom-utils": "8.12.1-snapshot.50+3786369ec",
|
|
34
34
|
"bowser": "^1.9.4",
|
|
35
35
|
"fast-deep-equal": "^2",
|
|
36
36
|
"json-stable-stringify": "^1.0.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"sideEffects": false,
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "3786369ec892bc0f716844828cc2729447adb8be"
|
|
48
48
|
}
|