fastly.js 0.9.1 → 0.9.2

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.
@@ -112,7 +112,7 @@ export interface VCLContext {
112
112
  ip: string;
113
113
  };
114
114
  re?: {
115
- groups?: Record<number, string>;
115
+ groups?: Record<string, string>;
116
116
  };
117
117
  platform: VCLPlatform;
118
118
  locals: Record<string, any>;
@@ -495,11 +495,6 @@ export declare class VCLCompiler {
495
495
  private evaluateBinaryExpression;
496
496
  /**
497
497
  * Equality for the == and != operators.
498
- * A STRING left operand drives the comparison: the right side is
499
- * stringified per its VCL type and compared byte-wise, matching how
500
- * Fastly compiles string equality to VRT_strcmp with the right operand
501
- * rendered through the type's to-string conversion.
502
- * NOTSET values compare using their display string "(null)".
503
498
  */
504
499
  private vclEquals;
505
500
  private regexMatch;
@@ -0,0 +1,14 @@
1
+ /** Turns a string into its UTF-8 bytes, one byte per char. */
2
+ export declare function toBytes(s: string): string;
3
+ /**
4
+ * Turns a byte string back into text.
5
+ * A match can split a multi-byte character, and the broken part becomes U+FFFD.
6
+ */
7
+ export declare function fromBytes(s: string): string;
8
+ /**
9
+ * Compiles a VCL regex into a JavaScript one, to run on toBytes() of the subject.
10
+ * Throws on syntax we can't translate, like atomic groups, possessive quantifiers or \K.
11
+ *
12
+ * Compiled regexes are shared, so reset lastIndex before using a global one.
13
+ */
14
+ export declare function compileRegex(pattern: string, flags?: "" | "g"): RegExp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastly.js",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "A reimplementation of the Fastly platform in TypeScript: parse and execute Fastly VCL locally, with the full request pipeline, caching, ESI, and the VCL standard library.",
5
5
  "author": "Frank Denis <github@pureftpd.org>",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "dist"
42
42
  ],
43
43
  "engines": {
44
- "node": ">=18"
44
+ "node": ">=20.19"
45
45
  },
46
46
  "scripts": {
47
47
  "start": "bun run index.ts",
@@ -74,17 +74,17 @@
74
74
  "typecheck": "tsc --noEmit"
75
75
  },
76
76
  "devDependencies": {
77
- "@biomejs/biome": "^2.4.6",
78
- "@types/bun": "^1.3.10",
77
+ "@biomejs/biome": "^2.6.8",
78
+ "@types/bun": "^1.4.4",
79
79
  "@types/chai": "^5.2.3",
80
- "chai": "^6.2.2",
81
- "typescript": "^5.9.3"
80
+ "chai": "^6.3.0",
81
+ "typescript": "^7.0.2"
82
82
  },
83
83
  "dependencies": {
84
- "@noble/ciphers": "^2.2.0",
85
- "@noble/hashes": "^2.2.0",
84
+ "@noble/ciphers": "^2.4.0",
85
+ "@noble/hashes": "^2.4.0",
86
86
  "buffer": "^6.0.3",
87
87
  "js-xxhash": "^5.0.1",
88
- "uuid": "^13.0.0"
88
+ "uuid": "^14.0.3"
89
89
  }
90
90
  }