You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After dispatching an action, npm module @respond_framework/rudy/es/utils/parseSearch.js truncates the query string(12a) starting with number to only number(12))
#80
Open
anil-moharana opened this issue
Sep 25, 2020
· 1 comment
After dispatching an action like this
dispatch({
type: 'SEARCH',
query: {
q
}
})
This parseSearch.js file truncates the querystring 123abc to 123 only.
For all other strings it works fine.
@respond_framework/rudy/es/utils/matchUrl.js
function call:
var parseSearch = function parseSearch(search, route, opts) {
if (queries[search]) return queries[search];
var parse = route.parseSearch || opts.parseSearch;
queries[search] = parse(search);
return queries[search];
};
anil-moharana
changed the title
npm module @respond_framework/rudy/es/utils/parseSearch.js truncates the query string(12a) starting with number to only number(12))
After dispatching an action, npm module @respond_framework/rudy/es/utils/parseSearch.js truncates the query string(12a) starting with number to only number(12))
Sep 27, 2020
After dispatching an action like this
dispatch({
type: 'SEARCH',
query: {
q
}
})
This parseSearch.js file truncates the querystring 123abc to 123 only.
For all other strings it works fine.
@respond_framework/rudy/es/utils/matchUrl.js
function call:
var parseSearch = function parseSearch(search, route, opts) {
if (queries[search]) return queries[search];
var parse = route.parseSearch || opts.parseSearch;
queries[search] = parse(search);
return queries[search];
};
@respond_framework/rudy/es/utils/parseSearch.js
import qs from 'qs';
export default (function (search) {
return qs.parse(search, {
decoder: decoder
});
});
var decoder = function decoder(str, decode) { //str=12a
return isNumber(str) ? Number.parseFloat(str) : decode(str); // returns 12 instead of 12a
};
var isNumber = function isNumber(str) {
return !Number.isNaN(Number.parseFloat(str));// returns true for 12a which should be false
};
The text was updated successfully, but these errors were encountered: