@aiquants/html-to-markdown 0.4.0 → 0.5.0

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.
@@ -5,7 +5,7 @@ Object.assign(global, {
5
5
  window,
6
6
  self: window
7
7
  });
8
- import { b as getDefaultExportFromCjs } from "./core-CouDTni-.js";
8
+ import { b as getDefaultExportFromCjs } from "./core-DJV8t_Qj.js";
9
9
  import { promises } from "fs";
10
10
  import { resolve, dirname } from "path";
11
11
  import { readFileSync } from "node:fs";
@@ -11297,7 +11297,7 @@ function parseHtmlToMarkdownArgs(args) {
11297
11297
  throw new Error("Arguments are required");
11298
11298
  }
11299
11299
  const { url, html_content, locale = "en-US" } = args;
11300
- if (!url && !html_content) {
11300
+ if (!(url || html_content)) {
11301
11301
  throw new Error("Either 'url' or 'html_content' is required");
11302
11302
  }
11303
11303
  if (url && typeof url !== "string") {
@@ -11323,7 +11323,7 @@ function parseSaveContentArgs(args) {
11323
11323
  if (!content || typeof content !== "string") {
11324
11324
  throw new Error("'content' is required and must be a string");
11325
11325
  }
11326
- if (!save_path && !save_directory) {
11326
+ if (!(save_path || save_directory)) {
11327
11327
  throw new Error("Either 'save_path' or 'save_directory' is required");
11328
11328
  }
11329
11329
  if (save_path && typeof save_path !== "string") {
@@ -11350,7 +11350,7 @@ function parseUrlToMarkdownFileArgs(args) {
11350
11350
  throw new Error("Arguments are required");
11351
11351
  }
11352
11352
  const { url, html_content, locale = "en-US", save_path, save_directory, filename } = args;
11353
- if (!url && !html_content) {
11353
+ if (!(url || html_content)) {
11354
11354
  throw new Error("Either 'url' or 'html_content' is required");
11355
11355
  }
11356
11356
  if (url && typeof url !== "string") {
@@ -11362,7 +11362,7 @@ function parseUrlToMarkdownFileArgs(args) {
11362
11362
  if (locale && !["en-US", "ja-JP"].includes(locale)) {
11363
11363
  throw new Error("'locale' must be 'en-US' or 'ja-JP'");
11364
11364
  }
11365
- if (!save_path && !save_directory) {
11365
+ if (!(save_path || save_directory)) {
11366
11366
  throw new Error("Either 'save_path' or 'save_directory' is required");
11367
11367
  }
11368
11368
  if (save_path && typeof save_path !== "string") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/html-to-markdown",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "HTML to Markdown converter",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",