How to use the relateurl.relate function in relateurl

To help you get started, we’ve selected a few relateurl 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 sourcegraph / sourcegraph / lsif / src / worker / conversion / correlator.ts View on Github external
public insert(element: lsif.Vertex | lsif.Edge): void {
        if (element.type === lsif.ElementTypes.vertex) {
            switch (element.label) {
                case lsif.VertexLabels.metaData:
                    this.handleMetaData(element)
                    break

                case lsif.VertexLabels.document: {
                    if (!this.projectRoot) {
                        throw new Error('No metadata defined.')
                    }

                    const path = RelateUrl.relate(this.projectRoot.href + '/', new URL(element.uri).href, {
                        defaultPorts: {},
                        output: RelateUrl.PATH_RELATIVE,
                        removeRootTrailingSlash: false,
                    })

                    this.documentPaths.set(element.id, path)
                    this.containsData.set(element.id, new Set())
                    break
                }

                // The remaining vertex handlers stash data into an appropriate map. This data
                // may be retrieved when an edge that references it is seen, or when a document
                // is finalized.

                case lsif.VertexLabels.range:
                    this.rangeData.set(element.id, {
github DanielRuf / html-minifier-terser / src / htmlminifier.js View on Github external
options.minifyURLs = function(text) {
        try {
          return RelateUrl.relate(text, value);
        }
        catch (err) {
          options.log(err);
          return text;
        }
      };
    }
github sx1989827 / DOClever / node_modules / html-minifier / src / htmlminifier.js View on Github external
options.minifyURLs = function(text) {
        try {
          return RelateUrl.relate(text, value);
        }
        catch (err) {
          options.log(err);
          return text;
        }
      };
    }
github aemoe / webpack-react-framework / node_modules / html-minifier / src / htmlminifier.js View on Github external
options.minifyURLs = function(text) {
      try {
        return RelateUrl.relate(text, minifyURLs);
      }
      catch (err) {
        options.log(err);
        return text;
      }
    };
  }
github fossasia / susper.com / node_modules / html-minifier / src / htmlminifier.js View on Github external
options.minifyURLs = function(text) {
        try {
          return RelateUrl.relate(text, value);
        }
        catch (err) {
          options.log(err);
          return text;
        }
      };
    }
github sx1989827 / DOClever / Desktop / node_modules / html-minifier / src / htmlminifier.js View on Github external
options.minifyURLs = function(text) {
      try {
        return RelateUrl.relate(text, minifyURLs);
      }
      catch (err) {
        options.log(err);
        return text;
      }
    };
  }
github Dajust / reduxTrello / node_modules / html-minifier / src / htmlminifier.js View on Github external
options.minifyURLs = function(text) {
      try {
        return RelateUrl.relate(text, minifyURLs);
      }
      catch (err) {
        options.log(err);
        return text;
      }
    };
  }
github sourcegraph / sourcegraph-typescript / src / server / uri.ts View on Github external
export const relativeUrl = (from: URL, to: URL): string => RelateUrl.relate(from.href, to.href, RELATE_URL_OPTIONS)
github sx1989827 / DOClever / Client / node_modules / vue-html-loader / node_modules / html-minifier / src / htmlminifier.js View on Github external
options.minifyURLs = function(text) {
      try {
        return RelateUrl.relate(text, minifyURLs);
      }
      catch (err) {
        options.log(err);
        return text;
      }
    };
  }

relateurl

Minify URLs by converting them from absolute to relative.

MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis

Popular relateurl functions