-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #31. Add CoffeeScript support.
- Loading branch information
Showing
5 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
hello derek how is it going? | ||
for c, i in "Hello World!" | ||
k = 1+1- 2>=3<= 4>5 <6 | ||
|
||
for c, i in "Hello World" | ||
k = (a,b)-> if b? return a | ||
|
||
f = b()[0] | ||
for c, i in "Hello World" | ||
f(b()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
|
||
var CF = require('coffee-formatter'); | ||
module.exports = function (text, options, callback) { | ||
var lines = text.split('\n'); | ||
var resultArr = []; | ||
for (var i = 0, len = lines.length; i < len; i++) { | ||
var curr = lines[i]; | ||
var p = CF.formatTwoSpaceOperator(curr); | ||
p = CF.formatOneSpaceOperator(p); | ||
p = CF.shortenSpaces(p); | ||
resultArr.push(p); | ||
} | ||
var result = resultArr.join('\n'); | ||
callback(result); | ||
return result; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters