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 Mar 14, 2024
1 parent c4b59af commit 6c44c21
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 66 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 Mar 14, 2024 2:43 AM UTC.
# Last generated Mar 14, 2024 3:46 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 Mar 14, 2024 2:43 AM UTC.
# Last generated Mar 14, 2024 3:46 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="3rfi+ClkONvfHPiU9FTBcC1+Um/L8QeM9dRw1jFzEqzZXw=="
DOTENV_VAULT_MAIN_VERSION=1

# dev
DOTENV_VAULT_DEV="9iUpKJ+QSVhYYCJkjPwCxlgc18ktd8YPUE8feW14tMxJibUv6eSbNe3SqycXbv5VgC5v0UKEJNj5+AmnVdu5s+BMGTSRCcHZjczGWqBi/CKy1zMmsZSFxA6btAwX2A+IpgAMhzlk7qfblHRJH1PxRaPIACo+yUm/+mloCJnKTY93lX2MYSTc90wnHMr67wgBe88Hf2d0bogNh7HoNkjBX7qF3klYl1DrQXcqeI8dXu7pkvk89FnHt/6bdP4D/W2OLdj5nPtPp2mlzhf82y3YAmR9f0Qn7gxZLtMztMu5ZHuPYMeFQOzQKJl8ouFNFad/bjimxVhOc9Cl4CgmDfbCBT8nNLx9SUrQFg62ZpFOLKyx5ZaSX0Iz69YeAsUmrRAkzbW58Y0wYiCQJaPjgnVGd7bDnGVkG/070XBe59/BN3LlAiSOOxtVem/+g2MhuoUFNt4xG1b+iynwbZ7k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"
DOTENV_VAULT_CI_VERSION=287

# stage
DOTENV_VAULT_STAGE="bfqZYD8oVLWMZ0JR5LICV+sB/btaXavszxZLxTfwSH8U5fg="
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 Mar 14, 2024 2:43 AM UTC.
# Last generated Mar 14, 2024 3:46 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 Mar 14, 2024 2:43 AM UTC.
# Last generated Mar 14, 2024 3:46 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 Mar 14, 2024 2:43 AM UTC.
# Last generated Mar 14, 2024 3:46 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 Mar 14, 2024 2:43 AM UTC.
# Last generated Mar 14, 2024 3:46 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` Mar 14, 2024 2:43 AM UTC.
* Last generated using `./settings.mjs` Mar 14, 2024 3:46 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 Mar 14, 2024 2:43 AM UTC.
# Last generated Mar 14, 2024 3:46 AM UTC.

# Locals

Expand Down
50 changes: 25 additions & 25 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.296",
"version": "1.0.297",
"license": "GPL-3.0-or-later",
"name": "@clevercanyon/utilities.cfw",
"description": "Utilities for JavaScript apps running in a Cloudflare Worker environment.",
Expand Down
44 changes: 18 additions & 26 deletions src/cfw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,26 +374,18 @@ const subrequestCounterProxy = <Type extends object>(target: Type, subrequestCou
if (target === cfw.fetch) {
return subrequestCountryProxyꓺfetch(subrequestCounter) as Type;
}
const targetC9rName = $obj.c9r(target)?.name,
supportedTargetC9rNames = [
'CacheStorage', //
'Cache',
'Fetcher',
'D1Database',
'D1PreparedStatement',
'R2Bucket',
'R2MultipartUpload',
'KvNamespace',
'WorkerQueue',
];
const targetC9rName = $obj.c9r(target)?.name?.toLowerCase(),
supportedTargetC9rNames = ['cachestorage', 'cache', 'fetcher', 'd1database', 'd1preparedstatement', 'r2bucket', 'r2multipartupload', 'kvnamespace', 'workerqueue'];

if (!targetC9rName || !supportedTargetC9rNames.includes(targetC9rName)) {
throw Error('QGySmpVX'); // Unexpected object type.
}
return new Proxy(target, {
get(target: Type, property: $type.ObjectKey, receiver: unknown): unknown {
const value = (target as $type.Keyable)[property];
const value = (target as $type.Keyable)[property],
valueC9rName = $obj.c9r(value)?.name?.toLowerCase();

if ('CacheStorage' === targetC9rName && 'Cache' === $obj.c9r(value)?.name) {
if ('cachestorage' === targetC9rName && 'cache' === valueC9rName) {
return subrequestCounterProxy(value as object, subrequestCounter);
}
if ($is.function(value))
Expand Down Expand Up @@ -487,60 +479,60 @@ const subrequestCountryProxyꓺfetch = <Type extends typeof cfw.fetch>(subreques
*/
const subrequestCounterProxyꓺfnRtnValue = (targetC9rName: string, fnProperty: $type.ObjectKey, fnRtnValue: unknown, subrequestCounter: $type.$cfw.SubrequestCounter): unknown => {
if ($is.object(fnRtnValue)) {
const fnRtnValueC9rName = $obj.c9r(fnRtnValue)?.name;
const fnRtnValueC9rName = $obj.c9r(fnRtnValue)?.name?.toLowerCase();
if (
('CacheStorage' === targetC9rName && 'Cache' === fnRtnValueC9rName) ||
(['D1Database', 'D1PreparedStatement'].includes(targetC9rName) && 'D1PreparedStatement' === fnRtnValueC9rName) ||
('R2Bucket' === targetC9rName && 'R2MultipartUpload' === fnRtnValueC9rName)
('cachestorage' === targetC9rName && 'cache' === fnRtnValueC9rName) ||
(['d1database', 'd1preparedstatement'].includes(targetC9rName) && 'd1preparedstatement' === fnRtnValueC9rName) ||
('r2bucket' === targetC9rName && 'r2multipartupload' === fnRtnValueC9rName)
) {
return subrequestCounterProxy(fnRtnValue, subrequestCounter);
}
}
if ($is.string(fnProperty))
switch (targetC9rName) {
case 'Cache': {
case 'cache': {
if (['put', 'match', 'delete'].includes(fnProperty)) {
subrequestCounter.value++;
}
break;
}
case 'Fetcher': {
case 'fetcher': {
if (['fetch'].includes(fnProperty)) {
subrequestCounter.value++;
}
break;
}
case 'D1Database': {
case 'd1database': {
if (['dump', 'exec', 'batch'].includes(fnProperty)) {
subrequestCounter.value++;
}
break;
}
case 'D1PreparedStatement': {
case 'd1preparedstatement': {
if (['all', 'raw', 'first', 'run'].includes(fnProperty)) {
subrequestCounter.value++;
}
break;
}
case 'R2Bucket': {
case 'r2bucket': {
if (['head', 'get', 'put', 'delete', 'list'].includes(fnProperty)) {
subrequestCounter.value++;
}
break;
}
case 'R2MultipartUpload': {
case 'r2multipartupload': {
if (['uploadPart', 'complete'].includes(fnProperty)) {
subrequestCounter.value++;
}
break;
}
case 'KvNamespace': {
case 'kvnamespace': {
if (['get', 'getWithMetadata', 'list', 'put', 'delete'].includes(fnProperty)) {
subrequestCounter.value++;
}
break;
}
case 'WorkerQueue': {
case 'workerqueue': {
if (['send', 'sendBatch'].includes(fnProperty)) {
subrequestCounter.value++;
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.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 `./tsconfig.mjs`.
*
* Last generated using `./tsconfig.mjs` Mar 14, 2024 2:43 AM UTC.
* Last generated using `./tsconfig.mjs` Mar 14, 2024 3:46 AM UTC.
*/
{
"include": ["./src/**/*", "./dev-types.d.ts"],
Expand Down
2 changes: 1 addition & 1 deletion wrangler.toml
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 `./wrangler.mjs`.
#
# Last generated using `./wrangler.mjs` Mar 14, 2024 2:43 AM UTC.
# Last generated using `./wrangler.mjs` Mar 14, 2024 3:46 AM UTC.
##

send_metrics = false
Expand Down

0 comments on commit 6c44c21

Please sign in to comment.