mirror of
https://github.com/retailcrm/vue-i18n-loader.git
synced 2024-11-25 23:06:04 +03:00
20 lines
360 B
JavaScript
20 lines
360 B
JavaScript
module.exports = class VueI18NMetadata {
|
|
constructor () {
|
|
this.paths = new Map()
|
|
}
|
|
|
|
getPaths (id) {
|
|
if (this.paths.has(id)) {
|
|
return this.paths.get(id)
|
|
}
|
|
|
|
return []
|
|
}
|
|
|
|
addPaths (id, paths) {
|
|
const _knownPaths = this.getPaths(id)
|
|
|
|
this.paths.set(id, _knownPaths.concat(paths.filter(p => !_knownPaths.includes(p))))
|
|
}
|
|
}
|