Skip to content

Commit 6f1292f

Browse files
committed
fix: replace CommonJS package
1 parent 0cde2e4 commit 6f1292f

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@
5858
"vue": "^3.2.0"
5959
},
6060
"dependencies": {
61-
"clamp": "^1.0.1",
62-
"lodash.throttle": "^4.1.1",
61+
"lodash-es": "^4.17.21",
6362
"material-colors": "^1.2.6",
6463
"@ctrl/tinycolor": "^3.4.0"
6564
},

src/components/saturation/saturation.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
</template>
1515

1616
<script>
17-
import clamp from 'clamp';
18-
import throttle from 'lodash.throttle';
17+
import { clamp, throttle } from '@/utils/utils';
1918
2019
export default {
2120
name: 'Saturation',

src/utils/utils.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export { throttle } from 'lodash-es';
2+
3+
/* eslint-disable no-nested-ternary */
4+
export function clamp(value, min, max) {
5+
return min < max
6+
? (value < min ? min : value > max ? max : value)
7+
: (value < max ? max : value > min ? min : value);
8+
}

yarn.lock

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,11 +1763,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
17631763
inherits "^2.0.1"
17641764
safe-buffer "^5.0.1"
17651765

1766-
clamp@^1.0.1:
1767-
version "1.0.1"
1768-
resolved "https://registry.yarnpkg.com/clamp/-/clamp-1.0.1.tgz#66a0e64011816e37196828fdc8c8c147312c8634"
1769-
integrity sha1-ZqDmQBGBbjcZaCj9yMjBRzEshjQ=
1770-
17711766
class-utils@^0.3.5:
17721767
version "0.3.6"
17731768
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
@@ -5267,6 +5262,11 @@ locate-path@^6.0.0:
52675262
dependencies:
52685263
p-locate "^5.0.0"
52695264

5265+
lodash-es@^4.17.21:
5266+
version "4.17.21"
5267+
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
5268+
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
5269+
52705270
lodash.camelcase@^4.3.0:
52715271
version "4.3.0"
52725272
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
@@ -5307,11 +5307,6 @@ lodash.merge@^4.6.2:
53075307
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
53085308
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
53095309

5310-
lodash.throttle@^4.1.1:
5311-
version "4.1.1"
5312-
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
5313-
integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=
5314-
53155310
lodash.transform@^4.6.0:
53165311
version "4.6.0"
53175312
resolved "https://registry.yarnpkg.com/lodash.transform/-/lodash.transform-4.6.0.tgz#12306422f63324aed8483d3f38332b5f670547a0"

0 commit comments

Comments
 (0)