arkregex 0.0.1 → 0.0.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.
package/README.md CHANGED
@@ -40,10 +40,10 @@ We've tried to strike a balance between performance and precision while guarante
40
40
 
41
41
  If your expression is especially long or complex, TypeScript won't be able to infer it.
42
42
 
43
- If your types start to slow down or you see the dreaded `Type is excessively deep...`, you can manually type your expression using `regex.cast`:
43
+ If your types start to slow down or you see the dreaded `Type is excessively deep...`, you can manually type your expression using `regex.as`:
44
44
 
45
45
  ```ts
46
- const complexPattern = regex.cast<`pattern-${string}`, { captures: [string] }>(
46
+ const complexPattern = regex.as<`pattern-${string}`, { captures: [string] }>(
47
47
  "very-long-complex-expression-here"
48
48
  )
49
49
  ```
package/out/regex.d.ts CHANGED
@@ -26,7 +26,7 @@ export interface Regex<out pattern extends string = string, out ctx extends Rege
26
26
  }
27
27
  export interface RegexParser {
28
28
  <src extends string, flags extends Flags = "">(src: regex.validate<src, flags>, flags?: flags): regex.parse<src, flags>;
29
- cast: <pattern extends string = string, ctx extends RegexContext = {}>(src: string, flags?: Flags) => Regex<pattern, ctx>;
29
+ as: <pattern extends string = string, ctx extends RegexContext = {}>(src: string, flags?: Flags) => Regex<pattern, ctx>;
30
30
  }
31
31
  export declare const regex: RegexParser;
32
32
  export type regex<pattern extends string = string, ctx extends RegexContext = RegexContext> = Regex<pattern, ctx>;
package/out/regex.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const regex = ((src, flags) => new RegExp(src, flags));
2
- Object.assign(regex, { cast: regex });
2
+ Object.assign(regex, { as: regex });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arkregex",
3
3
  "description": "A drop-in replacement for new RegExp() with types",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "David Blass",
@@ -29,7 +29,7 @@
29
29
  "out"
30
30
  ],
31
31
  "dependencies": {
32
- "@ark/util": "0.52.0"
32
+ "@ark/util": "0.53.0"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"