Git Product home page Git Product logo

js-proper-url-join's People

Contributors

andregoncalvesdev avatar areadrill avatar dependabot[bot] avatar greenkeeper[bot] avatar joanamelo avatar satazor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-proper-url-join's Issues

Add option to keep leading/trailing slashes

We have a case where we have to build urls programmatically and want to keep the leading and trailing slashes if there are any.

It would be great to have a third option e.g trailingSlash : 'keep' to support this use case.

Path's joined wrong if encoding is disabled

I am trying to join path for the router (which is using path-to-regexp).

const path = properUrlJoin('some-path', '/:id?/:subnav?/:step?', {
    trailingSlash: true,
    queryOptions: {
        encode: false,
    },
})

expected output should be

/some-path/:id?/:subnav?/:step?/

but it results to

/flow/:id/?/:subnav?/:step?β€ˆ

Enhancement: Replace part of the url

It will be great if you add this, replace in url something like that:

urlJoin('foo/bar/users/:id/profile', { ':id': 14 })

// => foo/bar/users/14/profile

may be like that...

if (key == 'leadingSlash') {...}
else if (key == 'trailingSlash') {...}
else if (key == 'protocolRelative') {..}
.
.
... else {
  // try to replace in url
   if (url.indexOf(key)) url = url.replace(key, value)
}
 

or may be like that :

{ query: { biz: 'buz', foo: 'bar' } , url: {':id', 14}}

I need that for faxios

Support for mailto and other URIs

Should we consider adding support for mailto URI and others alike? Or would that be out of scope of this module?

Currently, unlike http and https, mailto appears to somehow be treated like a relative URL as a leading slash is prepended to the output.

An in-range update of babel-preset-moxy is breaking the build 🚨

Version 2.3.4 of babel-preset-moxy was just published.

Branch Build failing 🚨
Dependency babel-preset-moxy
Current Version 2.3.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

babel-preset-moxy is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 2 commits.

  • d94c357 chore(release): 2.3.4
  • 722526c fix: fix dev errors when using transform-react-inline-elements

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

It doesn't support full URLS

When joining full urls it removes the second /
Example:

import urlJoin from 'proper-url-join';

const test = urlJoin('http://localhost','test','v1', { leadingSlash: false, });

It returns http:/localhost/test/v1

Import queryString not found

When using with Angular 10, I'm getting this error:

ERROR in ./node_modules/proper-url-join/es/index.js 80:46-57
"export 'default' (imported as 'queryString') was not found in 'query-string'
ERROR in ./node_modules/proper-url-join/es/index.js 82:17-28
"export 'default' (imported as 'queryString') was not found in 'query-string'

Might that syntheticDefaultImport in Line 1 be a problem in some cases? Should be replaceable by import * as queryString from 'query-string'; afaik.

Update: import * as queryString from 'query-string'; did not solve it for me, there seems to be a problem with the query-string dependency itself. I tried to install the fixed version "query-string": "6.3.0",, but still had no luck.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.