typographic-arrows
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,4 +0,2 @@ | ||
'use strict'; | ||
module.exports = function (input) { | ||
export default function typographicArrows(input) { | ||
return input | ||
@@ -5,0 +3,0 @@ .replace(/<->/gim, '↔') |
{ | ||
"name": "typographic-arrows", | ||
"description": "Micro module for real arrows", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"keywords": [ | ||
@@ -12,7 +12,14 @@ "typographic", | ||
"devDependencies": { | ||
"mocha": "^2.2.4" | ||
"ava": "^0.10.0", | ||
"babel-cli": "^6.4.0", | ||
"babel-plugin-add-module-exports": "^0.1.2", | ||
"babel-preset-es2015": "^6.3.13", | ||
"rimraf": "^2.5.0" | ||
}, | ||
"main": "index.js", | ||
"main": "index.es5.js", | ||
"scripts": { | ||
"test": "mocha" | ||
"pretest": "npm run prepublish", | ||
"test": "ava", | ||
"prepublish": "babel index.js --out-file index.es5.js", | ||
"postpublish": "rimraf index.es5.js && git push --follow-tags" | ||
}, | ||
@@ -19,0 +26,0 @@ "author": "Andrey Polischuk <andre.polischuk@gmail.com>", |
@@ -5,3 +5,3 @@ # typographic-arrows [![Build Status][travis-image]][travis-url] | ||
Micro module for real arrows | ||
Micro module for real arrows. | ||
@@ -17,3 +17,4 @@ ## Install | ||
```js | ||
var arrows = require('typographic-arrows'); | ||
import arrows from 'typographic-arrows'; | ||
arrows('a <- b'); // a ← b | ||
@@ -27,2 +28,12 @@ arrows('a -> b'); // a → b | ||
## API | ||
### arrows(input) | ||
#### input | ||
Type: `string` | ||
Text for transform. | ||
## License | ||
@@ -29,0 +40,0 @@ |
29
test.js
@@ -1,27 +0,26 @@ | ||
'use strict'; | ||
var assert = require('assert'); | ||
var arrows = require('./'); | ||
import test from 'ava'; | ||
import arrows from './index.es5'; | ||
it('should fix left', function () { | ||
assert(arrows('a <- b') === 'a ← b'); | ||
test('should fix left', t => { | ||
t.is(arrows('a <- b'), 'a ← b'); | ||
}); | ||
it('should fix right', function () { | ||
assert(arrows('a -> b') === 'a → b'); | ||
test('should fix right', function (t) { | ||
t.is(arrows('a -> b'), 'a → b'); | ||
}); | ||
it('should fix left-right', function () { | ||
assert(arrows('a <-> b') === 'a ↔ b'); | ||
test('should fix left-right', function (t) { | ||
t.is(arrows('a <-> b'), 'a ↔ b'); | ||
}); | ||
it('should fix double left', function () { | ||
assert(arrows('a <= b') === 'a ⇐ b'); | ||
test('should fix double left', function (t) { | ||
t.is(arrows('a <= b'), 'a ⇐ b'); | ||
}); | ||
it('should fix double right', function () { | ||
assert(arrows('a => b') === 'a ⇒ b'); | ||
test('should fix double right', function (t) { | ||
t.is(arrows('a => b'), 'a ⇒ b'); | ||
}); | ||
it('should fix double left-right', function () { | ||
assert(arrows('a <=> b') === 'a ⇔ b'); | ||
test('should fix double left-right', function (t) { | ||
t.is(arrows('a <=> b'), 'a ⇔ b'); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2960
9
38
42
5