-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. class-properties\n2. partial-applicatio\n3. private-methods
- Loading branch information
Showing
19 changed files
with
169 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
coverage | ||
node_modules | ||
/index.js | ||
# Babel parse issue, ignore temporarily | ||
test/private-methods.ts |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
coverage | ||
node_modules | ||
CHANGELOG.md | ||
# Not supported by Prettier yet | ||
test/partial-application.ts |
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
const config = require('@1stg/prettier-config') | ||
|
||
module.exports = Object.assign({}, config, { | ||
overrides: config.overrides.concat({ | ||
files: '*.ts', | ||
options: { | ||
parser: 'babel', | ||
module.exports = { | ||
...config, | ||
overrides: [ | ||
...config.overrides, | ||
{ | ||
files: '*.ts', | ||
options: { | ||
parser: 'babel', | ||
}, | ||
}, | ||
}), | ||
}) | ||
], | ||
} |
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
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,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`class-properties 1`] = `"Unexpected token ;"`; |
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,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`partial-application 1`] = `"addOne is not a function"`; |
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,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`private-methods 1`] = `"Unexpected token ;"`; |
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,11 @@ | ||
import { Counter } from './class-properties' | ||
import { execute } from './helpers' | ||
|
||
const proposal = 'class-properties' | ||
|
||
test(proposal, () => { | ||
expect(() => execute(proposal)).toThrowErrorMatchingSnapshot() | ||
const counter = new Counter() | ||
expect(counter.getCount()).toEqual(0) | ||
expect(counter.increment().getCount()).toEqual(1) | ||
}) |
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,12 @@ | ||
export class Counter { | ||
#x = 0 | ||
|
||
increment() { | ||
this.#x++ | ||
return this | ||
} | ||
|
||
getCount() { | ||
return this.#x | ||
} | ||
} |
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,9 @@ | ||
import _ from './partial-application' | ||
import { execute } from './helpers' | ||
|
||
const proposal = 'partial-application' | ||
|
||
test(proposal, () => { | ||
expect(() => execute(proposal)).toThrowErrorMatchingSnapshot() | ||
expect(_()).toEqual([3, 12]) | ||
}) |
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,7 @@ | ||
function add(x, y) { return x + y; } | ||
|
||
export default () => { | ||
const addOne = add(1, ?); | ||
const addTen = add(?, 10); | ||
return [addOne(2), addTen(2)] | ||
} |
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,11 @@ | ||
import { Counter } from './private-methods' | ||
import { execute } from './helpers' | ||
|
||
const proposal = 'private-methods' | ||
|
||
test(proposal, () => { | ||
expect(() => execute(proposal)).toThrowErrorMatchingSnapshot() | ||
const counter = new Counter() | ||
expect(counter.getCount()).toEqual(0) | ||
expect(counter.increment().getCount()).toEqual(1) | ||
}) |
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,16 @@ | ||
export class Counter { | ||
x = 0 | ||
|
||
#increment() { | ||
this.x++ | ||
return this | ||
} | ||
|
||
increment() { | ||
return this.#increment() | ||
} | ||
|
||
getCount() { | ||
return this.x | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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