@purescraps/purehtml 0.4.4 → 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.
@@ -6677,6 +6677,25 @@ var HTMLTransformer = class extends Transformer {
6677
6677
  }
6678
6678
  };
6679
6679
 
6680
+ // src/transformers/json.ts
6681
+ var JSONTransformer = class extends Transformer {
6682
+ static getName() {
6683
+ return "json";
6684
+ }
6685
+ inputType() {
6686
+ return STRING;
6687
+ }
6688
+ outputType() {
6689
+ return STRING;
6690
+ }
6691
+ transform({ $el }) {
6692
+ if (!$el) {
6693
+ return null;
6694
+ }
6695
+ return JSON.parse($el.text());
6696
+ }
6697
+ };
6698
+
6680
6699
  // src/errors/invalid-parse-input-error.ts
6681
6700
  var InvalidParseInputError = class extends Error {
6682
6701
  constructor(property, message) {
@@ -6827,6 +6846,7 @@ var Transformers = class {
6827
6846
  AttributeTransformer,
6828
6847
  Exists,
6829
6848
  HTMLTransformer,
6849
+ JSONTransformer,
6830
6850
  Length,
6831
6851
  NumberTransformer,
6832
6852
  ResolveTransformer,