How to use the uri-js.serialize function in uri-js

To help you get started, we’ve selected a few uri-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github whitlockjc / json-refs / index.js View on Github external
// Join the paths
      combinedDetails.path = slash(path.join(u1Details.path, u2Details.path));

      // Join query parameters
      combinedDetails.query = combineQueryParams(u1Details.query, u2Details.query);
    } else {
      combinedDetails = u2Details;
    }
  }

  // Remove the fragment
  combinedDetails.fragment = undefined;

  // For relative URIs, add back the '..' since it was removed above
  return (remoteUriTypes.indexOf(combinedDetails.reference) === -1 &&
          combinedDetails.path.indexOf('../') === 0 ? '../' : '') + URI.serialize(combinedDetails);
}
github vimlet / bundl / tests / features / font / node_modules / ajv / lib / compile / resolve.js View on Github external
function _getFullPath(p) {
  return URI.serialize(p).split('#')[0] + '#';
}
github adobe / helix-pipeline / src / html / find-embeds.js View on Github external
function embed(uri, node, whitelist = '', debug = () => {}) {
  if ((uri.scheme === 'http' || uri.scheme === 'https') && mm.some(uri.host, whitelist.split(','))) {
    const children = [{ ...node }];
    node.type = 'embed';
    node.children = children;
    node.url = URI.serialize(uri);
    if (node.value) {
      delete node.value;
    }
  } else {
    debug(`Whitelist forbids embedding of URL: ${URI.serialize(uri)}`);
  }
}
github epoberezkin / ajv / lib / compile / resolve.js View on Github external
function _getFullPath(p) {
  return URI.serialize(p).split('#')[0] + '#';
}
github weixin / Miaow / node_modules / ajv / lib / compile / resolve.js View on Github external
function _getFullPath(p) {
  return URI.serialize(p).split('#')[0] + '#';
}
github adobe / helix-pipeline / src / utils / link-handler.js View on Github external
return function handler(h, node) {
    const n = { ...node };
    const uriParts = uri.parse(n.url);
    if (!uriParts.scheme && uriParts.path) {
      uriParts.path = uriParts.path.replace(/\.md$/, `.${extension}`);
      n.url = uri.serialize(uriParts);
    }
    return fallback(h, n);
  };
}
github bhauman / react-native-figwheel-bridge / figwheel-bridge.js View on Github external
function correctUrl(url) {
    var u = URI.parse(url);
    if(isChrome()) {
	u.host = "localhost";
    }
    return URI.serialize(u);
}
github bali182 / autocomplete-json / src / json-schema-loader.js View on Github external
load(uri) {
    return axios.get(uriJs.serialize(uri)).then(response => response.data)
  }
}

uri-js

An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.

BSD-2-Clause
Latest version published 4 years ago

Package Health Score

67 / 100
Full package analysis