@danielx/civet 0.2.16 → 0.3.0

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
@@ -15,8 +15,8 @@ Quickstart Guide
15
15
  npm install -g @danielx/civet
16
16
  # Compile civet source file to typescript
17
17
  civet < source.civet > output.ts
18
- # Execute a civet source file in node
19
- node --loader @danielx/civet/register.mjs source.civet
18
+ # Execute a civet source file in node using ts-node
19
+ node --loader ts-node/esm --loader @danielx/civet/esm source.civet
20
20
  ```
21
21
 
22
22
  ![image](https://user-images.githubusercontent.com/18894/184558519-b675a903-7490-43ba-883e-0d8addacd4b9.png)
package/dist/browser.js CHANGED
@@ -4080,6 +4080,7 @@ var Civet = (() => {
4080
4080
  var require_main = __commonJS({
4081
4081
  "source/main.coffee"(exports, module) {
4082
4082
  var SourceMap;
4083
+ var defaultOptions;
4083
4084
  var gen;
4084
4085
  var parse;
4085
4086
  var prune;
@@ -4087,12 +4088,13 @@ var Civet = (() => {
4087
4088
  ({ parse } = require_parser());
4088
4089
  ({ prune } = gen = require_generate());
4089
4090
  ({ SourceMap } = util = require_util());
4091
+ defaultOptions = {};
4090
4092
  module.exports = {
4091
4093
  parse,
4092
- compile: function(src, options) {
4094
+ compile: function(src, options = defaultOptions) {
4093
4095
  var ast, code, sm;
4094
4096
  ast = prune(parse(src, {
4095
- filename: options != null ? options.filename : void 0
4097
+ filename: options.filename
4096
4098
  }));
4097
4099
  if (options.sourceMap) {
4098
4100
  sm = SourceMap(src);