vue-model-x
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -71,2 +71,9 @@ import Vue from 'vue'; | ||
function defineWatchersProperty(obj) { | ||
Object.defineProperty(obj, '_watchers', { | ||
value: [], | ||
enumerable: false | ||
}); | ||
} | ||
var computedWatchers = Symbol('computedWatchers'); | ||
@@ -94,3 +101,3 @@ /* istanbul ignore next */ | ||
// Needed by Vue's `Watcher` constructor | ||
this._watchers = []; | ||
defineWatchersProperty(this); | ||
this[computedWatchers] = new Map(); | ||
@@ -123,2 +130,160 @@ } | ||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
/** | ||
* Lodash (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright JS Foundation and other contributors <https://js.foundation/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
/** `Object#toString` result references. */ | ||
var asyncTag = '[object AsyncFunction]', | ||
funcTag = '[object Function]', | ||
genTag = '[object GeneratorFunction]', | ||
nullTag = '[object Null]', | ||
proxyTag = '[object Proxy]', | ||
undefinedTag = '[object Undefined]'; | ||
/** Detect free variable `global` from Node.js. */ | ||
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; | ||
/** Detect free variable `self`. */ | ||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; | ||
/** Used as a reference to the global object. */ | ||
var root = freeGlobal || freeSelf || Function('return this')(); | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
/** Used to check objects for own properties. */ | ||
var hasOwnProperty = objectProto.hasOwnProperty; | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var nativeObjectToString = objectProto.toString; | ||
/** Built-in value references. */ | ||
var Symbol$1 = root.Symbol, | ||
symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined; | ||
/** | ||
* The base implementation of `getTag` without fallbacks for buggy environments. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {string} Returns the `toStringTag`. | ||
*/ | ||
function baseGetTag(value) { | ||
if (value == null) { | ||
return value === undefined ? undefinedTag : nullTag; | ||
} | ||
return (symToStringTag && symToStringTag in Object(value)) | ||
? getRawTag(value) | ||
: objectToString(value); | ||
} | ||
/** | ||
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {string} Returns the raw `toStringTag`. | ||
*/ | ||
function getRawTag(value) { | ||
var isOwn = hasOwnProperty.call(value, symToStringTag), | ||
tag = value[symToStringTag]; | ||
try { | ||
value[symToStringTag] = undefined; | ||
var unmasked = true; | ||
} catch (e) {} | ||
var result = nativeObjectToString.call(value); | ||
if (unmasked) { | ||
if (isOwn) { | ||
value[symToStringTag] = tag; | ||
} else { | ||
delete value[symToStringTag]; | ||
} | ||
} | ||
return result; | ||
} | ||
/** | ||
* Converts `value` to a string using `Object.prototype.toString`. | ||
* | ||
* @private | ||
* @param {*} value The value to convert. | ||
* @returns {string} Returns the converted string. | ||
*/ | ||
function objectToString(value) { | ||
return nativeObjectToString.call(value); | ||
} | ||
/** | ||
* Checks if `value` is classified as a `Function` object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a function, else `false`. | ||
* @example | ||
* | ||
* _.isFunction(_); | ||
* // => true | ||
* | ||
* _.isFunction(/abc/); | ||
* // => false | ||
*/ | ||
function isFunction(value) { | ||
if (!isObject(value)) { | ||
return false; | ||
} | ||
// The use of `Object#toString` avoids issues with the `typeof` operator | ||
// in Safari 9 which returns 'object' for typed arrays and other constructors. | ||
var tag = baseGetTag(value); | ||
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; | ||
} | ||
/** | ||
* Checks if `value` is the | ||
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) | ||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is an object, else `false`. | ||
* @example | ||
* | ||
* _.isObject({}); | ||
* // => true | ||
* | ||
* _.isObject([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObject(_.noop); | ||
* // => true | ||
* | ||
* _.isObject(null); | ||
* // => false | ||
*/ | ||
function isObject(value) { | ||
var type = typeof value; | ||
return value != null && (type == 'object' || type == 'function'); | ||
} | ||
var lodash_isfunction = isFunction; | ||
var VueModel = | ||
@@ -143,2 +308,26 @@ /*#__PURE__*/ | ||
_proto.watch = function watch(expression, callback, options) { | ||
if (!this.hasOwnProperty('_watchers')) { | ||
defineWatchersProperty(this); | ||
} | ||
if (typeof callback === 'string') { | ||
callback = this[callback]; | ||
if (!lodash_isfunction(callback)) { | ||
throw new TypeError("VueModel#watch: Model doesn't have \"" + callback + "\" method"); | ||
} | ||
} | ||
var watcher = new Watcher(this, expression, callback, options); | ||
if (options && options.immediate) { | ||
callback.call(this, watcher.value); | ||
} | ||
return function () { | ||
watcher.teardown(); | ||
}; | ||
}; | ||
return VueModel; | ||
@@ -148,2 +337,1 @@ }(); | ||
export { observable, computed, VueModel }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidnVlLW1vZGVsLXguZXNtLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdnVlLWludGVybmFscy5qcyIsIi4uL3NyYy9vYnNlcnZhYmxlLmpzIiwiLi4vc3JjL2NvbXB1dGVkLmpzIiwiLi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VyQzdCLFNBQUwsR0FBaUIsRUFBakI7YUFDSzZCLGdCQUFMLElBQXlCLElBQUlTLEdBQUosRUFBekI7OztVQUdFLENBQUMsS0FBS1QsZ0JBQUwsRUFBdUJVLEdBQXZCLENBQTJCUCxTQUEzQixDQUFMLEVBQTRDO2FBQ3JDSCxnQkFBTCxFQUF1QlcsR0FBdkIsQ0FBMkJSLFNBQTNCLEVBQXNDTCxPQUFPQyxNQUFQLENBQWMsSUFBZCxDQUF0Qzs7O1VBR0lhLFdBQVcsS0FBS1osZ0JBQUwsRUFBdUJNLEdBQXZCLENBQTJCSCxTQUEzQixDQUFqQjtVQUNJVSxVQUFVRCxTQUFTUixVQUFULENBQWQ7O1VBRUksQ0FBQ1MsT0FBTCxFQUFjOztrQkFFRkQsU0FBU1IsVUFBVCxJQUF1QixJQUFJbEMsT0FBSixDQUFZLElBQVosRUFBa0JtQyxNQUFsQixFQUEwQkosSUFBMUIsRUFBZ0M7Z0JBQU87U0FBdkMsQ0FBakM7OztVQUdFWSxRQUFRQyxLQUFaLEVBQW1CO2dCQUNUQyxRQUFSOzs7Y0FHTUMsTUFBUjthQUVPSCxRQUFRekIsS0FBZjs7R0FoQ0o7OztJQ2JXNkIsUUFBYjs7QUFBQTtzQkFFZ0I7Ozs7V0FJTHhCLGNBQVAsQ0FBc0IsSUFBdEIsRUFBNEIsUUFBNUIsRUFBc0M7a0JBQ3hCLEtBRHdCO2FBRTdCLElBQUlwQixRQUFKLENBQWEsRUFBYjtLQUZUOzs7OztTQU1GNkMsTUFaRixtQkFZU0MsSUFaVCxFQVllO1dBQ0pqQyxNQUFQLENBQWMsSUFBZCxFQUFvQmlDLElBQXBCO0dBYko7Ozs7Ozs7In0= |
@@ -77,2 +77,9 @@ 'use strict'; | ||
function defineWatchersProperty(obj) { | ||
Object.defineProperty(obj, '_watchers', { | ||
value: [], | ||
enumerable: false | ||
}); | ||
} | ||
var computedWatchers = Symbol('computedWatchers'); | ||
@@ -100,3 +107,3 @@ /* istanbul ignore next */ | ||
// Needed by Vue's `Watcher` constructor | ||
this._watchers = []; | ||
defineWatchersProperty(this); | ||
this[computedWatchers] = new Map(); | ||
@@ -129,2 +136,160 @@ } | ||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
/** | ||
* Lodash (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright JS Foundation and other contributors <https://js.foundation/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
/** `Object#toString` result references. */ | ||
var asyncTag = '[object AsyncFunction]', | ||
funcTag = '[object Function]', | ||
genTag = '[object GeneratorFunction]', | ||
nullTag = '[object Null]', | ||
proxyTag = '[object Proxy]', | ||
undefinedTag = '[object Undefined]'; | ||
/** Detect free variable `global` from Node.js. */ | ||
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; | ||
/** Detect free variable `self`. */ | ||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; | ||
/** Used as a reference to the global object. */ | ||
var root = freeGlobal || freeSelf || Function('return this')(); | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
/** Used to check objects for own properties. */ | ||
var hasOwnProperty = objectProto.hasOwnProperty; | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var nativeObjectToString = objectProto.toString; | ||
/** Built-in value references. */ | ||
var Symbol$1 = root.Symbol, | ||
symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined; | ||
/** | ||
* The base implementation of `getTag` without fallbacks for buggy environments. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {string} Returns the `toStringTag`. | ||
*/ | ||
function baseGetTag(value) { | ||
if (value == null) { | ||
return value === undefined ? undefinedTag : nullTag; | ||
} | ||
return (symToStringTag && symToStringTag in Object(value)) | ||
? getRawTag(value) | ||
: objectToString(value); | ||
} | ||
/** | ||
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {string} Returns the raw `toStringTag`. | ||
*/ | ||
function getRawTag(value) { | ||
var isOwn = hasOwnProperty.call(value, symToStringTag), | ||
tag = value[symToStringTag]; | ||
try { | ||
value[symToStringTag] = undefined; | ||
var unmasked = true; | ||
} catch (e) {} | ||
var result = nativeObjectToString.call(value); | ||
if (unmasked) { | ||
if (isOwn) { | ||
value[symToStringTag] = tag; | ||
} else { | ||
delete value[symToStringTag]; | ||
} | ||
} | ||
return result; | ||
} | ||
/** | ||
* Converts `value` to a string using `Object.prototype.toString`. | ||
* | ||
* @private | ||
* @param {*} value The value to convert. | ||
* @returns {string} Returns the converted string. | ||
*/ | ||
function objectToString(value) { | ||
return nativeObjectToString.call(value); | ||
} | ||
/** | ||
* Checks if `value` is classified as a `Function` object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a function, else `false`. | ||
* @example | ||
* | ||
* _.isFunction(_); | ||
* // => true | ||
* | ||
* _.isFunction(/abc/); | ||
* // => false | ||
*/ | ||
function isFunction(value) { | ||
if (!isObject(value)) { | ||
return false; | ||
} | ||
// The use of `Object#toString` avoids issues with the `typeof` operator | ||
// in Safari 9 which returns 'object' for typed arrays and other constructors. | ||
var tag = baseGetTag(value); | ||
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; | ||
} | ||
/** | ||
* Checks if `value` is the | ||
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) | ||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is an object, else `false`. | ||
* @example | ||
* | ||
* _.isObject({}); | ||
* // => true | ||
* | ||
* _.isObject([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObject(_.noop); | ||
* // => true | ||
* | ||
* _.isObject(null); | ||
* // => false | ||
*/ | ||
function isObject(value) { | ||
var type = typeof value; | ||
return value != null && (type == 'object' || type == 'function'); | ||
} | ||
var lodash_isfunction = isFunction; | ||
var VueModel = | ||
@@ -149,2 +314,26 @@ /*#__PURE__*/ | ||
_proto.watch = function watch(expression, callback, options) { | ||
if (!this.hasOwnProperty('_watchers')) { | ||
defineWatchersProperty(this); | ||
} | ||
if (typeof callback === 'string') { | ||
callback = this[callback]; | ||
if (!lodash_isfunction(callback)) { | ||
throw new TypeError("VueModel#watch: Model doesn't have \"" + callback + "\" method"); | ||
} | ||
} | ||
var watcher = new Watcher(this, expression, callback, options); | ||
if (options && options.immediate) { | ||
callback.call(this, watcher.value); | ||
} | ||
return function () { | ||
watcher.teardown(); | ||
}; | ||
}; | ||
return VueModel; | ||
@@ -156,2 +345,1 @@ }(); | ||
exports.VueModel = VueModel; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidnVlLW1vZGVsLXguanMiLCJzb3VyY2VzIjpbIi4uL3NyYy92dWUtaW50ZXJuYWxzLmpzIiwiLi4vc3JjL29ic2VydmFibGUuanMiLCIuLi9zcmMvY29tcHV0ZWQuanMiLCIuLi9zcmMvVnVlTW9kZWwuanMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFZ1ZSBmcm9tICd2dWUnO1xuXG5jb25zdCB2dWUgPSBuZXcgVnVlKHtcbiAgd2F0Y2g6IHtcbiAgICB3KCkge31cbiAgfVxufSk7XG5cbmV4cG9ydCBjb25zdCBXYXRjaGVyID0gd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BQUwsRUFBNEM7YUFDckNILGdCQUFMLEVBQXVCVyxHQUF2QixDQUEyQlIsU0FBM0IsRUFBc0NMLE9BQU9DLE1BQVAsQ0FBYyxJQUFkLENBQXRDOzs7VUFHSWEsV0FBVyxLQUFLWixnQkFBTCxFQUF1Qk0sR0FBdkIsQ0FBMkJILFNBQTNCLENBQWpCO1VBQ0lVLFVBQVVELFNBQVNSLFVBQVQsQ0FBZDs7VUFFSSxDQUFDUyxPQUFMLEVBQWM7O2tCQUVGRCxTQUFTUixVQUFULElBQXVCLElBQUlsQyxPQUFKLENBQVksSUFBWixFQUFrQm1DLE1BQWxCLEVBQTBCSixJQUExQixFQUFnQztnQkFBTztTQUF2QyxDQUFqQzs7O1VBR0VZLFFBQVFDLEtBQVosRUFBbUI7Z0JBQ1RDLFFBQVI7OztjQUdNQyxNQUFSO2FBRU9ILFFBQVF6QixLQUFmOztHQWhDSjs7O0lDYlc2QixRQUFiOztBQUFBO3NCQUVnQjs7OztXQUlMeEIsY0FBUCxDQUFzQixJQUF0QixFQUE0QixRQUE1QixFQUFzQztrQkFDeEIsS0FEd0I7YUFFN0IsSUFBSXBCLFFBQUosQ0FBYSxFQUFiO0tBRlQ7Ozs7O1NBTUY2QyxNQVpGLG1CQVlTQyxJQVpULEVBWWU7V0FDSmpDLE1BQVAsQ0FBYyxJQUFkLEVBQW9CaUMsSUFBcEI7R0FiSjs7Ozs7Ozs7OyJ9 |
{ | ||
"name": "vue-model-x", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "MobX-like state management library for Vue.js", | ||
@@ -38,4 +38,7 @@ "main": "./dist/vue-model-x.js", | ||
"jest": "22.4.3", | ||
"lodash.isfunction": "3.0.9", | ||
"rollup": "0.57.1", | ||
"rollup-plugin-babel": "4.0.0-beta.0", | ||
"rollup-plugin-commonjs": "9.1.0", | ||
"rollup-plugin-node-resolve": "3.3.0", | ||
"vue": "^2.5.16", | ||
@@ -46,3 +49,4 @@ "vue-template-compiler": "2.5.16" | ||
"dist/*.*" | ||
] | ||
], | ||
"dependencies": {} | ||
} |
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
567
19450
18
2