2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-07 04:42:25 +03:00

begin modularizing code

This commit is contained in:
Declan de Wet
2016-10-31 07:14:11 +02:00
parent 8f82e1306b
commit 017fde49e8
7 changed files with 360 additions and 246 deletions
+3
View File
@@ -35,3 +35,6 @@ jspm_packages
# Optional REPL history
.node_repl_history
# built code
lib
-228
View File
@@ -1,228 +0,0 @@
(function (global) {
'use strict'
var VUE_META_ATTRIBUTE = 'data-vue-meta'
// initialize vue-meta
var VueMeta = {}
// initialize manager
var _manager = {}
/**
* Registers the plugin with Vue.js
* Pass it like so: Vue.use(VueMeta)
* @param {Function} Vue - the Vue constructor
*/
VueMeta.install = function install (Vue) {
// if we've already installed, don't do anything
if (VueMeta.install.installed) return
// set installation inspection flag
VueMeta.install.installed = true
// listen for when components mount - when they do,
// update the meta info & the DOM
Vue.mixin({
mounted: function mounted () {
this.$root.$meta().updateMetaInfo()
}
})
/**
* returns a cached manager API for use on the server
* @return {Object} - manager (The programmatic API for this module)
*/
Vue.prototype.$meta = function $meta () {
_manager.getMetaInfo = _manager.getMetaInfo || Vue.util.bind(getMetaInfo, this)
_manager.updateMetaInfo = _manager.updateMetaInfo || updateMetaInfo
_manager.inject = _manager.inject || inject
return _manager
}
/**
* Converts the state of the meta info object such that each item
* can be compiled to a tag string on the server
* @return {Object} - server meta info with `toString` methods
*/
function inject () {
var info = this.getMetaInfo()
var serverMetaInfo = {}
var key
for (key in info) {
if (info.hasOwnProperty(key)) {
serverMetaInfo[key] = generateServerInjector(key, info[key])
}
}
return serverMetaInfo
}
/**
* Converts a meta info property to one that can be stringified on the server
* @param {String} type - the type of data to convert
* @param {(String|Object|Array<Object>)} data - the data value
* @return {Object} - the new injector
*/
function generateServerInjector (type, data) {
switch (type) {
case 'title':
return {
toString: function toString () {
return '<' + type + ' ' + VUE_META_ATTRIBUTE + '="true">' + data + '</' + type + '>'
}
}
case 'htmlAttrs': {
return {
toString: function toString () {
var attributeStr = ''
var attr
for (attr in data) {
if (data.hasOwnProperty(attr)) {
attributeStr += typeof data[attr] !== 'undefined' ? (attr + '="' + data[attr] + '"') : attr
attributeStr += ' '
}
}
return attributeStr.trim()
}
}
}
}
}
/**
* Updates meta info and renders it to the DOM
*/
function updateMetaInfo () {
var newMeta = this.getMetaInfo()
if (newMeta.title) {
updateTitle(newMeta.title)
}
if (newMeta.htmlAttrs) {
updateHtmlAttrs(newMeta.htmlAttrs)
}
}
/**
* Fetches corresponding meta info for the current component state
* @return {Object} - all the meta info for currently matched components
*/
function getMetaInfo () {
var info = getMetaInfoDefinition(Vue, this)
if (info.titleTemplate) {
info.title = info.titleTemplate.replace('%s', info.title)
}
return info
}
}
/**
* Recursively traverses each component, checking for a `metaInfo`
* option. It then merges all these options into one object, giving
* higher priority to deeply nested components.
*
* NOTE: This function uses Vue.prototype.$children, the results of which
* are not gauranted to be in order. For this reason, try to avoid
* using the same `metaInfo` property in sibling components.
*
* @param {Function} Vue - the Vue constructor
* @param {Object} $instance - the current instance
* @param {Object} [metaInfo={}] - the merged options
* @return {Object} metaInfo - the merged options
*/
function getMetaInfoDefinition (Vue, $instance, metaInfo) {
// set defaults for first run
metaInfo = Vue.util.extend(metaInfo || {
title: 'Untitled',
htmlAttrs: {}
})
// if current instance has a metaInfo option...
if ($instance.$options.metaInfo) {
var componentMetaInfo = $instance.$options.metaInfo
var key
// ...convert all function type keys to raw data
// (this allows meta info to be inferred from props & data)...
for (key in componentMetaInfo) {
if (componentMetaInfo.hasOwnProperty(key)) {
var val = componentMetaInfo[key]
if (typeof val === 'function') {
componentMetaInfo[key] = val.call($instance)
}
}
}
// ...then merge the data into metaInfo
metaInfo = Vue.util.mergeOptions(metaInfo, componentMetaInfo)
}
// check if any children also have a metaInfo option, if so, merge
// them into existing data
var len = $instance.$children.length
if (len) {
var i = 0
for (; i < len; i++) {
metaInfo = getMetaInfoDefinition(Vue, $instance.$children[i], metaInfo)
}
}
// meta info is ready for consumption
return metaInfo
}
/**
* updates the document title
* @param {String} title - the new title of the document
*/
function updateTitle (title) {
document.title = title || document.title
}
/**
* updates the document's html tag attributes
* @param {Object} attrs - the new document html attributes
*/
function updateHtmlAttrs (attrs) {
var tag = document.getElementsByTagName('html')[0]
var vueMetaAttrString = tag.getAttribute(VUE_META_ATTRIBUTE)
var vueMetaAttrs = vueMetaAttrString ? vueMetaAttrString.split(',') : []
var toRemove = [].concat(vueMetaAttrs)
var attr
for (attr in attrs) {
if (attrs.hasOwnProperty(attr)) {
var val = attrs[attr] || ''
tag.setAttribute(attr, val)
if (vueMetaAttrs.indexOf(attr) === -1) {
vueMetaAttrs.push(attr)
}
var saveIndex = toRemove.indexOf(attr)
if (saveIndex !== -1) {
toRemove.splice(saveIndex, 1)
}
}
}
var i = toRemove.length - 1
for (; i >= 0; i--) {
tag.removeAttribute(toRemove[i])
}
if (vueMetaAttrs.length === toRemove.length) {
tag.removeAttribute(VUE_META_ATTRIBUTE)
} else {
tag.setAttribute(VUE_META_ATTRIBUTE, vueMetaAttrs.join(','))
}
}
// automatic installation when global context
if (typeof Vue !== 'undefined') {
Vue.use(VueMeta)
}
// export VueMeta
if (typeof exports === 'object' && typeof module === 'object') {
module.exports = VueMeta
} else if (typeof define === 'function' && define.amd) {
define(function () { return VueMeta })
} else {
global.VueMeta = VueMeta
}
})(this)
+35 -9
View File
@@ -1,21 +1,47 @@
{
"name": "vue-meta",
"version": "0.0.0",
"description": "manage page meta info in Vue 2.0 server-rendered apps",
"main": "index.js",
"version": "0.0.0",
"author": "Declan de Wet <declandewet@me.com>",
"bugs": "https://github.com/declandewet/vue-meta/issues",
"devDependencies": {
"rimraf": "^2.5.4",
"rollup": "^0.36.3",
"rollup-plugin-buble": "^0.14.0",
"snazzy": "^5.0.0",
"standard": "^8.5.0"
},
"homepage": "https://github.com/declandewet/vue-meta",
"keywords": [
"attribute",
"google",
"head",
"helmet",
"info",
"meta",
"seo",
"server",
"ssr",
"title",
"universal",
"vue"
],
"license": "MIT",
"main": "lib",
"repository": {
"url": "git@github.com:declandewet/vue-meta.git",
"type": "git"
},
"scripts": {
"lint": "standard"
},
"author": "Declan de Wet <declandewet@me.com>",
"license": "MIT",
"devDependencies": {
"standard": "^8.5.0"
"build": "rollup -c",
"lint": "standard --verbose | snazzy",
"prebuild": "rimraf lib",
"pretest": "npm run lint"
},
"standard": {
"globals": ["Vue", "define"]
"globals": [
"Vue",
"define"
]
}
}
+9
View File
@@ -0,0 +1,9 @@
import buble from 'rollup-plugin-buble'
export default {
entry: './src/index.js',
format: 'umd',
dest: './lib/index.js',
moduleName: 'VueMeta',
plugins: [buble()]
}
+1
View File
@@ -0,0 +1 @@
export const VUE_META_ATTRIBUTE = 'data-vue-meta'
+207
View File
@@ -0,0 +1,207 @@
import { VUE_META_ATTRIBUTE } from './constants'
// initialize vue-meta
const VueMeta = {}
// initialize manager
const _manager = {}
/**
* Registers the plugin with Vue.js
* Pass it like so: Vue.use(VueMeta)
* @param {Function} Vue - the Vue constructor
*/
VueMeta.install = function install (Vue) {
// if we've already installed, don't do anything
if (VueMeta.install.installed) return
// set installation inspection flag
VueMeta.install.installed = true
// listen for when components mount - when they do,
// update the meta info & the DOM
Vue.mixin({
mounted () {
this.$root.$meta().updateMetaInfo()
}
})
/**
* returns a cached manager API for use on the server
* @return {Object} - manager (The programmatic API for this module)
*/
Vue.prototype.$meta = function $meta () {
_manager.getMetaInfo = _manager.getMetaInfo || Vue.util.bind(getMetaInfo, this)
_manager.updateMetaInfo = _manager.updateMetaInfo || updateMetaInfo
_manager.inject = _manager.inject || inject
return _manager
}
/**
* Converts the state of the meta info object such that each item
* can be compiled to a tag string on the server
* @return {Object} - server meta info with `toString` methods
*/
function inject () {
const info = this.getMetaInfo()
const serverMetaInfo = {}
for (let key in info) {
if (info.hasOwnProperty(key)) {
serverMetaInfo[key] = generateServerInjector(key, info[key])
}
}
return serverMetaInfo
}
/**
* Converts a meta info property to one that can be stringified on the server
* @param {String} type - the type of data to convert
* @param {(String|Object|Array<Object>)} data - the data value
* @return {Object} - the new injector
*/
function generateServerInjector (type, data) {
switch (type) {
case 'title':
return {
toString: () => `<${type} ${VUE_META_ATTRIBUTE}="true">${data}</${type}>`
}
case 'htmlAttrs': {
return {
toString () {
let attributeStr = ''
for (let attr in data) {
if (data.hasOwnProperty(attr)) {
attributeStr += `${typeof data[attr] !== 'undefined' ? `${attr}="${data[attr]}"` : attr} `
}
}
return attributeStr.trim()
}
}
}
}
}
/**
* Updates meta info and renders it to the DOM
*/
function updateMetaInfo () {
const newMeta = this.getMetaInfo()
if (newMeta.title) {
updateTitle(newMeta.title)
}
if (newMeta.htmlAttrs) {
updateHtmlAttrs(newMeta.htmlAttrs)
}
}
/**
* Fetches corresponding meta info for the current component state
* @return {Object} - all the meta info for currently matched components
*/
function getMetaInfo () {
const info = getMetaInfoDefinition(Vue, this)
if (info.titleTemplate) {
info.title = info.titleTemplate.replace('%s', info.title)
}
return info
}
}
/**
* Recursively traverses each component, checking for a `metaInfo`
* option. It then merges all these options into one object, giving
* higher priority to deeply nested components.
*
* NOTE: This function uses Vue.prototype.$children, the results of which
* are not gauranted to be in order. For this reason, try to avoid
* using the same `metaInfo` property in sibling components.
*
* @param {Function} Vue - the Vue constructor
* @param {Object} $instance - the current instance
* @param {Object} [metaInfo={}] - the merged options
* @return {Object} metaInfo - the merged options
*/
function getMetaInfoDefinition (Vue, $instance, metaInfo = {
title: '',
htmlAttrs: {}
}) {
// if current instance has a metaInfo option...
if ($instance.$options.metaInfo) {
const componentMetaInfo = $instance.$options.metaInfo
// ...convert all function type keys to raw data
// (this allows meta info to be inferred from props & data)...
for (let key in componentMetaInfo) {
if (componentMetaInfo.hasOwnProperty(key)) {
var val = componentMetaInfo[key]
if (typeof val === 'function') {
componentMetaInfo[key] = val.call($instance)
}
}
}
// ...then merge the data into metaInfo
metaInfo = Vue.util.mergeOptions(metaInfo, componentMetaInfo)
}
// check if any children also have a metaInfo option, if so, merge
// them into existing data
const len = $instance.$children.length
if (len) {
var i = 0
for (; i < len; i++) {
metaInfo = getMetaInfoDefinition(Vue, $instance.$children[i], metaInfo)
}
}
// meta info is ready for consumption
return metaInfo
}
/**
* updates the document title
* @param {String} title - the new title of the document
*/
function updateTitle (title) {
document.title = title || document.title
}
/**
* updates the document's html tag attributes
* @param {Object} attrs - the new document html attributes
*/
function updateHtmlAttrs (attrs) {
const tag = document.getElementsByTagName('html')[0]
const vueMetaAttrString = tag.getAttribute(VUE_META_ATTRIBUTE)
const vueMetaAttrs = vueMetaAttrString ? vueMetaAttrString.split(',') : []
const toRemove = [].concat(vueMetaAttrs)
for (let attr in attrs) {
if (attrs.hasOwnProperty(attr)) {
const val = attrs[attr] || ''
tag.setAttribute(attr, val)
if (vueMetaAttrs.indexOf(attr) === -1) {
vueMetaAttrs.push(attr)
}
const saveIndex = toRemove.indexOf(attr)
if (saveIndex !== -1) {
toRemove.splice(saveIndex, 1)
}
}
}
let i = toRemove.length - 1
for (; i >= 0; i--) {
tag.removeAttribute(toRemove[i])
}
if (vueMetaAttrs.length === toRemove.length) {
tag.removeAttribute(VUE_META_ATTRIBUTE)
} else {
tag.setAttribute(VUE_META_ATTRIBUTE, vueMetaAttrs.join(','))
}
}
// automatic installation when global context
if (typeof Vue !== 'undefined') {
Vue.use(VueMeta)
}
export default VueMeta
+105 -9
View File
@@ -6,7 +6,13 @@ acorn-jsx@^3.0.0, acorn-jsx@^3.0.1:
dependencies:
acorn "^3.0.4"
acorn@^3.0.4:
acorn-object-spread@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/acorn-object-spread/-/acorn-object-spread-1.0.0.tgz#48ead0f4a8eb16995a17a0db9ffc6acaada4ba68"
dependencies:
acorn "^3.1.0"
acorn@^3.0.4, acorn@^3.1.0, acorn@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
@@ -68,6 +74,22 @@ brace-expansion@^1.0.0:
balanced-match "^0.4.1"
concat-map "0.0.1"
buble@^0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/buble/-/buble-0.14.0.tgz#f9b8005b92a5151d9eb972e3bd461ab84a6b59b9"
dependencies:
acorn "^3.3.0"
acorn-jsx "^3.0.1"
acorn-object-spread "^1.0.0"
chalk "^1.1.3"
magic-string "^0.14.0"
minimist "^1.2.0"
os-homedir "^1.0.1"
buffer-shims@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
caller-path@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f"
@@ -78,7 +100,7 @@ callsites@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"
chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
@@ -116,7 +138,7 @@ concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
concat-stream@^1.4.6:
concat-stream@^1.4.6, concat-stream@^1.5.0:
version "1.5.2"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266"
dependencies:
@@ -330,6 +352,10 @@ estraverse@~4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2"
estree-walker@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e"
esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
@@ -452,7 +478,7 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
inherits@~2.0.1, inherits@2:
inherits@^2.0.1, inherits@~2.0.1, inherits@2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
@@ -562,13 +588,19 @@ lodash@^4.0.0, lodash@^4.3.0:
version "4.16.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.4.tgz#01ce306b9bad1319f2a5528674f88297aeb70127"
magic-string@^0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.14.0.tgz#57224aef1701caeed273b17a39a956e72b172462"
dependencies:
vlq "^0.2.1"
minimatch@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
dependencies:
brace-expansion "^1.0.0"
minimist@^1.1.0:
minimist@^1.1.0, minimist@^1.1.1, minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
@@ -623,7 +655,7 @@ optionator@^0.8.2:
type-check "~0.3.2"
wordwrap "~1.0.0"
os-homedir@^1.0.0:
os-homedir@^1.0.0, os-homedir@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
@@ -677,6 +709,18 @@ progress@^1.1.8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
readable-stream@^2.0.6:
version "2.1.5"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0"
dependencies:
buffer-shims "^1.0.0"
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "~1.0.0"
process-nextick-args "~1.0.6"
string_decoder "~0.10.x"
util-deprecate "~1.0.1"
readable-stream@~2.0.0:
version "2.0.6"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e"
@@ -714,12 +758,32 @@ restore-cursor@^1.0.1:
exit-hook "^1.0.0"
onetime "^1.0.0"
rimraf@^2.2.8:
rimraf, rimraf@^2.2.8:
version "2.5.4"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04"
dependencies:
glob "^7.0.5"
rollup:
version "0.36.3"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.36.3.tgz#c89ac479828924ff8f69c1d44541cb4ea2fc11fc"
dependencies:
source-map-support "^0.4.0"
rollup-plugin-buble:
version "0.14.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-buble/-/rollup-plugin-buble-0.14.0.tgz#3726db55fef9b9cd37cebed559cbbd4b9b2e5bc6"
dependencies:
buble "^0.14.0"
rollup-pluginutils "^1.5.0"
rollup-pluginutils@^1.5.0:
version "1.5.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
dependencies:
estree-walker "^0.2.1"
minimatch "^3.0.2"
run-async@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389"
@@ -742,6 +806,28 @@ slice-ansi@0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"
snazzy:
version "5.0.0"
resolved "https://registry.yarnpkg.com/snazzy/-/snazzy-5.0.0.tgz#22a0a8da8f1311f681316c51c3a54ab138786800"
dependencies:
chalk "^1.1.0"
inherits "^2.0.1"
minimist "^1.1.1"
readable-stream "^2.0.6"
standard "*"
standard-json "^1.0.0"
text-table "^0.2.0"
source-map-support@^0.4.0:
version "0.4.6"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.6.tgz#32552aa64b458392a85eab3b0b5ee61527167aeb"
dependencies:
source-map "^0.5.3"
source-map@^0.5.3:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
@@ -757,7 +843,13 @@ standard-engine@~5.1.0:
minimist "^1.1.0"
pkg-config "^1.0.1"
standard@^8.5.0:
standard-json@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/standard-json/-/standard-json-1.0.1.tgz#75dd5952c59bb6cb358b136af0633ae3d7f35b6b"
dependencies:
concat-stream "^1.5.0"
standard@*, standard@^8.5.0:
version "8.5.0"
resolved "https://registry.yarnpkg.com/standard/-/standard-8.5.0.tgz#df78a505da59382287b92a86b55ae02df3b54a31"
dependencies:
@@ -817,7 +909,7 @@ table@^3.7.8:
slice-ansi "0.0.4"
string-width "^2.0.0"
text-table@~0.2.0:
text-table@^0.2.0, text-table@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
@@ -853,6 +945,10 @@ util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
vlq@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.1.tgz#14439d711891e682535467f8587c5630e4222a6c"
wordwrap@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"