Browse Source

Update comments.

NaotoshiFujita 3 years ago
parent
commit
de0196750a

+ 2 - 0
src/js/components/Controller/Controller.ts

@@ -141,6 +141,8 @@ export function Controller( Splide: Splide, Components: Components, options: Opt
    * Parses the control and returns a slide index.
    *
    * @param control - A control pattern to parse.
+   *
+   * @return A `dest` index.
    */
   function parse( control: number | string ): number {
     let index = currIndex;

+ 10 - 10
src/js/components/Drag/Drag.ts

@@ -293,25 +293,25 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
   }
 
   /**
-   * Checks if the provided event is TouchEvent or MouseEvent.
+   * Returns the time stamp in the provided event object.
    *
-   * @param e - An event to check.
+   * @param e - A TouchEvent or MouseEvent object.
    *
-   * @return `true` if the `e` is TouchEvent.
+   * @return A time stamp.
    */
-  function isTouchEvent( e: TouchEvent | MouseEvent ): e is TouchEvent {
-    return typeof TouchEvent !== 'undefined' && e instanceof TouchEvent;
+  function timeOf( e: TouchEvent | MouseEvent ): number {
+    return e.timeStamp;
   }
 
   /**
-   * Returns the time stamp in the provided event object.
+   * Checks if the provided event is TouchEvent or MouseEvent.
    *
-   * @param e - A TouchEvent or MouseEvent object.
+   * @param e - An event to check.
    *
-   * @return A time stamp.
+   * @return `true` if the `e` is TouchEvent.
    */
-  function timeOf( e: TouchEvent | MouseEvent ): number {
-    return e.timeStamp;
+  function isTouchEvent( e: TouchEvent | MouseEvent ): e is TouchEvent {
+    return typeof TouchEvent !== 'undefined' && e instanceof TouchEvent;
   }
 
   /**

+ 0 - 1
src/js/components/Layout/Layout.ts

@@ -212,7 +212,6 @@ export function Layout( Splide: Splide, Components: Components, options: Options
   /**
    * Returns the gap value.
    *
-   *
    * @return The gap value in pixel.
    */
   function getGap(): number {