function parseStrictInteger(value) {
  if (typeof value === "number") {
    return Number.isInteger(value) ? value : null;
  }
  if (typeof value === "string") {
    const trimmed = value.trim();
    if (!/^-?\d+$/.test(trimmed)) {
      return null;
    }
    const parsed = Number(trimmed);
    return Number.isSafeInteger(parsed) ? parsed : null;
  }
  return null;
}
function parseNullablePositiveInt(value) {
  if (value === null || value === void 0) {
    return { valid: true, value: null };
  }
  if (typeof value === "string") {
    const trimmed = value.trim();
    if (trimmed === "" || trimmed.toLowerCase() === "null") {
      return { valid: true, value: null };
    }
  }
  const parsed = parseStrictInteger(value);
  if (parsed === null || parsed <= 0) {
    return { valid: false, value: null };
  }
  return { valid: true, value: parsed };
}
function parsePositiveInt(value) {
  const parsed = parseStrictInteger(value);
  if (parsed === null || parsed <= 0) {
    return null;
  }
  return parsed;
}

export { parsePositiveInt as a, parseNullablePositiveInt as p };
//# sourceMappingURL=ids.mjs.map
