Skip to content

Commit 0fe1abc

Browse files
giant formatting pass with prettier.
1 parent 2adaae3 commit 0fe1abc

File tree

11 files changed

+2882
-2537
lines changed

11 files changed

+2882
-2537
lines changed

src/idiomorph-htmx.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
(function(){
2-
function createMorphConfig(swapStyle) {
3-
if (swapStyle === 'morph' || swapStyle === 'morph:outerHTML') {
4-
return {morphStyle: 'outerHTML'}
5-
} else if (swapStyle === 'morph:innerHTML') {
6-
return {morphStyle: 'innerHTML'}
7-
} else if (swapStyle.startsWith("morph:")) {
8-
return Function("return (" + swapStyle.slice(6) + ")")();
9-
}
1+
(function () {
2+
function createMorphConfig(swapStyle) {
3+
if (swapStyle === "morph" || swapStyle === "morph:outerHTML") {
4+
return { morphStyle: "outerHTML" };
5+
} else if (swapStyle === "morph:innerHTML") {
6+
return { morphStyle: "innerHTML" };
7+
} else if (swapStyle.startsWith("morph:")) {
8+
return Function("return (" + swapStyle.slice(6) + ")")();
109
}
10+
}
1111

12-
htmx.defineExtension('morph', {
13-
isInlineSwap: function(swapStyle) {
14-
let config = createMorphConfig(swapStyle);
15-
return config?.morphStyle === "outerHTML" || config?.morphStyle == null;
16-
},
17-
handleSwap: function (swapStyle, target, fragment) {
18-
let config = createMorphConfig(swapStyle);
19-
if (config) {
20-
return Idiomorph.morph(target, fragment.children, config);
21-
}
22-
}
23-
});
24-
})()
12+
htmx.defineExtension("morph", {
13+
isInlineSwap: function (swapStyle) {
14+
let config = createMorphConfig(swapStyle);
15+
return config?.morphStyle === "outerHTML" || config?.morphStyle == null;
16+
},
17+
handleSwap: function (swapStyle, target, fragment) {
18+
let config = createMorphConfig(swapStyle);
19+
if (config) {
20+
return Idiomorph.morph(target, fragment.children, config);
21+
}
22+
},
23+
});
24+
})();

0 commit comments

Comments
 (0)