@apify/utilities 2.24.0 → 2.25.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.
package/cjs/index.cjs CHANGED
@@ -75,6 +75,7 @@ __export(index_exports, {
75
75
  markedDecreaseHeadsLevel: () => markedDecreaseHeadsLevel,
76
76
  markedSetNofollowLinks: () => markedSetNofollowLinks,
77
77
  normalizeUrl: () => normalizeUrl,
78
+ parseBooleanOrNull: () => parseBooleanOrNull,
78
79
  parseDateFromJson: () => parseDateFromJson,
79
80
  parseUrl: () => parseUrl,
80
81
  privateDecrypt: () => privateDecrypt,
@@ -428,8 +429,10 @@ var FORBIDDEN_USERNAMES_REGEXPS = [
428
429
  "security\\.txt",
429
430
  // All hidden files
430
431
  "(\\..*)",
431
- // File starting with xxx-
432
+ // Username starting with xxx-
432
433
  "(xxx-.*)",
434
+ // Username starting with install-cli. (see https://docs.apify.com/cli/docs/installation)
435
+ "(install-cli\\..*)",
433
436
  // Strings not starting with letter or number
434
437
  "([^0-9a-z].*)",
435
438
  // Strings not ending with letter or number
@@ -2036,6 +2039,18 @@ async function createStorageContentSignatureAsync({
2036
2039
  return typedArrayToBase64Url(new TextEncoder().encode(`${version}.${expiresAt}.${hmac}`));
2037
2040
  }
2038
2041
  __name(createStorageContentSignatureAsync, "createStorageContentSignatureAsync");
2042
+
2043
+ // src/parse_boolean.ts
2044
+ var parseBooleanOrNull = /* @__PURE__ */ __name((value) => {
2045
+ if (value === true || value === 1) return true;
2046
+ if (value === false || value === 0) return false;
2047
+ if (typeof value === "string") {
2048
+ const lowerValue = value.trim().toLowerCase();
2049
+ if (lowerValue === "true" || lowerValue === "1") return true;
2050
+ if (lowerValue === "false" || lowerValue === "0") return false;
2051
+ }
2052
+ return null;
2053
+ }, "parseBooleanOrNull");
2039
2054
  // Annotate the CommonJS export names for ESM import in node:
2040
2055
  0 && (module.exports = {
2041
2056
  CHECK_TYPES,
@@ -2080,6 +2095,7 @@ __name(createStorageContentSignatureAsync, "createStorageContentSignatureAsync")
2080
2095
  markedDecreaseHeadsLevel,
2081
2096
  markedSetNofollowLinks,
2082
2097
  normalizeUrl,
2098
+ parseBooleanOrNull,
2083
2099
  parseDateFromJson,
2084
2100
  parseUrl,
2085
2101
  privateDecrypt,