diff options
Diffstat (limited to 'node_modules/typographic-ellipses')
| -rw-r--r-- | node_modules/typographic-ellipses/.npmignore | 3 | ||||
| -rw-r--r-- | node_modules/typographic-ellipses/.travis.yml | 7 | ||||
| -rw-r--r-- | node_modules/typographic-ellipses/README.md | 57 | ||||
| -rw-r--r-- | node_modules/typographic-ellipses/index.es5.js | 6 | ||||
| -rw-r--r-- | node_modules/typographic-ellipses/index.js | 1 | ||||
| -rw-r--r-- | node_modules/typographic-ellipses/package.json | 70 | ||||
| -rw-r--r-- | node_modules/typographic-ellipses/test.js | 22 |
7 files changed, 166 insertions, 0 deletions
diff --git a/node_modules/typographic-ellipses/.npmignore b/node_modules/typographic-ellipses/.npmignore new file mode 100644 index 0000000..648ea07 --- /dev/null +++ b/node_modules/typographic-ellipses/.npmignore @@ -0,0 +1,3 @@ +node_modules +coverage +npm-debug.log diff --git a/node_modules/typographic-ellipses/.travis.yml b/node_modules/typographic-ellipses/.travis.yml new file mode 100644 index 0000000..cabc0a5 --- /dev/null +++ b/node_modules/typographic-ellipses/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - '0.12' + - '0.10' + - 'iojs' +after_script: + - npm run coveralls diff --git a/node_modules/typographic-ellipses/README.md b/node_modules/typographic-ellipses/README.md new file mode 100644 index 0000000..fafc318 --- /dev/null +++ b/node_modules/typographic-ellipses/README.md @@ -0,0 +1,57 @@ +# typographic-ellipses + +[![NPM version][npm-image]][npm-url] +[![Build Status][travis-image]][travis-url] +[![Coveralls Status][coveralls-image]][coveralls-url] +[![Dependency Status][depstat-image]][depstat-url] +[![DevDependency Status][depstat-dev-image]][depstat-dev-url] + +> [Avoid using periods and spaces][rtfm] + +Micro module to help eliminate one of the [bad typewriter habits][habits]. + + +## Install + +```sh +npm install --save typographic-ellipses +``` + + +## Usage + +```js +var ellipses = require('typographic-ellipses'); + +ellipses('foo...bar'); // foo…bar +``` + + +## Real world examples + +Check complex usage with real world examples in [typography playground][playground]. + +[playground]: https://github.com/matmuchrapna/typographic-playground + + +## License + +MIT © [Vladimir Starkov](http://vstarkov.com/) + +[rtfm]: http://practicaltypography.com/ellipses.html +[habits]: http://practicaltypography.com/typewriter-habits.html + +[npm-url]: https://npmjs.org/package/typographic-ellipses +[npm-image]: http://img.shields.io/npm/v/typographic-ellipses.svg + +[travis-url]: https://travis-ci.org/matmuchrapna/typographic-ellipses +[travis-image]: http://img.shields.io/travis/matmuchrapna/typographic-ellipses.svg + +[coveralls-url]: https://coveralls.io/r/matmuchrapna/typographic-ellipses +[coveralls-image]: http://img.shields.io/coveralls/matmuchrapna/typographic-ellipses.svg + +[depstat-url]: https://david-dm.org/matmuchrapna/typographic-ellipses +[depstat-image]: https://david-dm.org/matmuchrapna/typographic-ellipses.svg + +[depstat-dev-url]: https://david-dm.org/matmuchrapna/typographic-ellipses +[depstat-dev-image]: https://david-dm.org/matmuchrapna/typographic-ellipses/dev-status.svg diff --git a/node_modules/typographic-ellipses/index.es5.js b/node_modules/typographic-ellipses/index.es5.js new file mode 100644 index 0000000..6c07a8a --- /dev/null +++ b/node_modules/typographic-ellipses/index.es5.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (input) { + return input.replace(/\.{3}/gim, '…'); +}; + diff --git a/node_modules/typographic-ellipses/index.js b/node_modules/typographic-ellipses/index.js new file mode 100644 index 0000000..3ac916f --- /dev/null +++ b/node_modules/typographic-ellipses/index.js @@ -0,0 +1 @@ +export default (input)=> input.replace(/\.{3}/gim, '…'); diff --git a/node_modules/typographic-ellipses/package.json b/node_modules/typographic-ellipses/package.json new file mode 100644 index 0000000..4b528a1 --- /dev/null +++ b/node_modules/typographic-ellipses/package.json @@ -0,0 +1,70 @@ +{ + "_from": "typographic-ellipses@^1.0.11", + "_id": "[email protected]", + "_inBundle": false, + "_integrity": "sha1-ppFDtLjFYR3Tpmm3wwUmA+imlIc=", + "_location": "/typographic-ellipses", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "typographic-ellipses@^1.0.11", + "name": "typographic-ellipses", + "escapedName": "typographic-ellipses", + "rawSpec": "^1.0.11", + "saveSpec": null, + "fetchSpec": "^1.0.11" + }, + "_requiredBy": [ + "/at-quotes" + ], + "_resolved": "https://registry.npmjs.org/typographic-ellipses/-/typographic-ellipses-1.0.11.tgz", + "_shasum": "a69143b4b8c5611dd3a669b7c3052603e8a69487", + "_spec": "typographic-ellipses@^1.0.11", + "_where": "E:\\Documents\\GitHub\\s5nical\\node_modules\\at-quotes", + "author": { + "name": "Vladimir Starkov", + "email": "[email protected]", + "url": "http://vstarkov.com/" + }, + "bugs": { + "url": "https://github.com/matmuchrapna/typographic-ellipses/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Avoid using periods and spaces", + "devDependencies": { + "babel": "^5.0.0", + "coveralls": "^2.11.2", + "husky": "^0.7.0", + "istanbul": "^0.3.11", + "mocha": "^2.2.1", + "mocha-lcov-reporter": "0.0.2" + }, + "homepage": "https://github.com/matmuchrapna/typographic-ellipses", + "keywords": [ + "textr", + "typographic", + "ellipses", + "ellipsis" + ], + "license": "MIT", + "main": "index.es5.js", + "name": "typographic-ellipses", + "repository": { + "type": "git", + "url": "git+https://github.com/matmuchrapna/typographic-ellipses.git" + }, + "scripts": { + "coverage": "istanbul cover _mocha -- --require babel/register", + "coveralls": "coveralls < coverage/lcov.info", + "postpublish": "rm *.es5.js && git push --follow-tags", + "precommit": "npm test", + "precoveralls": "npm run coverage", + "prepublish": "npm run transpile", + "tdd": "mocha --require babel/register --watch", + "test": "mocha --require babel/register", + "transpile": "babel index.js > index.es5.js" + }, + "version": "1.0.11" +} diff --git a/node_modules/typographic-ellipses/test.js b/node_modules/typographic-ellipses/test.js new file mode 100644 index 0000000..f03433e --- /dev/null +++ b/node_modules/typographic-ellipses/test.js @@ -0,0 +1,22 @@ +import ellipses from './index'; +import { equal, notEqual } from 'assert'; + +it('should fix single cases', ()=> { + equal(ellipses('foo...bar'), 'foo…bar'); +}); + +it('should fix multiple cases', ()=> { + equal(ellipses('foo...bar...moo'), 'foo…bar…moo'); +}); + +it('should fix multiline strings too', ()=> { + equal(ellipses('multiline\n test...'), 'multiline\n test…'); +}); + +it('should not fix two periods', ()=> { + equal(ellipses('foo..bar'), 'foo..bar'); +}); + +it('should not replace all the things', ()=> { + notEqual(ellipses('foo'), '…'); +}); |