Skip to content

Commit 512cfee

Browse files
🎨 refactor: Use flat export style and arrow functions.
1 parent 7247cc2 commit 512cfee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+243
-226
lines changed

src/bool/and.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export function and(a, b) {
2-
return a && b;
3-
}
1+
const and = (a, b) => a && b;
2+
export default and;

src/bool/index.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/bool/not.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export function not(obj) {
2-
return !obj;
3-
}
1+
const not = (x) => !x;
2+
export default not;

src/bool/or.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export function or(a, b) {
2-
return a || b;
3-
}
1+
const or = (a, b) => a || b;
2+
export default or;

src/bool/xor.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export function xor(a, b) {
2-
return (a || b) && !(a && b);
3-
}
1+
const xor = (a, b) => (a || b) && !(a && b);
2+
export default xor;

src/cast/_index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/cast/identity.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export function identity(obj) {
2-
return obj;
3-
}
1+
const identity = (x) => x;
2+
export default identity;

src/cast/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export * from './_index.js';
2-
export * from './identity.js';
3-
export * from './truth.js';
1+
const index = (x) => ~~x;
2+
export default index;

src/cast/truth.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export function truth(obj) {
2-
return Boolean(obj);
3-
}
1+
const truth = (x) => Boolean(x);
2+
export default truth;

src/fn/index.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)