Skip to content

Commit

Permalink
Merge pull request #37 from davidchambers/sanctuary-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers authored Apr 29, 2018
2 parents 7d8480e + c7ef1a1 commit 90206b0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
17 changes: 16 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
{
"root": true,
"extends": ["./node_modules/sanctuary-style/eslint-es3.json"]
"extends": ["./node_modules/sanctuary-style/eslint-es3.json"],
"overrides": [
{
"files": ["*.md"],
"plugins": ["markdown"],
"env": {"es6": true, "node": true},
"globals": {"format": false, "user": false},
"rules": {
"comma-dangle": ["error", "always-multiline"],
"max-len": ["off"],
"no-unused-vars": ["error", {"varsIgnorePattern": "^format$"}],
"semi": ["error", "never"],
"strict": ["off"]
}
}
]
}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ determine the replacement:

```javascript
const sheldon = {
firstName: 'Sheldon',
lastName: 'Cooper',
dob: new Date('1970-01-01'),
fullName: function() { return this.firstName + ' ' + this.lastName },
quip: function() { return 'Bazinga!' },
firstName: 'Sheldon',
lastName: 'Cooper',
dob: new Date('1970-01-01'),
fullName: function() { return this.firstName + ' ' + this.lastName },
quip: function() { return 'Bazinga!' },
}

'{fullName} was born at precisely {dob.toISOString}'.format(sheldon)
Expand All @@ -166,7 +166,7 @@ with `!`, after a field name in a template string.
```javascript
const fmt = format.create({
escape: s => s.replace(/[&<>"'`]/g, c => '&#' + c.charCodeAt(0) + ';'),
upper: s => s.toUpperCase(),
upper: s => s.toUpperCase(),
})

fmt('Hello, {!upper}!', 'Alice')
Expand All @@ -188,7 +188,7 @@ name in a template string.
```javascript
format.extend(String.prototype, {
escape: s => s.replace(/[&<>"'`]/g, c => '&#' + c.charCodeAt(0) + ';'),
upper: s => s.toUpperCase(),
upper: s => s.toUpperCase(),
})

'Hello, {!upper}!'.format('Alice')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],
"dependencies": {},
"devDependencies": {
"sanctuary-scripts": "1.4.x"
"sanctuary-scripts": "1.5.x"
},
"scripts": {
"doctest": "sanctuary-doctest",
Expand Down

0 comments on commit 90206b0

Please sign in to comment.