@danielx/civet 0.2.14 → 0.2.15

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/dist/main.js CHANGED
@@ -938,7 +938,9 @@ var require_parser = __commonJS({
938
938
  }
939
939
  }
940
940
  var UnaryPostfix$0 = $EXPECT($L3, fail, 'UnaryPostfix "?"');
941
- var UnaryPostfix$1 = $S(__, $EXPECT($L4, fail, 'UnaryPostfix "as"'), NonIdContinue, Type);
941
+ var UnaryPostfix$1 = $T($S(__, $EXPECT($L4, fail, 'UnaryPostfix "as"'), NonIdContinue, Type), function(value) {
942
+ return { "ts": true, "children": value };
943
+ });
942
944
  function UnaryPostfix(state) {
943
945
  if (state.tokenize) {
944
946
  return $TOKEN("UnaryPostfix", state, UnaryPostfix$0(state) || UnaryPostfix$1(state));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "CoffeeScript style syntax for TypeScript",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/types.d.ts",
package/register.mjs CHANGED
@@ -7,23 +7,24 @@ const baseURL = pathToFileURL(process.cwd() + '/').href;
7
7
 
8
8
  const extensionsRegex = /\.civet$/;
9
9
 
10
- export async function resolve(specifier, context, defaultResolve) {
10
+ export async function resolve(specifier, context, next) {
11
11
  const { parentURL = baseURL } = context;
12
12
 
13
13
  if (extensionsRegex.test(specifier)) {
14
14
  return {
15
- format: "civet",
15
+ shortCircuit: true,
16
+ format: "module",
16
17
  url: new URL(specifier, parentURL).href,
17
18
  };
18
19
  }
19
20
 
20
21
  // Let Node.js handle all other specifiers.
21
- return defaultResolve(specifier, context, defaultResolve);
22
+ return next(specifier, context);
22
23
  }
23
24
 
24
- export async function load(url, context, defaultLoad) {
25
+ export async function load(url, context, next) {
25
26
  if (extensionsRegex.test(url)) {
26
- const { source: rawSource } = await defaultLoad(url, { format: "civet" });
27
+ const { source: rawSource } = await next(url, { format: "module" });
27
28
 
28
29
  return {
29
30
  format: "module",
@@ -32,7 +33,7 @@ export async function load(url, context, defaultLoad) {
32
33
  }
33
34
 
34
35
  // Let Node.js handle all other URLs.
35
- return defaultLoad(url, context, defaultLoad);
36
+ return next(url, context);
36
37
  }
37
38
 
38
39
  // Also transform CommonJS files.