@mablhq/mabl-cli 2.51.10 → 2.51.12

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.
@@ -69,6 +69,7 @@ const EXPECT_FUNCTIONS = {
69
69
  EndsWith: `satisfy(value => value.endsWith(${EXPECTED_VALUE_TOKEN}))`,
70
70
  MatchesRegExp: `match(${EXPECTED_VALUE_TOKEN})`,
71
71
  };
72
+ const MEDIA_TYPE_TOKEN = "[0-9A-Za-z!#$%&'*+.^_`|~-]+";
72
73
  function compareStringsCaseInsensitive(a, b) {
73
74
  a = a === null || a === void 0 ? void 0 : a.toUpperCase().toLowerCase();
74
75
  b = b === null || b === void 0 ? void 0 : b.toUpperCase().toLowerCase();
@@ -810,21 +811,23 @@ function isSupportedAuthType(authDefinition) {
810
811
  }
811
812
  exports.isSupportedAuthType = isSupportedAuthType;
812
813
  function isJson(contentType) {
813
- return (!!contentType &&
814
- (contentType.startsWith('application/json') ||
815
- contentType.startsWith('application/vnd.api+json')));
814
+ return contentTypeMatches(contentType, (ct) => ct.startsWith('application/json'), (ct) => ct.match(new RegExp(`${MEDIA_TYPE_TOKEN}\/${MEDIA_TYPE_TOKEN}\\+json.*`, 'i')));
816
815
  }
817
816
  exports.isJson = isJson;
818
817
  function isXML(contentType) {
819
- return (!!contentType &&
820
- (contentType.startsWith('application/xml') ||
821
- contentType.startsWith('text/xml')));
818
+ return contentTypeMatches(contentType, (ct) => ct.startsWith('application/xml'), (ct) => ct.startsWith('text/xml'), (ct) => ct.match(new RegExp(`${MEDIA_TYPE_TOKEN}\/${MEDIA_TYPE_TOKEN}\\+xml.*`, 'i')));
822
819
  }
823
820
  exports.isXML = isXML;
824
821
  function isText(contentType) {
825
- return !!contentType && (contentType === null || contentType === void 0 ? void 0 : contentType.startsWith('text/'));
822
+ return contentTypeMatches(contentType, (ct) => ct.startsWith('text/'));
826
823
  }
827
824
  exports.isText = isText;
825
+ function contentTypeMatches(contentType, ...predicates) {
826
+ if (!contentType) {
827
+ return false;
828
+ }
829
+ return predicates.some((predicate) => predicate(contentType));
830
+ }
828
831
  function getFormDataArray(item) {
829
832
  var _a, _b, _c;
830
833
  if (getRequestMode(item) === 'formdata') {