0.0.20 • Published 1 year ago

@firecamp/url v0.0.20

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

URL Utility

Usage

Update URL on update raw string

import _url from '@firecamp/url'

// parse query, path params from raw URL and return URL Object
// with updated params table
state.urlObj = _url.updateByRaw(state.urlObj)

Update URL on update query from table

import _url from '@firecamp/url'

// Return URL object by updating query into raw URL from table
const { raw } = _url.updateByQuery(state.urlObj)

// Update raw URL into state
state.urlObj.raw = raw

Parse URL

import _url from '@firecamp/url'

// Parse URL string, require at the time of request execution
_url.parse('google.com', ['http', 'https])

// return http://google.com

Replace Path Params value

import _url from '@firecamp/url'

// Parse URL string, require at the time of request execution
_url.replacePathParams('http://localhost:3000/:id', [{ key: 'id', value: '1' }])

// return http://localhost:3000/1
0.0.20

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.15

2 years ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago