-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Fully support all path-to-regex features in RestEndpoint.path t…
…ypes (#3054)
- Loading branch information
Showing
11 changed files
with
157 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@data-client/rest": patch | ||
--- | ||
|
||
Support + and \* in RestEndpoint.path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
"@data-client/rest": patch | ||
--- | ||
|
||
Add support for {} to RestEndpoint.path | ||
|
||
|
||
```ts | ||
const getThing = new RestEndpoint({ | ||
path: '/:attr1?{-:attr2}?{-:attr3}?', | ||
}); | ||
|
||
getThing({ attr1: 'hi' }); | ||
getThing({ attr2: 'hi' }); | ||
getThing({ attr3: 'hi' }); | ||
getThing({ attr1: 'hi', attr3: 'ho' }); | ||
getThing({ attr2: 'hi', attr3: 'ho' }); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,9 @@ | |
"build": "run build:lib && run build:legacy:lib && run build:bundle", | ||
"dev": "run build:lib -w", | ||
"prepare": "run build:lib", | ||
"prepack": "run prepare && run build:bundle && run build:legacy:lib" | ||
"prepack": "run prepare && run build:bundle && run build:legacy:lib", | ||
"tsc:ci": "yarn g:tsc --project tsconfig.test.json", | ||
"typecheck": "run tsc:ci" | ||
}, | ||
"author": "Nathaniel Tucker <[email protected]> (https://github.com/ntucker)", | ||
"funding": "https://github.com/sponsors/ntucker", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "./tsconfig", | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"emitDeclarationOnly": false, | ||
"skipLibCheck": true, | ||
"noImplicitAny": false, | ||
"composite": false, | ||
"rootDir": "../..", | ||
"paths": { | ||
"__tests__/*": ["__tests__/*"] | ||
} | ||
}, | ||
"include": ["typescript-tests"] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters