Skip to content

Commit

Permalink
Project update. [p][robotic]
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswrks committed Apr 12, 2024
1 parent 25f1d4a commit e8f409b
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 11:08 AM UTC.
# Last generated Apr 12, 2024 12:20 AM UTC.

[production]
node >= 20.9.0
Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 11:08 AM UTC.
# Last generated Apr 12, 2024 12:20 AM UTC.

# Locals

Expand Down
8 changes: 4 additions & 4 deletions .env.vault
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ DOTENV_VAULT_MAIN="7GW98NfL4hM4N6HbfeDXCKreVxKvcVPupFRnZ8XJ+pomaQ=="
DOTENV_VAULT_MAIN_VERSION=1

# dev
DOTENV_VAULT_DEV="X+sBdBmkwgJE/a/hzf6jSJu91xivh5yPbDNjPHIN3kUWGKlzjbWh6bKCNmzpT2sC0owFgZ/R7R4f3mwgWHfg9Xf+zwEaMek24/V551CUyid79ysq7xOse2yFkelm9SsscG+ML6zHHAYv1Cw7alr4zvmXMgyl6U+B9BgM2DA+tLHMJpQApUp+3yNSWSUp/Wf3UBysI/femwWj72pU/VGo/fHtBQ0IdiWYQXXzpYbZWEt4/M3AogkMahPEEiNXEQPl2g=="
DOTENV_VAULT_DEV_VERSION=541
DOTENV_VAULT_DEV="nQmAGkQBrA0LJ6//jfhUoXrjBO7oNohwaU8qDw2eSW1tjVyt86be1LqAG7kLceYuc55x5geqwbfOX8IMZrt1ULiiTcRYLSRXUItObBmlpSv+muLpGgbqmmH5qa2Enag9zCwyRIPDx5Bc2346as+PyZIyweeHWY2qVvoGQUfGOoz6tXClyO3xJNrTlCMj/8tNP2q8HLFl244Gmzh8r9VibplUAvA65J/aha+t8rQpSL3v0uQq6Sty/HqO4DzTO9olwA=="
DOTENV_VAULT_DEV_VERSION=543

# ci
DOTENV_VAULT_CI="vnrCPcwxExEIa5nOZsOGKL4xAg7nw4caLK2cbtUxo6WoFNfpONcC13+AY10qCZJAjori3/GB32FQwQbYx5k76SJow7i6cuFXLQ2Ww3S2Ahcr98jeCA19ssjFZ+gDll77ErMrsgBr+3loK95alJvHaDTgKTeICEpxw4p+qBk7vA=="
DOTENV_VAULT_CI_VERSION=541
DOTENV_VAULT_CI="KMYgM4Bd+iN2msYMa/wX6ydZY+CSjemRuiFliQBhQHJh6mswo47Wa4V7mbcs0UVkpHAfDrH0WuLw+lYVEMlKH6mQN2k/iq1GG7iLgkdJw+ADaZknJPrHAL9hZxYv2E32MMiP3A3a/VMGApyztwfveRgFxHsSNKfDZxz7cWzlAw=="
DOTENV_VAULT_CI_VERSION=543

# stage
DOTENV_VAULT_STAGE="aRP8su2YV4jZu3w1HZ/SLaots0IwJDFw75TCpvXEFeNp7tw="
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 11:08 AM UTC.
# Last generated Apr 12, 2024 12:20 AM UTC.

# Default

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 11:08 AM UTC.
# Last generated Apr 12, 2024 12:20 AM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 11:08 AM UTC.
# Last generated Apr 12, 2024 12:20 AM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 11:08 AM UTC.
# Last generated Apr 12, 2024 12:20 AM UTC.

# Packages

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @note This entire file will be updated automatically.
* @note Instead of editing here, please review `./settings.mjs`.
*
* Last generated using `./settings.mjs` Apr 11, 2024 11:08 AM UTC.
* Last generated using `./settings.mjs` Apr 12, 2024 12:20 AM UTC.
*/
{
"editor.formatOnType": false,
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 11:08 AM UTC.
# Last generated Apr 12, 2024 12:20 AM UTC.

# Locals

Expand Down
80 changes: 40 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "1.0.957",
"version": "1.0.958",
"license": "GPL-3.0-or-later",
"name": "@clevercanyon/utilities",
"description": "Utilities for JavaScript apps running in any environment.",
Expand Down
22 changes: 11 additions & 11 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,33 +413,33 @@ export const requestPathIsSEORelatedFile = $fnꓺmemo(2, (request: $type.Request
});

/**
* Request path is in an admin area?
* Request path is in an account area?
*
* @param request HTTP request.
* @param url Optional pre-parsed URL. Default is taken from `request`.
*
* @returns True if request path is in an admin area.
* @returns True if request path is in an account area.
*/
export const requestPathIsInAdmin = $fnꓺmemo(2, (request: $type.Request, _url?: $type.URL): boolean => {
export const requestPathIsInAccount = $fnꓺmemo(2, (request: $type.Request, _url?: $type.URL): boolean => {
const url = _url || $url.parse(request.url);
if ('/' === url.pathname) return false;

return /\/(?:[^/]+[-_])?admin(?:[-_][^/]+)?(?:$|\/)/iu.test(url.pathname);
return /\/(?:[^/]+[-_])?account(?:[-_][^/]+)?(?:$|\/)/iu.test(url.pathname);
});

/**
* Request path is in an account area?
* Request path is in an admin area?
*
* @param request HTTP request.
* @param url Optional pre-parsed URL. Default is taken from `request`.
*
* @returns True if request path is in an account area.
* @returns True if request path is in an admin area.
*/
export const requestPathIsInAccount = $fnꓺmemo(2, (request: $type.Request, _url?: $type.URL): boolean => {
export const requestPathIsInAdmin = $fnꓺmemo(2, (request: $type.Request, _url?: $type.URL): boolean => {
const url = _url || $url.parse(request.url);
if ('/' === url.pathname) return false;

return /\/(?:[^/]+[-_])?account(?:[-_][^/]+)?(?:$|\/)/iu.test(url.pathname);
return /\/(?:[^/]+[-_])?admin(?:[-_][^/]+)?(?:$|\/)/iu.test(url.pathname);
});

/**
Expand Down Expand Up @@ -760,8 +760,8 @@ const prepareResponseHeaders = async (request: $type.Request, url: $type.URL, cf
if (
'none' === cfg.cacheVersion ||
!requestHasCacheableMethod(request) ||
requestPathIsInAdmin(request, url) ||
requestPathIsInAccount(request, url) ||
requestPathIsInAdmin(request, url) ||
(!cfg.cacheUsers && requestIsFromUser(request))
) {
sMaxAge = 0; // No server-side cache.
Expand Down Expand Up @@ -801,10 +801,10 @@ const prepareResponseHeaders = async (request: $type.Request, url: $type.URL, cf
} else if (requestPathIsStatic(request, url)) {
cacheControl($time.yearInSeconds);
//
} else if (requestPathIsInAdmin(request, url)) {
} else if (requestPathIsInAccount(request, url)) {
cacheControl(0); // Do not cache.
//
} else if (requestPathIsInAccount(request, url)) {
} else if (requestPathIsInAdmin(request, url)) {
cacheControl(0); // Do not cache.
//
} else if (!cfg.cacheUsers && requestIsFromUser(request)) {
Expand Down
Loading

0 comments on commit e8f409b

Please sign in to comment.