不要怂,就是干,撸起袖子干!

Commit be070371 by Ruben Bridgewater

Insert depcreate message for .values

1 parent 3f00865f
Showing with 9 additions and 1 deletions
...@@ -6,7 +6,13 @@ var Utils = require('./utils') ...@@ -6,7 +6,13 @@ var Utils = require('./utils')
, DataTypes = require('./data-types') , DataTypes = require('./data-types')
, Promise = require("./promise") , Promise = require("./promise")
, _ = require('lodash') , _ = require('lodash')
, defaultsOptions = { raw: true }; , defaultsOptions = { raw: true }
, deprecatedSeen = {}
, deprecated = function(message) {
if (deprecatedSeen[message]) return;
console.warn(message);
deprecatedSeen[message] = true;
};
module.exports = (function() { module.exports = (function() {
...@@ -80,12 +86,14 @@ module.exports = (function() { ...@@ -80,12 +86,14 @@ module.exports = (function() {
/** /**
* Get the values of this Instance. Proxies to `this.get` * Get the values of this Instance. Proxies to `this.get`
* @deprecated .values is deprecated. Please use .get() instead.
* @see {Instance#get} * @see {Instance#get}
* @property values * @property values
* @return {Object} * @return {Object}
*/ */
Object.defineProperty(Instance.prototype, 'values', { Object.defineProperty(Instance.prototype, 'values', {
get: function() { get: function() {
deprecated('Using .values has been deprecated. Please use .get() instead');
return this.get(); return this.get();
} }
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!