codigo0/node_modules/tough-cookie/dist/index.cjs.map

1 line
211 KiB
Plaintext
Raw Normal View History

{"version":3,"sources":["../lib/cookie/index.ts","../lib/pathMatch.ts","../lib/getPublicSuffix.ts","../lib/permuteDomain.ts","../lib/store.ts","../lib/utils.ts","../lib/memstore.ts","../lib/validators.ts","../lib/version.ts","../lib/cookie/constants.ts","../lib/cookie/canonicalDomain.ts","../lib/cookie/formatDate.ts","../lib/cookie/parseDate.ts","../lib/cookie/cookie.ts","../lib/cookie/cookieCompare.ts","../lib/cookie/defaultPath.ts","../lib/cookie/domainMatch.ts","../lib/cookie/secureContext.ts","../lib/cookie/cookieJar.ts","../lib/cookie/permutePath.ts"],"sourcesContent":["export { MemoryCookieStore, type MemoryCookieStoreIndex } from '../memstore.js'\nexport { pathMatch } from '../pathMatch.js'\nexport { permuteDomain } from '../permuteDomain.js'\nexport {\n getPublicSuffix,\n type GetPublicSuffixOptions,\n} from '../getPublicSuffix.js'\nexport { Store } from '../store.js'\nexport { ParameterError } from '../validators.js'\nexport { version } from '../version.js'\nexport { type Callback, type ErrorCallback, type Nullable } from '../utils.js'\nexport { canonicalDomain } from './canonicalDomain.js'\nexport {\n PrefixSecurityEnum,\n type SerializedCookie,\n type SerializedCookieJar,\n} from './constants.js'\nexport {\n Cookie,\n type CreateCookieOptions,\n type ParseCookieOptions,\n} from './cookie.js'\nexport { cookieCompare } from './cookieCompare.js'\nexport {\n CookieJar,\n type CreateCookieJarOptions,\n type GetCookiesOptions,\n type SetCookieOptions,\n} from './cookieJar.js'\nexport { defaultPath } from './defaultPath.js'\nexport { domainMatch } from './domainMatch.js'\nexport { formatDate } from './formatDate.js'\nexport { parseDate } from './parseDate.js'\nexport { permutePath } from './permutePath.js'\n\nimport { Cookie, ParseCookieOptions } from './cookie.js'\n\n/**\n * {@inheritDoc Cookie.parse}\n * @public\n */\nexport function parse(\n str: string,\n options?: ParseCookieOptions,\n): Cookie | undefined {\n return Cookie.parse(str, options)\n}\n\n/**\n * {@inheritDoc Cookie.fromJSON}\n * @public\n */\nexport function fromJSON(str: unknown): Cookie | undefined {\n return Cookie.fromJSON(str)\n}\n","/**\n * Answers \"does the request-path path-match a given cookie-path?\" as per {@link https://www.rfc-editor.org/rfc/rfc6265.html#section-5.1.4 | RFC6265 Section 5.1.4}.\n * This is essentially a prefix-match where cookiePath is a prefix of reqPath.\n *\n * @remarks\n * A request-path path-matches a given cookie-path if at least one of\n * the following conditions holds:\n *\n * - The cookie-path and the request-path are identical.\n * - The cookie-path is a prefix of the request-path, and the last character of the cookie-path is %x2F (\"/\").\n * - The cookie-path is a prefix of the request-path, and the first character of the request-path that is not included in the cookie-path is a %x2F (\"/\") character.\n *\n * @param reqPath - the path of the request\n * @param cookiePath - the path of the cookie\n * @public\n */\nexport function pathMatch(reqPath: string, cookiePath: string): boolean {\n // \"o The cookie-path and the request-path are identical.\"\n if (cookiePath === reqPath) {\n return true\n }\n\n const idx = reqPath.indexOf(cookiePath)\n if (idx === 0) {\n // \"o The cookie-path is a prefix of the request-path, and the last\n // character of the cookie-path is %x2F (\"/\").\"\n if (cookiePath[cookiePath.length - 1] === '/') {\n return true\n }\n\n // \" o The cookie-path is a prefix of the request-path, and the first\n // character of the request-path that is not included in the cookie- path\n // is a %x2F (\"/\") character.\"\n if (reqPath.startsWith(cookiePath) && reqPath[cookiePath.length] === '/') {\n return true\n }\n }\n\n return false\n}\n","import { getDomain } from 'tldts'\n\n// RFC 6761\nconst SPECIAL_USE_DOMAINS = ['local', 'example', 'invalid', 'localhost', 'test']\n\nconst SPECIAL_TREATMENT_DOMAINS = ['localhost', 'invalid']\n\n/**\n * Options for configuring how {@link getPublicSuffix} behaves.\n * @public\n */\nexport inte