add amd module formatter #82
This commit is contained in:
11
test/fixtures/syntax/modules-amd/hoist-function-exports/actual.js
vendored
Normal file
11
test/fixtures/syntax/modules-amd/hoist-function-exports/actual.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { isEven } from "./evens";
|
||||
|
||||
export function nextOdd(n) {
|
||||
return isEven(n) ? n + 1 : n + 2;
|
||||
}
|
||||
|
||||
export var isOdd = (function(isEven) {
|
||||
return function(n) {
|
||||
return !isEven(n);
|
||||
};
|
||||
})(isEven);
|
||||
22
test/fixtures/syntax/modules-amd/hoist-function-exports/expected.js
vendored
Normal file
22
test/fixtures/syntax/modules-amd/hoist-function-exports/expected.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
define(["./evens"], function (_evens) {
|
||||
var exports = {};
|
||||
|
||||
exports.nextOdd = nextOdd;
|
||||
var isEven = _evens.isEven;
|
||||
|
||||
function nextOdd(n) {
|
||||
return (isEven(n) ? n + 1 : n + 2);
|
||||
}
|
||||
|
||||
var isOdd = function(isEven) {
|
||||
return function(n) {
|
||||
return !isEven(n);
|
||||
};
|
||||
}(isEven);
|
||||
|
||||
exports.isOdd = isOdd;
|
||||
|
||||
return exports;
|
||||
});
|
||||
Reference in New Issue
Block a user