Skip to content

Commit

Permalink
Merge pull request #371 from ocsigen/dependabot/npm_and_yarn/typescri…
Browse files Browse the repository at this point in the history
…pt-5.3.3

Bump typescript from 5.1.6 to 5.3.3
  • Loading branch information
cannorin authored Feb 28, 2024
2 parents 1c119c0 + bf5446c commit e3c07c3
Show file tree
Hide file tree
Showing 4 changed files with 4,421 additions and 758 deletions.
6 changes: 5 additions & 1 deletion build/BindingUpdater.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ let ts2fable (srcs: string list) (dest: string) =
)

let typeParamConstraints =
new Regex("""when '\w+ :> \w+(?: and '\w+ :> \w+)*""", RegexOptions.Compiled)
new Regex("""when '\w+ :> [\w\.]+(?: and '\w+ :> [\w\.]+)*""", RegexOptions.Compiled)

let erasedCast =
new Regex("""static member inline op_ErasedCast.+$""", RegexOptions.Compiled ||| RegexOptions.Multiline)

let importAttribute =
new Regex("""\[<Import\(""", RegexOptions.Compiled)

let replace (regex: Regex) (replacement: string) (s: string) =
printfn $"{regex.ToString()} ==> {replacement}"
regex.Replace(s, replacement)
Expand All @@ -28,6 +31,7 @@ let typescript () =
File.readAsString dest
|> replace typeParamConstraints ""
|> replace erasedCast "// $&"
|> replace importAttribute "[<Fable.Core.Import("
|> File.writeString false dest

let run () =
Expand Down
Loading

0 comments on commit e3c07c3

Please sign in to comment.