demo/editor/kissy.js
function (serializeArray) {

            var out = [],
                self = this,
                scheme,
                hostname,
                path,
                port,
                fragment,
                query,
                userInfo;

            if (scheme = self.scheme) {
                out.push(encodeSpecialChars(scheme, reDisallowedInSchemeOrUserInfo));
                out.push(':');
            }

            if (hostname = self.hostname) {
                out.push('//');
                if (userInfo = self.userInfo) {
                    out.push(encodeSpecialChars(userInfo, reDisallowedInSchemeOrUserInfo));
                    out.push('@');
                }

                out.push(encodeURIComponent(hostname));

                if (port = self.port) {
                    out.push(':');
                    out.push(port);
                }
            }

            if (path = self.path) {
                if (hostname && !S.startsWith(path, '/')) {
                    path = '/' + path;
                }
                path = Path.normalize(path);
                out.push(encodeSpecialChars(path, reDisallowedInPathName));
            }

            if (query = ( self.query.toString.call(self.query, serializeArray))) {
                out.push('?');
                out.push(query);
            }

            if (fragment = self.fragment) {
                out.push('#');
                out.push(encodeSpecialChars(fragment, reDisallowedInFragment))
            }

            return out.join('');
        }
function (serializeArray) {

            var out = [],
                self = this,
                scheme,
                hostname,
                path,
                port,
                fragment,
                query,
                userInfo;

            if (scheme = self.scheme) {
                out.push(encodeSpecialChars(scheme, reDisallowedInSchemeOrUserInfo));
                out.push(':');
            }

            if (hostname = self.hostname) {
                out.push('//');
                if (userInfo = self.userInfo) {
                    out.push(encodeSpecialChars(userInfo, reDisallowedInSchemeOrUserInfo));
                    out.push('@');
                }

                out.push(encodeURIComponent(hostname));

                if (port = self.port) {
                    out.push(':');
                    out.push(port);
                }
            }

            if (path = self.path) {
                if (hostname && !S.startsWith(path, '/')) {
                    path = '/' + path;
                }
                path = Path.normalize(path);
                out.push(encodeSpecialChars(path, reDisallowedInPathName));
            }

            if (query = ( self.query.toString.call(self.query, serializeArray))) {
                out.push('?');
                out.push(query);
            }

            if (fragment = self.fragment) {
                out.push('#');
                out.push(encodeSpecialChars(fragment, reDisallowedInFragment))
            }

            return out.join('');
        }
function ( serializeArray ) { var out = [ ] , self = this , scheme , hostname , path , port , fragment , query , userInfo ; if ( scheme = self . scheme ) { out . push ( encodeSpecialChars ( scheme , reDisallowedInSchemeOrUserInfo ) ) ; out . push ( ':' ) ; } if ( hostname = self . hostname ) { out . push ( '//' ) ; if ( userInfo = self . userInfo ) { out . push ( encodeSpecialChars ( userInfo , reDisallowedInSchemeOrUserInfo ) ) ; out . push ( '@' ) ; } out . push ( encodeURIComponent ( hostname ) ) ; if ( port = self . port ) { out . push ( ':' ) ; out . push ( port ) ; } } if ( path = self . path ) { if ( hostname && ! S . startsWith ( path , '/' ) ) { path = '/' + path ; } path = Path . normalize ( path ) ; out . push ( encodeSpecialChars ( path , reDisallowedInPathName ) ) ; } if ( query = ( self . query . toString . call ( self . query , serializeArray ) ) ) { out . push ( '?' ) ; out . push ( query ) ; } if ( fragment = self . fragment ) { out . push ( '#' ) ; out . push ( encodeSpecialChars ( fragment , reDisallowedInFragment ) ) } return out . join ( '' ) ; }
Serialize to string.
See rfc 5.3 Component Recomposition.
But kissy does not differentiate between undefined and empty.
@param {Boolean} [serializeArray=true]
whether append [] to key name when value 's type is array
@return {String}
Serialize to string . See rfc 5 . 3 Component Recomposition . But kissy does not differentiate between undefined and empty .