MCPcopy Create free account
hub / github.com/CoderOpen/waimai / encode

Function encode

front/utils/luch-request/helpers/buildURL.js:5–14  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

3import * as utils from './../utils'
4
5function encode(val) {
6 return encodeURIComponent(val).
7 replace(/%40/gi, '@').
8 replace(/%3A/gi, ':').
9 replace(/%24/g, '$').
10 replace(/%2C/gi, ',').
11 replace(/%20/g, '+').
12 replace(/%5B/gi, '[').
13 replace(/%5D/gi, ']')
14}
15
16/**
17 * Build a URL by appending params to the end

Callers 1

buildURLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected