Comparing version 3.1.1 to 4.0.0
@@ -0,1 +1,11 @@ | ||
<a name="4.0.0"></a> | ||
# [4.0.0](https://github.com/kazupon/vue-i18n/compare/v3.1.1...v4.0.0) (2016-05-10) | ||
### :zap: Improvements | ||
* support vue 2.0-pre-alpha ([f6517bc](https://github.com/kazupon/vue-i18n/commit/f6517bc)) | ||
<a name="3.1.1"></a> | ||
@@ -2,0 +12,0 @@ ## [3.1.1](https://github.com/kazupon/vue-i18n/compare/v3.1.0...v3.1.1) (2016-05-09) |
/*! | ||
* vue-i18n v3.1.1 | ||
* vue-i18n v4.0.0 | ||
* (c) 2016 kazuya kawaguchi | ||
@@ -72,2 +72,3 @@ * Released under the MIT License. | ||
} else if (exports$1.Vue.util.isPlainObject(target)) { | ||
/* eslint-disable prefer-const */ | ||
for (var key in target) { | ||
@@ -78,2 +79,3 @@ if (hasOwn(target, key)) { | ||
} | ||
/* eslint-enable prefer-const */ | ||
} | ||
@@ -419,5 +421,5 @@ | ||
var length = paths.length; | ||
var ret = null; | ||
var last = obj; | ||
var length = paths.length; | ||
var i = 0; | ||
@@ -465,2 +467,3 @@ while (i < length) { | ||
/* eslint-disable prefer-const */ | ||
for (var i = 0; i < 3; i++) { | ||
@@ -477,2 +480,3 @@ var n1 = parseInt(s1[i] || 0, 10); | ||
} | ||
/* eslint-enable prefer-const */ | ||
@@ -857,3 +861,3 @@ if ((s1[2] + s2[2] + '').indexOf('-') > -1) { | ||
plugin.version = '3.1.1'; | ||
plugin.version = '4.0.0'; | ||
@@ -860,0 +864,0 @@ if (typeof window !== 'undefined' && window.Vue) { |
/*! | ||
* vue-i18n v3.1.1 | ||
* vue-i18n v4.0.0 | ||
* (c) 2016 kazuya kawaguchi | ||
@@ -76,2 +76,3 @@ * Released under the MIT License. | ||
} else if (exports$1.Vue.util.isPlainObject(target)) { | ||
/* eslint-disable prefer-const */ | ||
for (var key in target) { | ||
@@ -82,2 +83,3 @@ if (hasOwn(target, key)) { | ||
} | ||
/* eslint-enable prefer-const */ | ||
} | ||
@@ -423,5 +425,5 @@ | ||
var length = paths.length; | ||
var ret = null; | ||
var last = obj; | ||
var length = paths.length; | ||
var i = 0; | ||
@@ -469,2 +471,3 @@ while (i < length) { | ||
/* eslint-disable prefer-const */ | ||
for (var i = 0; i < 3; i++) { | ||
@@ -481,2 +484,3 @@ var n1 = parseInt(s1[i] || 0, 10); | ||
} | ||
/* eslint-enable prefer-const */ | ||
@@ -861,3 +865,3 @@ if ((s1[2] + s2[2] + '').indexOf('-') > -1) { | ||
plugin.version = '3.1.1'; | ||
plugin.version = '4.0.0'; | ||
@@ -864,0 +868,0 @@ if (typeof window !== 'undefined' && window.Vue) { |
/*! | ||
* vue-i18n v3.1.1 | ||
* vue-i18n v4.0.0 | ||
* (c) 2016 kazuya kawaguchi | ||
* Released under the MIT License. | ||
*/ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.VueI18n=t()}(this,function(){"use strict";function n(n,t){window.console&&(console.warn("[vue-i18n] "+n),t&&console.warn(t.stack))}function t(n,t){return j.call(n,t)}function e(n){if(null===n||void 0===n)return!0;if(Array.isArray(n)){if(n.length>0)return!1;if(0===n.length)return!0}else if(m.Vue.util.isPlainObject(n))for(var e in n)if(t(n,e))return!1;return!0}function r(n){if(!A){var t=n.$watch("__watcher__",function(n){});A=n._watchers[0].constructor,t()}return A}function o(n){return O||(O=n._data.__ob__.dep.constructor),O}function i(n){return n&&"function"==typeof n.then}function u(n){if(void 0===n)return"eof";var t=n.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return n;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return t>=97&&122>=t||t>=65&&90>=t?"ident":t>=49&&57>=t?"number":"else"}function a(n){var t=$.Vue.util,e=t.isLiteral,r=t.stripQuotes,o=n.trim();return"0"===n.charAt(0)&&isNaN(n)?!1:e(o)?r(o):"*"+o}function c(n){function t(){var t=n[r+1];return o===I&&"'"===t||o===L&&'"'===t?(r++,l="\\"+t,h[P](),!0):void 0}var e=[],r=-1,o=C,i=0,c=void 0,l=void 0,f=void 0,s=void 0,d=void 0,v=void 0,p=void 0,h=[];for(h[k]=function(){void 0!==f&&(e.push(f),f=void 0)},h[P]=function(){void 0===f?f=l:f+=l},h[S]=function(){h[P](),i++},h[U]=function(){if(i>0)i--,o=N,h[P]();else{if(i=0,f=a(f),f===!1)return!1;h[k]()}};null!=o;)if(r++,c=n[r],"\\"!==c||!t()){if(s=u(c),p=B[o],d=p[s]||p["else"]||Z,d===Z)return;if(o=d[0],v=h[d[1]],v&&(l=d[2],l=void 0===l?c:l,v()===!1))return;if(o===Q)return e.raw=n,e}}function l(n){var t=V[n];return t||(t=c(n),t&&(V[n]=t)),t}function f(n,t){var r=$.Vue.util.isObject;if(!r(n))return null;var o=l(t);if(e(o))return null;for(var i=null,u=n,a=o.length,c=0;a>c;){var f=u[o[c]];if(void 0===f){u=null;break}u=f,c++}return i=u}function s(t){t.locale=function(t,e,r){return void 0===e?D[t]:void(null===e?(D[t]=void 0,delete D[t]):d(t,e,function(e){e?(D[t]=e,r&&r()):n("failed set `"+t+"` locale")}))}}function d(n,t,e){var r=this;"object"===("undefined"==typeof t?"undefined":_["typeof"](t))?e(t):!function(){var n=t.call(r);"function"==typeof n?n.resolved?e(n.resolved):n.requested?n.pendingCallbacks.push(e):!function(){n.requested=!0;var t=n.pendingCallbacks=[e];n(function(e){n.resolved=e;for(var r=0,o=t.length;o>r;r++)t[r](e)},function(){e()})}():i(n)&&n.then(function(n){e(n)},function(){e()})["catch"](function(n){console.error(n),e()})}()}function v(n,t){var e=n.prototype._init;n.prototype._init=function(n){var r=this;n=n||{};var o=n._parent||n.parent||this,i=o.$lang;i?this.$lang=i:this.$lang=t,this._langUnwatch=this.$lang.$watch("lang",function(n,t){p(r)}),e.call(this,n)};var r=n.prototype._destroy;n.prototype._destroy=function(){this._langUnwatch&&(this._langUnwatch(),this._langUnwatch=null),this.$lang=null,r.apply(this,arguments)}}function p(n){for(var t=n._watchers.length;t--;)n._watchers[t].update(!0)}function h(n,t){function e(n,t){var e=new i(t,n,null,{lazy:!0});return function(){return e.dirty&&e.evaluate(),u.target&&e.depend(),e.value}}var i=r(t),u=o(t);Object.defineProperty(n.config,"lang",{enumerable:!0,configurable:!0,get:e(function(){return t.lang},t),set:n.util.bind(function(n){t.lang=n},t)})}function y(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return 1===e.length&&"object"===_["typeof"](e[0])&&(e=e[0]),e&&e.hasOwnProperty||(e={}),n.replace(E,function(t,r,o,i){var u=void 0;return"{"===n[i-1]&&"}"===n[i+t.length]?o:(u=e.hasOwnProperty(o)?e[o]:null,null===u||void 0===u?"":u)})}function g(n){function t(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var o=n.config.lang;return 1===e.length?u(e[0])||i(e[0])?e=e[0]:"string"==typeof e[0]&&(o=e[0]):2===e.length&&("string"==typeof e[0]&&(o=e[0]),(u(e[1])||i(e[1]))&&(e=e[1])),{lang:o,params:e}}function e(n,t,e){if(!n)return null;var r=f(n,t)||n[t];return r?e?y(r,e):r:null}function r(n){return n}var o=n.util,i=o.isArray,u=o.isObject;return n.t=function(o){for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;i>a;a++)u[a-1]=arguments[a];if(!o)return"";var c=t.apply(void 0,u),l=c.lang,f=c.params;return e(n.locale(l),o,f)||r(o)},n.prototype.$t=function(o){if(!o)return"";for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;i>a;a++)u[a-1]=arguments[a];var c=t.apply(void 0,u),l=c.lang,f=c.params;return e(this.$options.locales&&this.$options.locales[l],o,f)||e(n.locale(l),o,f)||r(o)},n}function w(n){var t=(arguments.length<=1||void 0===arguments[1]?{}:arguments[1],"en");$.Vue=m.Vue=n,b(n,t),s(n),v(n,F),h(n,F),g(n)}function b(n,t){var e=n.config.silent;n.config.silent=!0,F||(F=new n({data:{lang:t}})),n.config.silent=e}var _={};_["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n};var m={},j=Object.prototype.hasOwnProperty,A=void 0,O=void 0,$={},V=Object.create(null),P=0,k=1,S=2,U=3,C=0,q=1,x=2,z=3,N=4,I=5,L=6,Q=7,Z=8,B=[];B[C]={ws:[C],ident:[z,P],"[":[N],eof:[Q]},B[q]={ws:[q],".":[x],"[":[N],eof:[Q]},B[x]={ws:[x],ident:[z,P]},B[z]={ident:[z,P],0:[z,P],number:[z,P],ws:[q,k],".":[x,k],"[":[N,k],eof:[Q,k]},B[N]={"'":[I,P],'"':[L,P],"[":[N,S],"]":[q,U],eof:Z,"else":[N,P]},B[I]={"'":[N,P],eof:Z,"else":[I,P]},B[L]={'"':[N,P],eof:Z,"else":[L,P]};var D=Object.create(null),E=/(%|)\{([0-9a-zA-Z]+)\}/g,F=void 0;return w.version="3.1.1","undefined"!=typeof window&&window.Vue&&window.Vue.use(w),w}); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.VueI18n=t()}(this,function(){"use strict";function n(n,t){window.console&&(console.warn("[vue-i18n] "+n),t&&console.warn(t.stack))}function t(n,t){return j.call(n,t)}function e(n){if(null===n||void 0===n)return!0;if(Array.isArray(n)){if(n.length>0)return!1;if(0===n.length)return!0}else if(m.Vue.util.isPlainObject(n))for(var e in n)if(t(n,e))return!1;return!0}function r(n){if(!A){var t=n.$watch("__watcher__",function(n){});A=n._watchers[0].constructor,t()}return A}function o(n){return O||(O=n._data.__ob__.dep.constructor),O}function i(n){return n&&"function"==typeof n.then}function u(n){if(void 0===n)return"eof";var t=n.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return n;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return t>=97&&122>=t||t>=65&&90>=t?"ident":t>=49&&57>=t?"number":"else"}function a(n){var t=$.Vue.util,e=t.isLiteral,r=t.stripQuotes,o=n.trim();return"0"===n.charAt(0)&&isNaN(n)?!1:e(o)?r(o):"*"+o}function c(n){function t(){var t=n[r+1];return o===I&&"'"===t||o===L&&'"'===t?(r++,l="\\"+t,h[P](),!0):void 0}var e=[],r=-1,o=C,i=0,c=void 0,l=void 0,f=void 0,s=void 0,d=void 0,v=void 0,p=void 0,h=[];for(h[k]=function(){void 0!==f&&(e.push(f),f=void 0)},h[P]=function(){void 0===f?f=l:f+=l},h[S]=function(){h[P](),i++},h[U]=function(){if(i>0)i--,o=N,h[P]();else{if(i=0,f=a(f),f===!1)return!1;h[k]()}};null!=o;)if(r++,c=n[r],"\\"!==c||!t()){if(s=u(c),p=B[o],d=p[s]||p["else"]||Z,d===Z)return;if(o=d[0],v=h[d[1]],v&&(l=d[2],l=void 0===l?c:l,v()===!1))return;if(o===Q)return e.raw=n,e}}function l(n){var t=V[n];return t||(t=c(n),t&&(V[n]=t)),t}function f(n,t){var r=$.Vue.util.isObject;if(!r(n))return null;var o=l(t);if(e(o))return null;for(var i=o.length,u=null,a=n,c=0;i>c;){var f=a[o[c]];if(void 0===f){a=null;break}a=f,c++}return u=a}function s(t){t.locale=function(t,e,r){return void 0===e?D[t]:void(null===e?(D[t]=void 0,delete D[t]):d(t,e,function(e){e?(D[t]=e,r&&r()):n("failed set `"+t+"` locale")}))}}function d(n,t,e){var r=this;"object"===("undefined"==typeof t?"undefined":_["typeof"](t))?e(t):!function(){var n=t.call(r);"function"==typeof n?n.resolved?e(n.resolved):n.requested?n.pendingCallbacks.push(e):!function(){n.requested=!0;var t=n.pendingCallbacks=[e];n(function(e){n.resolved=e;for(var r=0,o=t.length;o>r;r++)t[r](e)},function(){e()})}():i(n)&&n.then(function(n){e(n)},function(){e()})["catch"](function(n){console.error(n),e()})}()}function v(n,t){var e=n.prototype._init;n.prototype._init=function(n){var r=this;n=n||{};var o=n._parent||n.parent||this,i=o.$lang;i?this.$lang=i:this.$lang=t,this._langUnwatch=this.$lang.$watch("lang",function(n,t){p(r)}),e.call(this,n)};var r=n.prototype._destroy;n.prototype._destroy=function(){this._langUnwatch&&(this._langUnwatch(),this._langUnwatch=null),this.$lang=null,r.apply(this,arguments)}}function p(n){for(var t=n._watchers.length;t--;)n._watchers[t].update(!0)}function h(n,t){function e(n,t){var e=new i(t,n,null,{lazy:!0});return function(){return e.dirty&&e.evaluate(),u.target&&e.depend(),e.value}}var i=r(t),u=o(t);Object.defineProperty(n.config,"lang",{enumerable:!0,configurable:!0,get:e(function(){return t.lang},t),set:n.util.bind(function(n){t.lang=n},t)})}function y(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return 1===e.length&&"object"===_["typeof"](e[0])&&(e=e[0]),e&&e.hasOwnProperty||(e={}),n.replace(E,function(t,r,o,i){var u=void 0;return"{"===n[i-1]&&"}"===n[i+t.length]?o:(u=e.hasOwnProperty(o)?e[o]:null,null===u||void 0===u?"":u)})}function g(n){function t(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var o=n.config.lang;return 1===e.length?u(e[0])||i(e[0])?e=e[0]:"string"==typeof e[0]&&(o=e[0]):2===e.length&&("string"==typeof e[0]&&(o=e[0]),(u(e[1])||i(e[1]))&&(e=e[1])),{lang:o,params:e}}function e(n,t,e){if(!n)return null;var r=f(n,t)||n[t];return r?e?y(r,e):r:null}function r(n){return n}var o=n.util,i=o.isArray,u=o.isObject;return n.t=function(o){for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;i>a;a++)u[a-1]=arguments[a];if(!o)return"";var c=t.apply(void 0,u),l=c.lang,f=c.params;return e(n.locale(l),o,f)||r(o)},n.prototype.$t=function(o){if(!o)return"";for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;i>a;a++)u[a-1]=arguments[a];var c=t.apply(void 0,u),l=c.lang,f=c.params;return e(this.$options.locales&&this.$options.locales[l],o,f)||e(n.locale(l),o,f)||r(o)},n}function w(n){var t=(arguments.length<=1||void 0===arguments[1]?{}:arguments[1],"en");$.Vue=m.Vue=n,b(n,t),s(n),v(n,F),h(n,F),g(n)}function b(n,t){var e=n.config.silent;n.config.silent=!0,F||(F=new n({data:{lang:t}})),n.config.silent=e}var _={};_["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n};var m={},j=Object.prototype.hasOwnProperty,A=void 0,O=void 0,$={},V=Object.create(null),P=0,k=1,S=2,U=3,C=0,q=1,x=2,z=3,N=4,I=5,L=6,Q=7,Z=8,B=[];B[C]={ws:[C],ident:[z,P],"[":[N],eof:[Q]},B[q]={ws:[q],".":[x],"[":[N],eof:[Q]},B[x]={ws:[x],ident:[z,P]},B[z]={ident:[z,P],0:[z,P],number:[z,P],ws:[q,k],".":[x,k],"[":[N,k],eof:[Q,k]},B[N]={"'":[I,P],'"':[L,P],"[":[N,S],"]":[q,U],eof:Z,"else":[N,P]},B[I]={"'":[N,P],eof:Z,"else":[I,P]},B[L]={'"':[N,P],eof:Z,"else":[L,P]};var D=Object.create(null),E=/(%|)\{([0-9a-zA-Z]+)\}/g,F=void 0;return w.version="4.0.0","undefined"!=typeof window&&window.Vue&&window.Vue.use(w),w}); |
{ | ||
"name": "vue-i18n", | ||
"description": "Internationalization plugin for Vue.js", | ||
"version": "3.1.1", | ||
"version": "4.0.0", | ||
"author": { | ||
@@ -23,6 +23,4 @@ "name": "kazuya kawaguchi", | ||
"eslint": "^2.8.0", | ||
"eslint-config-standard": "^5.2.0", | ||
"eslint-config-vue": "^1.0.0", | ||
"eslint-loader": "^1.3.0", | ||
"eslint-plugin-promise": "^1.1.0", | ||
"eslint-plugin-standard": "^1.3.2", | ||
"git-commit-message-convention": "git://github.com/kazupon/git-commit-message-convention.git", | ||
@@ -87,3 +85,2 @@ "istanbul-instrumenter-loader": "^0.2.0", | ||
"coveralls": "VUE_I18N_TYPE=coveralls karma start config/karma.conf.js", | ||
"proto": "webpack-dev-server --quite --config config/webpack.dev.conf.js --host 0.0.0.0", | ||
"dev": "webpack-dev-server --quiet --config config/webpack.test.conf.js", | ||
@@ -94,2 +91,3 @@ "e2e": "webpack-dev-server --quiet --config config/webpack.e2e.conf.js & mocha --opts test/e2e/mocha.opts --harmony test/e2e/test.js && kill $! || (kill $! && exit 1)", | ||
"mobile": "VUE_I18N_TYPE=sauce SAUCE=batch3 karma start config/karma.conf.js", | ||
"proto": "webpack-dev-server --quite --config config/webpack.dev.conf.js --host 0.0.0.0", | ||
"release": "conventional-github-releaser -n ./node_modules/git-commit-message-convention/convention.js", | ||
@@ -96,0 +94,0 @@ "sauce": "npm run coolkids && npm run ie && npm run mobile", |
@@ -22,3 +22,3 @@ # vue-i18n | ||
```html | ||
<script src="https://cdn.jsdelivr.net/vue.i18n/3.1.1/vue-i18n.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/vue.i18n/4.0.0/vue-i18n.min.js"></script> | ||
``` | ||
@@ -25,0 +25,0 @@ |
import { warn, isPromise } from './util' | ||
let locales = Object.create(null) // locales store | ||
const locales = Object.create(null) // locales store | ||
@@ -23,3 +23,3 @@ | ||
} else { | ||
setLocale(id, definition, (locale) => { | ||
setLocale(id, definition, locale => { | ||
if (locale) { | ||
@@ -42,3 +42,3 @@ locales[id] = locale | ||
} else { | ||
let future = definition.call(this) | ||
const future = definition.call(this) | ||
if (typeof future === 'function') { | ||
@@ -53,4 +53,4 @@ if (future.resolved) { | ||
future.requested = true | ||
let cbs = future.pendingCallbacks = [cb] | ||
future((locale) => { // resolve | ||
const cbs = future.pendingCallbacks = [cb] | ||
future(locale => { // resolve | ||
future.resolved = locale | ||
@@ -65,7 +65,7 @@ for (let i = 0, l = cbs.length; i < l; i++) { | ||
} else if (isPromise(future)) { // promise | ||
future.then((locale) => { // resolve | ||
future.then(locale => { // resolve | ||
cb(locale) | ||
}, () => { // reject | ||
cb() | ||
}).catch((err) => { | ||
}).catch(err => { | ||
console.error(err) | ||
@@ -72,0 +72,0 @@ cb() |
@@ -11,4 +11,4 @@ /** | ||
function split (v) { | ||
let temp = v.split('.') | ||
let arr = temp.splice(0, 2) | ||
const temp = v.split('.') | ||
const arr = temp.splice(0, 2) | ||
arr.push(temp.join('.')) | ||
@@ -27,5 +27,6 @@ return arr | ||
export default function (v1, v2) { | ||
let s1 = split(v1) | ||
let s2 = split(v2) | ||
const s1 = split(v1) | ||
const s2 = split(v2) | ||
/* eslint-disable prefer-const */ | ||
for (let i = 0; i < 3; i++) { | ||
@@ -38,6 +39,7 @@ let n1 = parseInt(s1[i] || 0, 10) | ||
} | ||
/* eslint-enable prefer-const */ | ||
if ((s1[2] + s2[2] + '').indexOf('-') > -1) { | ||
let p1 = (PATCH_PATTERN.exec(s1[2]) || [''])[0] | ||
let p2 = (PATCH_PATTERN.exec(s2[2]) || [''])[0] | ||
const p1 = (PATCH_PATTERN.exec(s1[2]) || [''])[0] | ||
const p2 = (PATCH_PATTERN.exec(s2[2]) || [''])[0] | ||
@@ -44,0 +46,0 @@ if (p1 === '') { return 1 } |
@@ -8,3 +8,3 @@ import { getWatcher, getDep } from './util' | ||
function makeComputedGetter (getter, owner) { | ||
let watcher = new Watcher(owner, getter, null, { | ||
const watcher = new Watcher(owner, getter, null, { | ||
lazy: true | ||
@@ -29,4 +29,4 @@ }) | ||
get: makeComputedGetter(() => { return langVM.lang }, langVM), | ||
set: Vue.util.bind((val) => { langVM.lang = val }, langVM) | ||
set: Vue.util.bind(val => { langVM.lang = val }, langVM) | ||
}) | ||
} |
@@ -39,3 +39,3 @@ import { warn } from './util' | ||
let val = getValue(locale, key) || locale[key] | ||
const val = getValue(locale, key) || locale[key] | ||
if (!val) { return null } | ||
@@ -42,0 +42,0 @@ |
@@ -33,3 +33,3 @@ import util, { warn } from './util' | ||
let lang = 'en' | ||
const lang = 'en' | ||
@@ -55,3 +55,3 @@ path.Vue = util.Vue = Vue | ||
plugin.version = '3.1.1' | ||
plugin.version = '4.0.0' | ||
@@ -58,0 +58,0 @@ export default plugin |
@@ -6,4 +6,4 @@ export default function (Vue, langVM) { | ||
options = options || {} | ||
let root = options._parent || options.parent || this | ||
let lang = root.$lang | ||
const root = options._parent || options.parent || this | ||
const lang = root.$lang | ||
@@ -10,0 +10,0 @@ if (lang) { |
@@ -15,3 +15,3 @@ /** | ||
// cache | ||
let pathCache = Object.create(null) | ||
const pathCache = Object.create(null) | ||
@@ -35,3 +35,3 @@ // actions | ||
let pathStateMachine = [] | ||
const pathStateMachine = [] | ||
@@ -98,3 +98,3 @@ pathStateMachine[BEFORE_PATH] = { | ||
let code = ch.charCodeAt(0) | ||
const code = ch.charCodeAt(0) | ||
@@ -148,3 +148,3 @@ switch (code) { | ||
let trimmed = path.trim() | ||
const trimmed = path.trim() | ||
// invalid leading 0 | ||
@@ -164,3 +164,3 @@ if (path.charAt(0) === '0' && isNaN(path)) { return false } | ||
function parse (path) { | ||
let keys = [] | ||
const keys = [] | ||
let index = -1 | ||
@@ -171,3 +171,3 @@ let mode = BEFORE_PATH | ||
let actions = [] | ||
const actions = [] | ||
@@ -211,3 +211,3 @@ actions[PUSH] = function () { | ||
function maybeUnescapeQuote () { | ||
let nextChar = path[index + 1] | ||
const nextChar = path[index + 1] | ||
if ((mode === IN_SINGLE_QUOTE && nextChar === "'") | ||
@@ -288,11 +288,11 @@ || (mode === IN_DOUBLE_QUOTE && nextChar === '"')) { | ||
let paths = parsePath(path) | ||
const paths = parsePath(path) | ||
if (empty(paths)) { return null } | ||
const length = paths.length | ||
let ret = null | ||
let last = obj | ||
let length = paths.length | ||
let i = 0 | ||
while (i < length) { | ||
let value = last[paths[i]] | ||
const value = last[paths[i]] | ||
if (value === undefined) { | ||
@@ -299,0 +299,0 @@ last = null |
@@ -54,5 +54,7 @@ /** | ||
} else if (exports.Vue.util.isPlainObject(target)) { | ||
/* eslint-disable prefer-const */ | ||
for (let key in target) { | ||
if (hasOwn(target, key)) { return false } | ||
} | ||
/* eslint-enable prefer-const */ | ||
} | ||
@@ -77,2 +79,3 @@ | ||
} else if (exports.Vue.util.isPlainObject(target)) { | ||
/* eslint-disable prefer-const */ | ||
for (let key in target) { | ||
@@ -83,2 +86,3 @@ if (hasOwn(target, key)) { | ||
} | ||
/* eslint-enable prefer-const */ | ||
} | ||
@@ -97,3 +101,3 @@ } | ||
if (!Watcher) { | ||
const unwatch = vm.$watch('__watcher__', (a) => {}) | ||
const unwatch = vm.$watch('__watcher__', a => {}) | ||
Watcher = vm._watchers[0].constructor | ||
@@ -100,0 +104,0 @@ unwatch() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76199
40
2139