mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-23 07:20:35 +03:00
fix: replace lodash.uniqby with internal fn
This commit is contained in:
Generated
-5
@@ -6595,11 +6595,6 @@
|
|||||||
"integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=",
|
"integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"lodash.uniqby": {
|
|
||||||
"version": "4.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz",
|
|
||||||
"integrity": "sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI="
|
|
||||||
},
|
|
||||||
"lodash.uniqueid": {
|
"lodash.uniqueid": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.uniqueid/-/lodash.uniqueid-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.uniqueid/-/lodash.uniqueid-4.0.1.tgz",
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"deepmerge": "^3.0.0",
|
"deepmerge": "^3.0.0",
|
||||||
"lodash.isplainobject": "^4.0.6",
|
"lodash.isplainobject": "^4.0.6",
|
||||||
"lodash.uniqby": "^4.7.0",
|
|
||||||
"lodash.uniqueid": "^4.0.1",
|
"lodash.uniqueid": "^4.0.1",
|
||||||
"object-assign": "^4.1.1"
|
"object-assign": "^4.1.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import deepmerge from 'deepmerge'
|
import deepmerge from 'deepmerge'
|
||||||
import uniqBy from 'lodash.uniqby'
|
import uniqBy from './uniqBy'
|
||||||
import uniqueId from 'lodash.uniqueid'
|
import uniqueId from 'lodash.uniqueid'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,7 +67,7 @@ export default function getComponentOption (opts, result = {}) {
|
|||||||
return metaObject
|
return metaObject
|
||||||
})
|
})
|
||||||
result.meta = uniqBy(
|
result.meta = uniqBy(
|
||||||
result.meta.reverse(),
|
result.meta,
|
||||||
metaObject => metaObject.hasOwnProperty(tagIDKeyName) ? metaObject[tagIDKeyName] : uniqueId()
|
metaObject => metaObject.hasOwnProperty(tagIDKeyName) ? metaObject[tagIDKeyName] : uniqueId()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
export default function uniqBy (inputArray, predicate) {
|
||||||
|
return inputArray
|
||||||
|
.sort((a, b) => predicate(a) > predicate(b))
|
||||||
|
.filter((x, i, arr) => i === arr.length - 1
|
||||||
|
? true
|
||||||
|
: predicate(x) !== predicate(arr[i + 1])
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user