1.3.13 • Published 1 year ago

@dramaorg/repellendus-perferendis v1.3.13

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Rest URL Parser

license npm

Only a function called parseRequestURL().

Simplify the handling of URLs that contain parameters..

It's particularly useful for applications that deal with REST APIs where resource identifiers are embedded in the URL.

Table of Contents

Get Started

Install

This project uses node and npm. Please install them first.

npm install  @dramaorg/repellendus-perferendis

Usage

import parseRequestURL from '@dramaorg/repellendus-perferendis';

const sourceConfig = {
  url: '/user/:userId/post/:postId',
  params: {
    userId: '123',
    postId: '456',
  },
};

const result = parseRequestURL(sourceConfig);

console.log(result);

Use with Axios:

import parseRequestURL from '@dramaorg/repellendus-perferendis';

const instance = axios.create(appConfig.httpClient);

const requestInterceptor = instance.interceptors.request.use(
  function (config) {
    const restConfig = parseRequestURL(config);
    return restConfig;
  },
  function (error) {
    return Promise.reject(error);
  }
);

instance.post('/user/:userId/post/:postId', {
  userId: '123',
  postId: '456',
});

API

parseRequestURL(sourceConfig)

This function takes a sourceConfig object and parses the url property for parameters. It returns the updated sourceConfig.

parseRequestURL(sourceConfig);

Contributing

Your contributions and suggestions are heartily welcome. Submit an issue or submit a pull request.

Thanks to all the people who already contributed!

License

MIT

ast[[Prototype]]mapshamWebSocketstoSortedmobilenativeES2023nodereadablestreamclassnamergbasciiFloat32Arrayjsdomlrues-abstractcurlfeedindicatorsortedutilityprunecssprivatetypedarrayswebspinnersdescriptionstyled-components256proxytypescriptclonevariablesapijavascriptfantasy-landfiletoArrayflagmkdirpprotobufspawnHyBiUint8Arrayajvcircularecmascriptreactcall-boundcolumnses6gdprtrimLeftreadableec2regular expressionsglobutilszodassignroute53package managerWeakSetUint32Arraycallbindslothashdayjsarktypereadi18nposewhatwgfnmatchtypesafeclientTypeScriptlintloggingrangeerrorcolumnfull-widthenvironmentoptimisthardlinksrfc4122coercibleidObjectletrm -frdataViewcoverageES8serializeECMAScript 2023propdefinePropertypipeObject.entriesArray.prototype.flatMaprobustquotejshintmodulecensorfilterwaapiguidapolloforkArray.prototype.includesendpointredactPromisenumbertextformstringifierJSONlocalbinariesfoldercontainsmkdirBigUint64Arraygitignoreshrinkwraptraversefunctionsgroupkeysaccessibilitymatchesjsdiffreact animationtrimStartES6queryutilES2019nameshtmlrmWeakMaptranspileRxJSArrayexpressfindupglobalsconcatstreamskeyelectronObject.isdependency managertrimkoreanobjectwgetreducehooks-0debugbuffersexpressionlibphonenumberselfclassesprotohttpslastenvironmentsdependenciessettingseslintpluginsetterlistenersbabelfindLastIndexsideinternalcurriedcjkECMAScript 2022findpicomatch.gitignoreworkflowpyyamleslintReactiveXequalityUint8ClampedArrayregular-expressionTypeBoxtermFloat64ArrayInt32ArrayqueueMicrotasknodejswarningObservablesspeedArray.prototype.flatvaluefast-deep-copypoint-freenpmformatchaiiteratereal-timetc39execlocationString.prototype.trimcryptolanguagestoragegatewayterminalchineseefficientrssjson-schema-validationpostcss-plugingroupByflattendescriptorobjsuperstructlook-upjsonhassafe0harmonytacitshimvalidincodestyped arrayairbnbasyncsharedarraybuffertranspilerredux-toolkitfasttapdeepES7nopeinternal slotpathparentesimmutablegetarraycolorsautoscalingcoloureventEmitterarraybuffervalidatoruuidES2018ECMAScript 5fpyuptslinkECMAScriptECMAScript 6ES2022autoprefixerreverseframeworkjson-schemainputavaargumentArray.prototype.filterbeanstalkcoreECMAScript 3MicrosoftArray.prototype.findLastIndextoolkitpnpm9constmanipulationReflect.getPrototypeOferrortrimRightJSON-Schematapeqshookformpino
1.3.13

1 year ago

1.3.12

1 year ago

1.3.11

1 year ago

1.3.10

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago