diff --git a/README.md b/README.md index dc1f4cd..a1f9a95 100644 --- a/README.md +++ b/README.md @@ -14,5 +14,5 @@ paket add Fable.Elmish.UrlParser ## Building -With .NET Core SDK v6 and fake tool: +With .NET Core SDK v6: > `fotnet fsi build.fsx` diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9e1f08d..146da5a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +## 1.0.2 +* Skip query's "?" (#25) + ## 1.0.1 * Support empty params query diff --git a/build.fsx b/build.fsx index 1a92295..0b5f75e 100755 --- a/build.fsx +++ b/build.fsx @@ -1,5 +1,4 @@ #!/usr/bin/env -S dotnet fsi -#r "nuget: Fake.Core.Target" #r "nuget: Fake.IO.FileSystem" #r "nuget: Fake.DotNet.Cli" #r "nuget: Fake.Core.Target" @@ -34,8 +33,6 @@ System.Environment.GetCommandLineArgs() |> Context.RuntimeContext.Fake |> Context.setExecutionContext -let withWorkDir = DotNet.Options.withWorkingDirectory - Target.create "Clean" (fun _ -> Shell.cleanDir "src/obj" Shell.cleanDir "src/bin" @@ -45,23 +42,12 @@ Target.create "Clean" (fun _ -> Target.create "Restore" (fun _ -> projects - |> Seq.iter (fun s -> - let dir = Path.GetDirectoryName s - DotNet.restore (fun a -> a.WithCommon (withWorkDir dir)) s - ) + |> Seq.iter (Path.GetDirectoryName >> DotNet.restore id) ) Target.create "Build" (fun _ -> projects - |> Seq.iter (fun s -> - let dir = Path.GetDirectoryName s - DotNet.build (fun a -> - a.WithCommon - (fun c -> - let c = c |> withWorkDir dir - {c with CustomParams = Some "/p:SourceLinkCreate=true"})) - s - ) + |> Seq.iter (Path.GetDirectoryName >> DotNet.build id) ) Target.create "Test" (fun _ -> @@ -92,19 +78,11 @@ Target.create "Meta" (fun _ -> Target.create "Package" (fun _ -> projects - |> Seq.iter (fun s -> - let dir = Path.GetDirectoryName s - DotNet.pack (fun a -> - a.WithCommon (withWorkDir dir) - ) s - ) + |> Seq.iter (Path.GetDirectoryName >> DotNet.pack id) ) Target.create "PublishNuget" (fun _ -> - let exec dir = - DotNet.exec (fun a -> - a.WithCommon (withWorkDir dir) - ) + let exec dir = DotNet.exec (DotNet.Options.withWorkingDirectory dir) let args = sprintf "push Fable.Elmish.UrlParser.%s.nupkg -s nuget.org -k %s" (string release.SemVer) (Environment.environVar "nugetkey") let result = exec "src/bin/Release" "nuget" args diff --git a/src/parser.fs b/src/parser.fs index 3830746..8c06b8d 100644 --- a/src/parser.fs +++ b/src/parser.fs @@ -356,7 +356,8 @@ let internal toKeyValuePair (segment: string) = let parseParams (querystring: string) = if System.String.IsNullOrEmpty querystring then Map.empty else - querystring.Split('&') + let querystring' = if querystring.StartsWith("?") then querystring.Substring(1) else querystring + querystring'.Split('&') |> Seq.map toKeyValuePair |> Seq.choose id |> Map.ofSeq