@purescraps/purehtml 0.1.6 → 0.3.1

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.
@@ -12,7 +12,7 @@ declare abstract class Config<T = unknown> {
12
12
  }
13
13
 
14
14
  declare class ConfigFactory {
15
- static fromYAML(yaml: string): Config;
15
+ static fromYAML<T>(yaml: string): Config<T>;
16
16
  private static generate;
17
17
  private static generateSelector;
18
18
  private static generateTransform;
@@ -21,4 +21,4 @@ declare class ConfigFactory {
21
21
 
22
22
  declare function extract<T = unknown>($: cheerio.Root | string, config: Config<T>, url: string): T;
23
23
 
24
- export { ConfigFactory, extract };
24
+ export { Config, ConfigFactory, extract };
package/dist/src/index.js CHANGED
@@ -6785,6 +6785,7 @@ var require_ajv = __commonJS({
6785
6785
  // src/index.ts
6786
6786
  var src_exports = {};
6787
6787
  __export(src_exports, {
6788
+ Config: () => Config,
6788
6789
  ConfigFactory: () => ConfigFactory,
6789
6790
  extract: () => extract
6790
6791
  });
@@ -6815,6 +6816,9 @@ var ConfigWithSelector = class extends Config {
6815
6816
  if (this.selector === null) {
6816
6817
  return $;
6817
6818
  }
6819
+ if ($.is(this.selector)) {
6820
+ return $;
6821
+ }
6818
6822
  return $.find(this.selector);
6819
6823
  }
6820
6824
  };
@@ -7505,7 +7509,9 @@ var ConfigFactory = class _ConfigFactory {
7505
7509
  transform
7506
7510
  );
7507
7511
  case "union":
7508
- return UnionConfig.generate(union.map((cfg) => this.generate(cfg)));
7512
+ return UnionConfig.generate(
7513
+ union.map((cfg) => this.generate(cfg))
7514
+ );
7509
7515
  default:
7510
7516
  return PrimitiveValueConfig.generate(selector, transform);
7511
7517
  }
@@ -7571,6 +7577,7 @@ function extract($, config, url) {
7571
7577
  }
7572
7578
  // Annotate the CommonJS export names for ESM import in node:
7573
7579
  0 && (module.exports = {
7580
+ Config,
7574
7581
  ConfigFactory,
7575
7582
  extract
7576
7583
  });