Skip to content

Commit

Permalink
~ deprecate assignQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Nov 9, 2016
1 parent fa07582 commit a54cae2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "blear.utils.url",
"version": "1.0.11",
"version": "1.0.12",
"description": "url utils",
"scripts": {
"live": "browser-sync start --config bs-config.js",
Expand Down Expand Up @@ -39,6 +39,7 @@
"peerDependencies": {
"blear.utils.querystring": "1.x",
"blear.utils.array": "1.x",
"blear.utils.debug": "1.x",
"blear.utils.object": "1.x",
"blear.utils.typeis": "1.x",
"blear.utils.access": "1.x",
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Expand Up @@ -6,6 +6,7 @@ var object = require('blear.utils.object');
var typeis = require('blear.utils.typeis');
var access = require('blear.utils.access');
var path = require('blear.utils.path');
var debug = require('blear.utils.debug');

var rePathname = /[?#].*$/;
var reSearch = /\?.*$/;
Expand Down Expand Up @@ -220,7 +221,7 @@ exports.matchPath = function (url, rule, options) {
* @param [val] {String} 参数值
* @returns {*}
*/
exports.assignQuery = function (url, key, val) {
var setQuery = exports.setQuery = function (url, key, val) {
var args = access.args(arguments);
var query = {};

Expand All @@ -244,6 +245,8 @@ exports.assignQuery = function (url, key, val) {
return stringify(urlParsed);
};

exports.assignQuery = debug.deprecate(setQuery, '`assignQuery`将被废弃,请使用`setQuery`代替');


/**
* 移除 query key
Expand Down

0 comments on commit a54cae2

Please sign in to comment.