umaki 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../to/toBoolean.cjs.js"),s=async(a,t)=>{if(t&&a.paused){if(i.toBoolean(a.dataset.playing))return;const r=a.play();if(r===void 0)return;try{await r,a.currentTime=0,a.dataset.playing="true"}catch{}}if(!t){if(!i.toBoolean(a.dataset.playing))return;a.pause(),a.dataset.playing="false"}};exports.videoPlayControl=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../to/toBoolean.cjs.js"),i=async(a,r)=>{if(r&&a.paused){if(o.toBoolean(a.dataset.playing))return;const t=a.play();if(t===void 0)return;try{await t,a.currentTime=0,a.dataset.playing="true"}catch{}}r||(a.pause(),a.dataset.playing="false")};exports.videoPlayControl=i;
@@ -1,18 +1,15 @@
1
- import { toBoolean as s } from "../to/toBoolean.es.js";
1
+ import { toBoolean as t } from "../to/toBoolean.es.js";
2
2
  const p = async (a, r) => {
3
3
  if (r && a.paused) {
4
- if (s(a.dataset.playing)) return;
5
- const i = a.play();
6
- if (i === void 0) return;
4
+ if (t(a.dataset.playing)) return;
5
+ const s = a.play();
6
+ if (s === void 0) return;
7
7
  try {
8
- await i, a.currentTime = 0, a.dataset.playing = "true";
8
+ await s, a.currentTime = 0, a.dataset.playing = "true";
9
9
  } catch {
10
10
  }
11
11
  }
12
- if (!r) {
13
- if (!s(a.dataset.playing)) return;
14
- a.pause(), a.dataset.playing = "false";
15
- }
12
+ r || (a.pause(), a.dataset.playing = "false");
16
13
  };
17
14
  export {
18
15
  p as videoPlayControl
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umaki",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "A utility that is often used in web production.",
5
5
  "author": "TsubasaHiga",
6
6
  "homepage": "https://github.com/TsubasaHiga/umaki",