How to use the pathifist.ensureLeadingSlash function in pathifist

To help you get started, we’ve selected a few pathifist 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 untool / untool / packages / react / mixins / mixin.browser.js View on Github external
enhanceElement(element) {
    const props = {
      ...this.options.router,
      basename: trimTrailingSlash(ensureLeadingSlash(this.config.basePath)),
    };
    return createElement(BrowserRouter, props, element);
  }
  render() {
github untool / untool / packages / react / mixins / mixin.server.js View on Github external
enhanceElement(element) {
    const { pathname, search } = this.url;
    const props = {
      ...this.options.router,
      location: { pathname, search },
      basename: trimTrailingSlash(ensureLeadingSlash(this.config.basePath)),
      context: this.context,
    };
    return createElement(StaticRouter, props, element);
  }
  renderToFragments(element) {
github untool / untool / packages / webpack / mixins / render / mixin.core.js View on Github external
return locations.map((location) => {
      const isString = typeof location === 'string';
      const url = ensureLeadingSlash(
        joinUrl(basePath, isString ? location : location.url)
      );
      return isString ? { url } : { ...location, url };
    });
  }

pathifist

URL Path Utility

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis