@danielx/civet 0.4.20 → 0.4.21

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.
Files changed (4) hide show
  1. package/README.md +16 -13
  2. package/dist/browser.js +600 -505
  3. package/dist/main.js +600 -505
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -90,7 +90,9 @@ Things Kept from CoffeeScript
90
90
  - Simplified number method calls `1.toFixed()` -> `1..toFixed()`
91
91
  - `if`/`switch`/`for`/`loop`/`while`/`throw` expressions
92
92
  - Destructuring object assignment doesn't require being wrapped in parens at the statement level `{a, b} = c` -> `({a, b} = c)`
93
- - Prefix or postfix splats `[...a]`, `x = [a...]`
93
+ - Prefix or postfix rest/splats `[...a]`, `x = [a...]`
94
+ - RestProperty in any position `{a, ...b, c} = d` -> `{a, c, ...b} = d`
95
+ - RestElement/RestParameter in any position `(first, ...midle, last) ->` -> `function(first, ...middle) { let [last] = middle.splice(-1)}`
94
96
  - `///` Heregexp
95
97
  - With some [changes](#things-changed-from-coffeescript).
96
98
  - JSX 😿
@@ -239,18 +241,19 @@ CoffeeScript Compatibility
239
241
 
240
242
  Civet provides a compatability prologue directive that aims to be 97+% compatible with existing CoffeeScript2 code (still a work in progress).
241
243
 
242
- ```
243
- autoVar (declare implicit vars based on assignment to undeclared identifiers)
244
- coffeeBooleans (yes/no/on/off)
245
- coffeeComment (# single line comments)
246
- coffeeDo ( `do ->`, disables ES6 do/while)
247
- coffeeEq (`==` -> `===`, `!=` -> `!==`)
248
- coffeeForLoops (for in, of, from loops behave like they do in CoffeeScript)
249
- coffeeInterpolation (`"a string with #{myVar}"`)
250
- coffeeIsnt (`isnt` -> `!==`)
251
- coffeeNot (`not` -> "!") (currently doesn't support `not instanceof`, `not of`)
252
- coffeeOf (`a of b` -> `a in b`, `a in b` -> `b.indexOf(a) >= 0`, `a not in b` -> `b.indexOf(a) < 0`)
253
- ```
244
+ | Configuration | What it enables |
245
+ |---------------------|---------------------------------------------------------------------|
246
+ | autoVar | declare implicit vars based on assignment to undeclared identifiers |
247
+ | coffeeBooleans | `yes`, `no`, `on`, `off` |
248
+ | coffeeComment | `# single line comments` |
249
+ | coffeeDo | `do ->`, disables ES6 do/while |
250
+ | coffeeEq | `==` -> `===`, `!=` -> `!==` |
251
+ | coffeeForLoops | for in, of, from loops behave like they do in CoffeeScript |
252
+ | coffeeInterpolation | `"a string with #{myVar}"` |
253
+ | coffeeIsnt | `isnt` -> `!==` |
254
+ | coffeeNot | `not` -> `!`, `a not instanceof b` -> `!(a instanceof b)`; `not of` is not yet supported |
255
+ | coffeeOf | `a of b` -> `a in b`, `a in b` -> `b.indexOf(a) >= 0`, `a not in b` -> `b.indexOf(a) < 0` |
256
+
254
257
 
255
258
  You can use these with `"civet coffeeCompat"` to opt in to all or use them bit by bit with `"civet coffeeComment coffeeEq coffeeInterpolation"`.
256
259
  Another possibility is to slowly remove them to provide a way to migrate files a little at a time `"civet coffeeCompat -coffeeBooleans -coffeeComment -coffeeEq"`.