@jeniex/utils 1.0.7 → 1.0.9

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.
package/browser/index.cjs CHANGED
@@ -50,9 +50,9 @@ else {
50
50
  infoObject = { script: { name: document.title } };
51
51
  }
52
52
  const scriptName = infoObject.script.name;
53
- /** The identifier of the script to be used in logging */
53
+ /** The identifier of the script to be used in logging. */
54
54
  const logId = `[${scriptName}]:`;
55
- /** The initial tab URL on the script run */
55
+ /** The initial tab URL on the script run. */
56
56
  const tabURL = window.location.href;
57
57
 
58
58
  function alert(message) {
@@ -208,7 +208,7 @@ function addStyle(css, parent = document.documentElement) {
208
208
  }
209
209
 
210
210
  /**
211
- * Waits for image to fully load or throws an error if it failed.
211
+ * Waits for image to fully load or throws an error if it fails.
212
212
  */
213
213
  async function imageLoad(img) {
214
214
  return new Promise((resolve, reject) => {
@@ -29,11 +29,11 @@ interface FishXOptions {
29
29
  onProgress?: (response: VMScriptResponseObject<Blob>) => Promise<void> | void;
30
30
  }
31
31
  interface Fish<T> {
32
- blob: (url: string, options: T) => Promise<Blob>;
33
- buffer: (url: string, options: T) => Promise<ArrayBuffer>;
34
- document: (url: string, options: T) => Promise<Document>;
35
- json: (url: string, options: T) => Promise<object>;
36
- text: (url: string, options: T) => Promise<string>;
32
+ blob: (url: string, options?: T) => Promise<Blob>;
33
+ buffer: (url: string, options?: T) => Promise<ArrayBuffer>;
34
+ document: (url: string, options?: T) => Promise<Document>;
35
+ json: (url: string, options?: T) => Promise<object>;
36
+ text: (url: string, options?: T) => Promise<string>;
37
37
  }
38
38
 
39
39
  declare function fishResponse(url: string, options?: RequestInit): Promise<Response>;
@@ -62,15 +62,15 @@ declare function getSearchParam(key: string, fullURL?: string): string | undefin
62
62
  declare function setSearchParam(key: string, value: string, fullURL?: string): string;
63
63
 
64
64
  declare const scriptName: string;
65
- /** The identifier of the script to be used in logging */
65
+ /** The identifier of the script to be used in logging. */
66
66
  declare const logId: string;
67
- /** The initial tab URL on the script run */
67
+ /** The initial tab URL on the script run. */
68
68
  declare const tabURL: string;
69
69
 
70
70
  declare function addStyle(css: string, parent?: HTMLElement): HTMLStyleElement;
71
71
 
72
72
  /**
73
- * Waits for image to fully load or throws an error if it failed.
73
+ * Waits for image to fully load or throws an error if it fails.
74
74
  */
75
75
  declare function imageLoad(img: HTMLImageElement): Promise<void>;
76
76
 
@@ -78,7 +78,7 @@ declare function imageLoad(img: HTMLImageElement): Promise<void>;
78
78
  * Waits for the page to load.
79
79
  * @param completely Whether or not to wait for resources to load as well.
80
80
  */
81
- declare function pageLoad(completely: boolean): Promise<void>;
81
+ declare function pageLoad(completely?: boolean): Promise<void>;
82
82
 
83
83
  interface FlagBase {
84
84
  name: string;
package/browser/index.js CHANGED
@@ -48,9 +48,9 @@ else {
48
48
  infoObject = { script: { name: document.title } };
49
49
  }
50
50
  const scriptName = infoObject.script.name;
51
- /** The identifier of the script to be used in logging */
51
+ /** The identifier of the script to be used in logging. */
52
52
  const logId = `[${scriptName}]:`;
53
- /** The initial tab URL on the script run */
53
+ /** The initial tab URL on the script run. */
54
54
  const tabURL = window.location.href;
55
55
 
56
56
  function alert(message) {
@@ -206,7 +206,7 @@ function addStyle(css, parent = document.documentElement) {
206
206
  }
207
207
 
208
208
  /**
209
- * Waits for image to fully load or throws an error if it failed.
209
+ * Waits for image to fully load or throws an error if it fails.
210
210
  */
211
211
  async function imageLoad(img) {
212
212
  return new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeniex/utils",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "author": "JenieX",
5
5
  "homepage": "https://github.com/JenieX/utils",
6
6
  "type": "module",