How to use the uri-js.resolve 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 adobe / helix-cli / src / openwhisk / static.js View on Github external
url: (asset) => {
        // TODO pass in request URL and make it absolute.
        if (asset.search === '' && asset.absolutePath !== '.' && asset.relativePath !== '.') {
          return `${asset.relativePath}`;
        }
        return asset.url;
      },
    }));
github vimlet / bundl / tests / features / font / node_modules / ajv / lib / compile / resolve.js View on Github external
function resolveUrl(baseId, id) {
  id = normalizeId(id);
  return URI.resolve(baseId, id);
}
github brahma-dev / metafetch / index.js View on Github external
response.links = $('a').map(function() {
			var href = $(this).attr('href');
			if (href && href.trim().length && href[0] !== "#") {
				return URI.resolve(url, href);
			} else {
				return 0;
			}
		}).filter(function(i, item) {
			if (item === 0) {
github weixin / Miaow / node_modules / ajv / lib / compile / resolve.js View on Github external
function resolveUrl(baseId, id) {
  id = normalizeId(id);
  return URI.resolve(baseId, id);
}
github brahma-dev / metafetch / index.js View on Github external
}
	}

	response.uri = uri;

	if (options.title) {
		response.title = metaData['og:title'] || title;
	}
	if (options.description) {
		response.description = metaData['og:description'] || metaData.description;
	}
	if (options.type) {
		response.type = metaData['og:type'];
	}
	if (options.url) {
		response.url = URI.resolve(url, canonicalURL || metaData['og:url'] || url);
		response.originalURL = url;
		response.ampURL = ampURL || null;
	}
	if (options.siteName) {
		response.siteName = metaData['og:site_name'];
	}
	if (options.image) {
		response.image = metaData['og:image'];
	}
	if (options.meta) {
		response.meta = metaData;
	}
	if (options.headers) {
		response.headers = header;
	}
	return response;
github adobe / helix-cli / src / openwhisk / static.js View on Github external
if (importuri.reference === 'relative' && !importuri.query) {
            rule.replaceWith(postcss.atRule({
              name: 'import',
              params: `url(${quote}${importuri.path}${quote}) ${queries}`,
            }));
          }
        } else if (parsedurl.nodes
          && parsedurl.nodes[0].type === 'string'
          && typeof parsedurl.nodes[0].value === 'string'
          && typeof parsedurl.nodes[0].quote === 'string') {
          const importuri = uri.parse(parsedurl.nodes[0].value);
          const { quote } = parsedurl.nodes[0];
          if (importuri.reference === 'relative' && !importuri.query) {
            rule.replaceWith(postcss.atRule({
              name: 'import',
              params: `${quote}${importuri.path}${quote} ${queries}`,
            }));
          }
        }
      }
    });
    return tree;
github brahma-dev / metafetch / index.js View on Github external
response.images = $('img').map(function() {
			var src = $(this).attr('src');
			if (src) {
				return URI.resolve(url, src);
			} else {
				return "";
			}
		}).filter(function(e, f) {
			return (f.match(/\.(jpeg|jpg|gif|png|JPEG|JPG|GIF|PNG)$/) !== null);

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