Comparing version 0.1.2 to 1.0.0
@@ -1,2 +0,2 @@ | ||
/*! http://mths.be/koi8-u v0.1.2 by @mathias | MIT license */ | ||
/*! https://mths.be/koi8-u v1.0.0 by @mathias | MIT license */ | ||
;(function(root) { | ||
@@ -11,4 +11,4 @@ | ||
// Detect free variable `global`, from Node.js or Browserified code, and use | ||
// it as `root`. | ||
// Detect free variable `global`, from Node.js/io.js or Browserified code, | ||
// and use it as `root`. | ||
var freeGlobal = typeof global == 'object' && global; | ||
@@ -25,6 +25,6 @@ if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { | ||
var INDEX_BY_CODE_POINT = {'160':26,'169':63,'176':28,'178':29,'183':30,'247':31,'1025':51,'1028':52,'1030':54,'1031':55,'1040':97,'1041':98,'1042':119,'1043':103,'1044':100,'1045':101,'1046':118,'1047':122,'1048':105,'1049':106,'1050':107,'1051':108,'1052':109,'1053':110,'1054':111,'1055':112,'1056':114,'1057':115,'1058':116,'1059':117,'1060':102,'1061':104,'1062':99,'1063':126,'1064':123,'1065':125,'1066':127,'1067':121,'1068':120,'1069':124,'1070':96,'1071':113,'1072':65,'1073':66,'1074':87,'1075':71,'1076':68,'1077':69,'1078':86,'1079':90,'1080':73,'1081':74,'1082':75,'1083':76,'1084':77,'1085':78,'1086':79,'1087':80,'1088':82,'1089':83,'1090':84,'1091':85,'1092':70,'1093':72,'1094':67,'1095':94,'1096':91,'1097':93,'1098':95,'1099':89,'1100':88,'1101':92,'1102':64,'1103':81,'1105':35,'1108':36,'1110':38,'1111':39,'1168':61,'1169':45,'8729':21,'8730':22,'8776':23,'8804':24,'8805':25,'8992':19,'8993':27,'9472':0,'9474':1,'9484':2,'9488':3,'9492':4,'9496':5,'9500':6,'9508':7,'9516':8,'9524':9,'9532':10,'9552':32,'9553':33,'9554':34,'9556':37,'9559':40,'9560':41,'9561':42,'9562':43,'9563':44,'9565':46,'9566':47,'9567':48,'9568':49,'9569':50,'9571':53,'9574':56,'9575':57,'9576':58,'9577':59,'9578':60,'9580':62,'9600':11,'9604':12,'9608':13,'9612':14,'9616':15,'9617':16,'9618':17,'9619':18,'9632':20}; | ||
var INDEX_BY_POINTER = {'0':'\u2500','1':'\u2502','2':'\u250C','3':'\u2510','4':'\u2514','5':'\u2518','6':'\u251C','7':'\u2524','8':'\u252C','9':'\u2534','10':'\u253C','11':'\u2580','12':'\u2584','13':'\u2588','14':'\u258C','15':'\u2590','16':'\u2591','17':'\u2592','18':'\u2593','19':'\u2320','20':'\u25A0','21':'\u2219','22':'\u221A','23':'\u2248','24':'\u2264','25':'\u2265','26':'\xA0','27':'\u2321','28':'\xB0','29':'\xB2','30':'\xB7','31':'\xF7','32':'\u2550','33':'\u2551','34':'\u2552','35':'\u0451','36':'\u0454','37':'\u2554','38':'\u0456','39':'\u0457','40':'\u2557','41':'\u2558','42':'\u2559','43':'\u255A','44':'\u255B','45':'\u0491','46':'\u255D','47':'\u255E','48':'\u255F','49':'\u2560','50':'\u2561','51':'\u0401','52':'\u0404','53':'\u2563','54':'\u0406','55':'\u0407','56':'\u2566','57':'\u2567','58':'\u2568','59':'\u2569','60':'\u256A','61':'\u0490','62':'\u256C','63':'\xA9','64':'\u044E','65':'\u0430','66':'\u0431','67':'\u0446','68':'\u0434','69':'\u0435','70':'\u0444','71':'\u0433','72':'\u0445','73':'\u0438','74':'\u0439','75':'\u043A','76':'\u043B','77':'\u043C','78':'\u043D','79':'\u043E','80':'\u043F','81':'\u044F','82':'\u0440','83':'\u0441','84':'\u0442','85':'\u0443','86':'\u0436','87':'\u0432','88':'\u044C','89':'\u044B','90':'\u0437','91':'\u0448','92':'\u044D','93':'\u0449','94':'\u0447','95':'\u044A','96':'\u042E','97':'\u0410','98':'\u0411','99':'\u0426','100':'\u0414','101':'\u0415','102':'\u0424','103':'\u0413','104':'\u0425','105':'\u0418','106':'\u0419','107':'\u041A','108':'\u041B','109':'\u041C','110':'\u041D','111':'\u041E','112':'\u041F','113':'\u042F','114':'\u0420','115':'\u0421','116':'\u0422','117':'\u0423','118':'\u0416','119':'\u0412','120':'\u042C','121':'\u042B','122':'\u0417','123':'\u0428','124':'\u042D','125':'\u0429','126':'\u0427','127':'\u042A'}; | ||
var INDEX_BY_CODE_POINT = {'160':26,'169':63,'176':28,'178':29,'183':30,'247':31,'1025':51,'1028':52,'1030':54,'1031':55,'1038':62,'1040':97,'1041':98,'1042':119,'1043':103,'1044':100,'1045':101,'1046':118,'1047':122,'1048':105,'1049':106,'1050':107,'1051':108,'1052':109,'1053':110,'1054':111,'1055':112,'1056':114,'1057':115,'1058':116,'1059':117,'1060':102,'1061':104,'1062':99,'1063':126,'1064':123,'1065':125,'1066':127,'1067':121,'1068':120,'1069':124,'1070':96,'1071':113,'1072':65,'1073':66,'1074':87,'1075':71,'1076':68,'1077':69,'1078':86,'1079':90,'1080':73,'1081':74,'1082':75,'1083':76,'1084':77,'1085':78,'1086':79,'1087':80,'1088':82,'1089':83,'1090':84,'1091':85,'1092':70,'1093':72,'1094':67,'1095':94,'1096':91,'1097':93,'1098':95,'1099':89,'1100':88,'1101':92,'1102':64,'1103':81,'1105':35,'1108':36,'1110':38,'1111':39,'1118':46,'1168':61,'1169':45,'8729':21,'8730':22,'8776':23,'8804':24,'8805':25,'8992':19,'8993':27,'9472':0,'9474':1,'9484':2,'9488':3,'9492':4,'9496':5,'9500':6,'9508':7,'9516':8,'9524':9,'9532':10,'9552':32,'9553':33,'9554':34,'9556':37,'9559':40,'9560':41,'9561':42,'9562':43,'9563':44,'9566':47,'9567':48,'9568':49,'9569':50,'9571':53,'9574':56,'9575':57,'9576':58,'9577':59,'9578':60,'9600':11,'9604':12,'9608':13,'9612':14,'9616':15,'9617':16,'9618':17,'9619':18,'9632':20}; | ||
var INDEX_BY_POINTER = {'0':'\u2500','1':'\u2502','2':'\u250C','3':'\u2510','4':'\u2514','5':'\u2518','6':'\u251C','7':'\u2524','8':'\u252C','9':'\u2534','10':'\u253C','11':'\u2580','12':'\u2584','13':'\u2588','14':'\u258C','15':'\u2590','16':'\u2591','17':'\u2592','18':'\u2593','19':'\u2320','20':'\u25A0','21':'\u2219','22':'\u221A','23':'\u2248','24':'\u2264','25':'\u2265','26':'\xA0','27':'\u2321','28':'\xB0','29':'\xB2','30':'\xB7','31':'\xF7','32':'\u2550','33':'\u2551','34':'\u2552','35':'\u0451','36':'\u0454','37':'\u2554','38':'\u0456','39':'\u0457','40':'\u2557','41':'\u2558','42':'\u2559','43':'\u255A','44':'\u255B','45':'\u0491','46':'\u045E','47':'\u255E','48':'\u255F','49':'\u2560','50':'\u2561','51':'\u0401','52':'\u0404','53':'\u2563','54':'\u0406','55':'\u0407','56':'\u2566','57':'\u2567','58':'\u2568','59':'\u2569','60':'\u256A','61':'\u0490','62':'\u040E','63':'\xA9','64':'\u044E','65':'\u0430','66':'\u0431','67':'\u0446','68':'\u0434','69':'\u0435','70':'\u0444','71':'\u0433','72':'\u0445','73':'\u0438','74':'\u0439','75':'\u043A','76':'\u043B','77':'\u043C','78':'\u043D','79':'\u043E','80':'\u043F','81':'\u044F','82':'\u0440','83':'\u0441','84':'\u0442','85':'\u0443','86':'\u0436','87':'\u0432','88':'\u044C','89':'\u044B','90':'\u0437','91':'\u0448','92':'\u044D','93':'\u0449','94':'\u0447','95':'\u044A','96':'\u042E','97':'\u0410','98':'\u0411','99':'\u0426','100':'\u0414','101':'\u0415','102':'\u0424','103':'\u0413','104':'\u0425','105':'\u0418','106':'\u0419','107':'\u041A','108':'\u041B','109':'\u041C','110':'\u041D','111':'\u041E','112':'\u041F','113':'\u042F','114':'\u0420','115':'\u0421','116':'\u0422','117':'\u0423','118':'\u0416','119':'\u0412','120':'\u042C','121':'\u042B','122':'\u0417','123':'\u0428','124':'\u042D','125':'\u0429','126':'\u0427','127':'\u042A'}; | ||
// http://encoding.spec.whatwg.org/#error-mode | ||
// https://encoding.spec.whatwg.org/#error-mode | ||
var error = function(codePoint, mode) { | ||
@@ -41,3 +41,3 @@ if (mode == 'replacement') { | ||
// http://encoding.spec.whatwg.org/#single-byte-decoder | ||
// https://encoding.spec.whatwg.org/#single-byte-decoder | ||
var decode = function(input, options) { | ||
@@ -80,3 +80,3 @@ var mode; | ||
// http://encoding.spec.whatwg.org/#single-byte-encoder | ||
// https://encoding.spec.whatwg.org/#single-byte-encoder | ||
var encode = function(input, options) { | ||
@@ -125,3 +125,3 @@ var mode; | ||
], | ||
'version': '0.1.2' | ||
'version': '1.0.0' | ||
}; | ||
@@ -140,3 +140,3 @@ | ||
} else if (freeExports && !freeExports.nodeType) { | ||
if (freeModule) { // in Node.js or RingoJS v0.8.0+ | ||
if (freeModule) { // in Node.js, io.js or RingoJS v0.8.0+ | ||
freeModule.exports = koi8u; | ||
@@ -143,0 +143,0 @@ } else { // in Narwhal or RingoJS v0.7.0- |
@@ -1,2 +0,2 @@ | ||
Copyright Mathias Bynens <http://mathiasbynens.be/> | ||
Copyright Mathias Bynens <https://mathiasbynens.be/> | ||
@@ -3,0 +3,0 @@ Permission is hereby granted, free of charge, to any person obtaining |
{ | ||
"name": "koi8-u", | ||
"version": "0.1.2", | ||
"version": "1.0.0", | ||
"description": "A robust koi8-u encoder/decoder written in JavaScript.", | ||
"homepage": "http://mths.be/koi8-u", | ||
"homepage": "https://mths.be/koi8-u", | ||
"main": "koi8-u.js", | ||
@@ -17,11 +17,6 @@ "keywords": [ | ||
], | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://mths.be/mit" | ||
} | ||
], | ||
"license": "MIT", | ||
"author": { | ||
"name": "Mathias Bynens", | ||
"url": "http://mathiasbynens.be/" | ||
"url": "https://mathiasbynens.be/" | ||
}, | ||
@@ -32,5 +27,3 @@ "repository": { | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/mathiasbynens/koi8-u/issues" | ||
}, | ||
"bugs": "https://github.com/mathiasbynens/koi8-u/issues", | ||
"files": [ | ||
@@ -40,19 +33,19 @@ "LICENSE-MIT.txt", | ||
], | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"scripts": { | ||
"download": "curl https://encoding.spec.whatwg.org/index-koi8-u.txt > data/index.txt", | ||
"build": "node scripts/transform-data.js", | ||
"test": "node tests/tests.js" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.4", | ||
"grunt-shell": "~0.7.0", | ||
"grunt-template": "~0.2.3", | ||
"istanbul": "~0.2.7", | ||
"jsesc": "~0.4.3", | ||
"qunit-extras": "~1.1.0", | ||
"coveralls": "^2.11.6", | ||
"grunt": "^0.4.5", | ||
"grunt-shell": "^1.1.2", | ||
"grunt-template": "^0.2.3", | ||
"istanbul": "^0.4.2", | ||
"jsesc": "^2.1.0", | ||
"qunit-extras": "^1.4.5", | ||
"qunitjs": "~1.11.0", | ||
"requirejs": "~2.1.11", | ||
"string.fromcodepoint": "~0.2.0" | ||
"requirejs": "^2.1.22", | ||
"string.fromcodepoint": "^0.2.1" | ||
} | ||
} |
@@ -1,4 +0,4 @@ | ||
# koi8-u [![Build status](https://travis-ci.org/mathiasbynens/koi8-u.svg?branch=master)](https://travis-ci.org/mathiasbynens/koi8-u) [![Dependency status](https://gemnasium.com/mathiasbynens/koi8-u.svg)](https://gemnasium.com/mathiasbynens/koi8-u) | ||
# koi8-u [![Build status](https://travis-ci.org/mathiasbynens/koi8-u.svg?branch=master)](https://travis-ci.org/mathiasbynens/koi8-u) [![Code coverage status](https://coveralls.io/repos/mathiasbynens/koi8-u/badge.svg)](https://coveralls.io/r/mathiasbynens/koi8-u) [![Dependency status](https://gemnasium.com/mathiasbynens/koi8-u.svg)](https://gemnasium.com/mathiasbynens/koi8-u) | ||
_koi8-u_ is a robust JavaScript implementation of [the koi8-u character encoding as defined by the Encoding Standard](http://encoding.spec.whatwg.org/#koi8-u). | ||
_koi8-u_ is a robust JavaScript implementation of [the koi8-u character encoding as defined by the Encoding Standard](https://encoding.spec.whatwg.org/#koi8-u). | ||
@@ -9,3 +9,3 @@ This encoding is known under the following names: , and koi8-u. | ||
Via [npm](http://npmjs.org/): | ||
Via [npm](https://www.npmjs.com/): | ||
@@ -16,14 +16,2 @@ ```bash | ||
Via [Bower](http://bower.io/): | ||
```bash | ||
bower install koi8-u | ||
``` | ||
Via [Component](https://github.com/component/component): | ||
```bash | ||
component install mathiasbynens/koi8-u | ||
``` | ||
In a browser: | ||
@@ -35,3 +23,3 @@ | ||
In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/): | ||
In [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/): | ||
@@ -42,3 +30,3 @@ ```js | ||
In [Rhino](http://www.mozilla.org/rhino/): | ||
In [Rhino](https://www.mozilla.org/rhino/): | ||
@@ -73,3 +61,3 @@ ```js | ||
An array of strings, each representing a [label](http://encoding.spec.whatwg.org/#label) for this encoding. | ||
An array of strings, each representing a [label](https://encoding.spec.whatwg.org/#label) for this encoding. | ||
@@ -81,9 +69,9 @@ ### `koi8u.encode(input, options)` | ||
```js | ||
var encodedData = koi8u.encode(text); | ||
const encodedData = koi8u.encode(text); | ||
``` | ||
The optional `options` object and its `mode` property can be used to set the [error mode](http://encoding.spec.whatwg.org/#error-mode). For encoding, the error mode can be `'fatal'` (the default) or `'html'`. | ||
The optional `options` object and its `mode` property can be used to set the [error mode](https://encoding.spec.whatwg.org/#error-mode). For encoding, the error mode can be `'fatal'` (the default) or `'html'`. | ||
```js | ||
var encodedData = koi8u.encode(text, { | ||
const encodedData = koi8u.encode(text, { | ||
'mode': 'html' | ||
@@ -100,9 +88,9 @@ }); | ||
```js | ||
var text = koi8u.decode(encodedData); | ||
const text = koi8u.decode(encodedData); | ||
``` | ||
The optional `options` object and its `mode` property can be used to set the [error mode](http://encoding.spec.whatwg.org/#error-mode). For decoding, the error mode can be `'replacement'` (the default) or `'fatal'`. | ||
The optional `options` object and its `mode` property can be used to set the [error mode](https://encoding.spec.whatwg.org/#error-mode). For decoding, the error mode can be `'replacement'` (the default) or `'fatal'`. | ||
```js | ||
var text = koi8u.decode(encodedData, { | ||
const text = koi8u.decode(encodedData, { | ||
'mode': 'fatal' | ||
@@ -114,17 +102,11 @@ }); | ||
For decoding a buffer (e.g. from `fs.readFile`) use `buffer.toString('binary')` to get the byte string which `decode` takes. | ||
## Support | ||
_koi8-u_ is designed to work in at least Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, Rhino 1.7RC4, as well as old and modern versions of Chrome, Firefox, Safari, Opera, and Internet Explorer. | ||
_koi8-u_ is designed to work in at least Node.js v0.10.0, io.js v1.0.0, Narwhal 0.3.2, RingoJS 0.8-0.11, PhantomJS 1.9.0, Rhino 1.7RC4, as well as old and modern versions of Chrome, Firefox, Safari, Opera, Edge, and Internet Explorer. | ||
## Unit tests & code coverage | ||
After cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. | ||
Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`. | ||
To generate the code coverage report, use `grunt cover`. | ||
## Notes | ||
[Similar modules for other single-byte legacy encodings are available.](https://www.npmjs.org/browse/keyword/legacy-encoding) | ||
[Similar modules for other single-byte legacy encodings are available.](https://www.npmjs.com/browse/keyword/legacy-encoding) | ||
@@ -135,6 +117,6 @@ ## Author | ||
|---| | ||
| [Mathias Bynens](http://mathiasbynens.be/) | | ||
| [Mathias Bynens](https://mathiasbynens.be/) | | ||
## License | ||
_koi8-u_ is available under the [MIT](http://mths.be/mit) license. | ||
_koi8-u_ is available under the [MIT](https://mths.be/mit) license. |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
0
13018
10
1
114