Skip to content

Commit

Permalink
Merge branch 'master' into feature/es5
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Jan 2, 2018
2 parents 32710af + 4d4b1c9 commit 9b193bc
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"semi": false,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "all",
"trailingComma": "none",
"useTabs": false,
"overrides": [
{
Expand Down
18 changes: 9 additions & 9 deletions __tests__/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ describe("base", () => {
aProp: "hi",
messy: {
nested: {
yummie: true,
yummie: true
},
coffee: false,
},
coffee: false
}
})
expect(nextState.messy.nested).toBe(baseState.anObject.nested)
})
Expand All @@ -172,10 +172,10 @@ describe("base", () => {
aProp: "hello",
messy: {
nested: {
yummie: true,
yummie: true
},
coffee: true,
},
coffee: true
}
})
expect(nextState.messy.nested).toBe(baseState.anObject.nested)
})
Expand Down Expand Up @@ -238,10 +238,10 @@ describe("base", () => {
aProp: "hi",
anObject: {
nested: {
yummie: true,
yummie: true
},
coffee: false,
},
coffee: false
}
}
}
})
2 changes: 1 addition & 1 deletion __tests__/frozen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import immer from ".."
describe("auto freeze", () => {
const baseState = {
object: {a: 1},
array: [1, 2],
array: [1, 2]
}

it("should freeze objects after modifications", () => {
Expand Down
8 changes: 4 additions & 4 deletions __tests__/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("performance", () => {
baseState.push({
todo: "todo_" + i,
done: false,
someThingCompletelyIrrelevant: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0],
someThingCompletelyIrrelevant: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
})
}

Expand All @@ -33,7 +33,7 @@ describe("performance", () => {
const todoRecord = Record({
todo: "",
done: false,
someThingCompletelyIrrelevant: [],
someThingCompletelyIrrelevant: []
})
immutableJsBaseState = List(baseState.map(todo => todoRecord(todo)))

Expand All @@ -56,9 +56,9 @@ describe("performance", () => {
const nextState = [
...baseState.slice(0, MAX * MODIFY_FACTOR).map(todo => ({
...todo,
done: true,
done: true
})),
...baseState.slice(MAX * MODIFY_FACTOR),
...baseState.slice(MAX * MODIFY_FACTOR)
]
})

Expand Down
6 changes: 3 additions & 3 deletions __tests__/readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ describe("readme example", () => {
const baseState = [
{
todo: "Learn typescript",
done: true,
done: true
},
{
todo: "Try immer",
done: false,
},
done: false
}
]

const nextState = immer(baseState, draft => {
Expand Down
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

### 0.1.2 (2-1-2018)

* Fixed issue where trailing commas could break consumers. Fixes [#21](https://github.com/mweststrate/immer/pull/21).

### 0.1.1 (2-1-2018)

* Fixed issue where TypeScript typings were not correctly exposed. Fixes [#18](https://github.com/mweststrate/immer/pull/18).
* Fixed issue where TypeScript typings were not correctly exposed. Fixes [#18](https://github.com/mweststrate/immer/issue/18).

### 0.1.0 (1-1-2018)

Expand Down
8 changes: 4 additions & 4 deletions immer.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function immer(baseState, thunk) {
const copy = getOrCreateCopy(target)
delete copy[property]
return true
},
}
}

// creates a copy for a base object if there ain't one
Expand Down Expand Up @@ -101,7 +101,7 @@ function immer(baseState, thunk) {
Object.defineProperty(proxyTarget, CLONE_TARGET, {
enumerable: false,
value: base,
configurable: true,
configurable: true
})
} else {
proxyTarget = base
Expand Down Expand Up @@ -167,7 +167,7 @@ function immer(baseState, thunk) {
//values either than undefined will trigger warning;
!Object.is(maybeVoidReturn, undefined) &&
console.warn(
`Immer callback expects no return value. However ${typeof maybeVoidReturn} was returned`,
`Immer callback expects no return value. However ${typeof maybeVoidReturn} was returned`
)
// console.log(`proxies: ${revocableProxies.size}, copies: ${copies.size}`)
// revoke all proxies
Expand Down Expand Up @@ -217,7 +217,7 @@ function setAutoFreeze(enableAutoFreeze) {
}

Object.defineProperty(exports, "__esModule", {
value: true,
value: true
})
module.exports.default = immer
module.exports.setAutoFreeze = setAutoFreeze
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "immer",
"version": "0.1.0",
"version": "0.1.2",
"description": "Create your next immutable state by mutating the current one",
"main": "immer-es5.js",
"types": "./index.d.ts",
Expand Down

0 comments on commit 9b193bc

Please sign in to comment.