Skip to content

Commit

Permalink
Js.Date.t -> Date.t
Browse files Browse the repository at this point in the history
  • Loading branch information
cknitt committed Oct 25, 2024
1 parent 1313bb8 commit 830ec22
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion compiler/ml/ast_untagged_variants.ml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ let type_to_instanceof_backed_obj (t : Types.type_expr) =
| Tconstr (path, _, _) when Path.same path Predef.path_array -> Some Array
| Tconstr (path, _, _) -> (
match Path.name path with
| "Js_date.t" -> Some Date
| "Date.t" -> Some Date
| "Js_re.t" -> Some RegExp
| "Js_file.t" -> Some File
| "Js_blob.t" -> Some Blob
Expand Down
2 changes: 1 addition & 1 deletion runtime/Date.res
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type t = Js.Date.t
type t

type msSinceEpoch = float

Expand Down
2 changes: 1 addition & 1 deletion runtime/Date.resi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
A type representing a JavaScript date.
*/
type t = Js.Date.t
type t

/**
Time, in milliseconds, since / until the UNIX epoch (January 1, 1970 00:00:00 UTC).
Expand Down
2 changes: 1 addition & 1 deletion runtime/Js_date.res
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on MDN.) JavaScript stores dates as the number of milliseconds since the UNIX
*epoch*, midnight 1 January 1970, UTC.
*/

type t
type t = Date.t

@send
/**
Expand Down
16 changes: 6 additions & 10 deletions runtime/Pervasives.res
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
/**
Since [others] depend on this file, its public mli files **should not
export types** introduced here, otherwise it would cause
conflicts here.
/* Core type aliases */

If the type exported here is also exported in modules from others,
you will get a type not equivalent.
*/
@deprecated("Do not use. This will be removed in v13")
external /* Internal */
type date = Date.t

__unsafe_cast: 'a => 'b = "%identity"
/* Internal */

@deprecated("Do not use. This will be removed in v13")
external __unsafe_cast: 'a => 'b = "%identity"

/* Exceptions */

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tests/gentype_tests/typescript-react-example/src/Date.res

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type t = Date.t
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ type instantiateTypeParameter = ocaml_array<someRecord>
@genType @genType.as("Vector")
type vector<'a> = ('a, 'a)

@genType type date = Js.Date.t
@genType type date = Date.t

@genType let currentTime = Js.Date.make()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type t = Js.Date.t
type t = Date.t

@val @module("date-fns")
external dateFormat: (t, string) => string = "format"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type t = Js.Date.t
type t = Date.t

type format =
| OnlyDate
Expand Down

0 comments on commit 830ec22

Please sign in to comment.