summaryrefslogtreecommitdiff
path: root/node_modules/typographic-single-spaces
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-03 02:37:42 -0700
committer8cy <[email protected]>2020-04-03 02:37:42 -0700
commit60867fb030bae582082340ead7dbc7efdc2f5398 (patch)
tree4c6a7356351be2e4914e15c4703172597c45656e /node_modules/typographic-single-spaces
parentcommenting (diff)
downloads5nical-60867fb030bae582082340ead7dbc7efdc2f5398.tar.xz
s5nical-60867fb030bae582082340ead7dbc7efdc2f5398.zip
2020/04/03, 02:34, v1.2.0
Diffstat (limited to 'node_modules/typographic-single-spaces')
-rw-r--r--node_modules/typographic-single-spaces/.npmignore3
-rw-r--r--node_modules/typographic-single-spaces/.travis.yml7
-rw-r--r--node_modules/typographic-single-spaces/README.md59
-rw-r--r--node_modules/typographic-single-spaces/index.es5.js6
-rw-r--r--node_modules/typographic-single-spaces/index.js1
-rw-r--r--node_modules/typographic-single-spaces/package.json69
-rw-r--r--node_modules/typographic-single-spaces/test.js15
7 files changed, 160 insertions, 0 deletions
diff --git a/node_modules/typographic-single-spaces/.npmignore b/node_modules/typographic-single-spaces/.npmignore
new file mode 100644
index 0000000..648ea07
--- /dev/null
+++ b/node_modules/typographic-single-spaces/.npmignore
@@ -0,0 +1,3 @@
+node_modules
+coverage
+npm-debug.log
diff --git a/node_modules/typographic-single-spaces/.travis.yml b/node_modules/typographic-single-spaces/.travis.yml
new file mode 100644
index 0000000..cabc0a5
--- /dev/null
+++ b/node_modules/typographic-single-spaces/.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-single-spaces/README.md b/node_modules/typographic-single-spaces/README.md
new file mode 100644
index 0000000..5d54a33
--- /dev/null
+++ b/node_modules/typographic-single-spaces/README.md
@@ -0,0 +1,59 @@
+# typographic-single-spaces
+
+[![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]
+
+> [Always one—never two][rtfm]
+
+Micro module to help eliminate one of the [bad typewriter habits][habits].
+
+
+## Install
+
+```sh
+npm install --save typographic-single-spaces
+```
+
+
+## Usage
+
+```js
+var singleSpaces = require('typographic-single-spaces');
+
+singleSpaces(`foo bar`); // foo bar
+singleSpaces(`foo. Bar`); // foo. Bar
+singleSpaces(`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/one-space-between-sentences.html
+[habits]: http://practicaltypography.com/typewriter-habits.html
+
+[npm-url]: https://npmjs.org/package/typographic-single-spaces
+[npm-image]: http://img.shields.io/npm/v/typographic-single-spaces.svg
+
+[travis-url]: https://travis-ci.org/matmuchrapna/typographic-single-spaces
+[travis-image]: http://img.shields.io/travis/matmuchrapna/typographic-single-spaces.svg
+
+[coveralls-url]: https://coveralls.io/r/matmuchrapna/typographic-single-spaces
+[coveralls-image]: http://img.shields.io/coveralls/matmuchrapna/typographic-single-spaces.svg
+
+[depstat-url]: https://david-dm.org/matmuchrapna/typographic-single-spaces
+[depstat-image]: https://david-dm.org/matmuchrapna/typographic-single-spaces.svg
+
+[depstat-dev-url]: https://david-dm.org/matmuchrapna/typographic-single-spaces
+[depstat-dev-image]: https://david-dm.org/matmuchrapna/typographic-single-spaces/dev-status.svg
diff --git a/node_modules/typographic-single-spaces/index.es5.js b/node_modules/typographic-single-spaces/index.es5.js
new file mode 100644
index 0000000..f196c7a
--- /dev/null
+++ b/node_modules/typographic-single-spaces/index.es5.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (input) {
+ return input.replace(/ +/gim, " ");
+};
+
diff --git a/node_modules/typographic-single-spaces/index.js b/node_modules/typographic-single-spaces/index.js
new file mode 100644
index 0000000..159707b
--- /dev/null
+++ b/node_modules/typographic-single-spaces/index.js
@@ -0,0 +1 @@
+export default (input)=> input.replace(/ +/gim, ' ');
diff --git a/node_modules/typographic-single-spaces/package.json b/node_modules/typographic-single-spaces/package.json
new file mode 100644
index 0000000..220215e
--- /dev/null
+++ b/node_modules/typographic-single-spaces/package.json
@@ -0,0 +1,69 @@
+{
+ "_from": "typographic-single-spaces@^1.0.2",
+ "_id": "[email protected]",
+ "_inBundle": false,
+ "_integrity": "sha1-gsMRVDfbbdsuF671VJTdkH6UH38=",
+ "_location": "/typographic-single-spaces",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "typographic-single-spaces@^1.0.2",
+ "name": "typographic-single-spaces",
+ "escapedName": "typographic-single-spaces",
+ "rawSpec": "^1.0.2",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.2"
+ },
+ "_requiredBy": [
+ "/at-quotes"
+ ],
+ "_resolved": "https://registry.npmjs.org/typographic-single-spaces/-/typographic-single-spaces-1.0.2.tgz",
+ "_shasum": "82c3115437db6ddb2e17aef55494dd907e941f7f",
+ "_spec": "typographic-single-spaces@^1.0.2",
+ "_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-single-spaces/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Always one—never two",
+ "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-single-spaces",
+ "keywords": [
+ "textr",
+ "typographic",
+ "spaces"
+ ],
+ "license": "MIT",
+ "main": "index.es5.js",
+ "name": "typographic-single-spaces",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/matmuchrapna/typographic-single-spaces.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": "npm test -- --watch",
+ "test": "mocha --require babel/register",
+ "transpile": "babel index.js > index.es5.js"
+ },
+ "version": "1.0.2"
+}
diff --git a/node_modules/typographic-single-spaces/test.js b/node_modules/typographic-single-spaces/test.js
new file mode 100644
index 0000000..c36281d
--- /dev/null
+++ b/node_modules/typographic-single-spaces/test.js
@@ -0,0 +1,15 @@
+import singleSpaces from './index';
+import { equal } from 'assert';
+
+it('should fix double spaces', ()=> {
+ equal(singleSpaces(`foo bar`), `foo bar`);
+});
+
+it('should fix double spaces after punctuation', ()=> {
+ equal(singleSpaces(`foo. Bar`), `foo. Bar`);
+ equal(singleSpaces(`foo, bar`), `foo, bar`);
+});
+
+it('should fix multiply spaces', ()=> {
+ equal(singleSpaces(`foo bar`), `foo bar`);
+});