From cb7fbbb53ce7db4d1dd03768a37659b4ade733db Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Fri, 15 Jul 2016 16:35:47 +0200 Subject: [PATCH] Clean up some files --- Gruntfile.js | 8 -------- README.md | 28 ++++------------------------ data/index.txt | 27 +++++++++++++++------------ package.json | 5 +++-- 4 files changed, 22 insertions(+), 46 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 8a3402d..2f37c9a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,9 +7,6 @@ module.exports = function(grunt) { 'stderr': true, 'failOnError': true }, - 'fetch': { - 'command': 'curl https://encoding.spec.whatwg.org/index-iso-8859-14.txt > data/index.txt' - }, 'transform-data': { 'command': 'npm run build' }, @@ -83,11 +80,6 @@ module.exports = function(grunt) { 'shell:test-browser' ]); - grunt.registerTask('fetch', [ - 'shell:fetch', - 'build' - ]); - grunt.registerTask('build', [ 'shell:transform-data', 'default' diff --git a/README.md b/README.md index 383f1b3..0da3200 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,6 @@ Via [npm](https://www.npmjs.com/): npm install iso-8859-14 ``` -Via [Bower](http://bower.io/): - -```bash -bower install iso-8859-14 -``` - -Via [Component](https://github.com/component/component): - -```bash -component install mathiasbynens/iso-8859-14 -``` - In a browser: ```html @@ -73,13 +61,13 @@ An array of strings, each representing a [label](https://encoding.spec.whatwg.or This function takes a plain text string (the `input` parameter) and encodes it according to iso-8859-14. The return value is a ‘byte string’, i.e. a string of which each item represents an octet as per iso-8859-14. ```js -var encodedData = iso885914.encode(text); +const encodedData = iso885914.encode(text); ``` 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 = iso885914.encode(text, { +const encodedData = iso885914.encode(text, { 'mode': 'html' }); // If `text` contains a symbol that cannot be represented in iso-8859-14, @@ -91,13 +79,13 @@ var encodedData = iso885914.encode(text, { This function takes a byte string (the `input` parameter) and decodes it according to iso-8859-14. ```js -var text = iso885914.decode(encodedData); +const text = iso885914.decode(encodedData); ``` 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 = iso885914.decode(encodedData, { +const text = iso885914.decode(encodedData, { 'mode': 'fatal' }); // If `encodedData` contains an invalid byte for the iso-8859-14 encoding, @@ -110,14 +98,6 @@ For decoding a buffer (e.g. from `fs.readFile`) use `buffer.toString('binary')` _iso-8859-14_ 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.com/browse/keyword/legacy-encoding) diff --git a/data/index.txt b/data/index.txt index 5428fc6..57c198d 100644 --- a/data/index.txt +++ b/data/index.txt @@ -1,19 +1,22 @@ # Any copyright is dedicated to the Public Domain. -# http://creativecommons.org/publicdomain/zero/1.0/ +# https://creativecommons.org/publicdomain/zero/1.0/ # -# For details on index-iso-8859-14.txt see the Encoding Standard +# For details on index index-iso-8859-14.txt see the Encoding Standard # https://encoding.spec.whatwg.org/ +# +# Identifier: 2c8651cfc08b1f35b17919ee5379f2fa006af3ec809f11b3b7f470785580542b +# Date: 2016-01-20 - 0 0x0080 € () - 1 0x0081  () - 2 0x0082 ‚ () - 3 0x0083 ƒ () - 4 0x0084 „ () - 5 0x0085 … () - 6 0x0086 † () - 7 0x0087 ‡ () - 8 0x0088 ˆ () - 9 0x0089 ‰ () + 0 0x0080 € () + 1 0x0081  () + 2 0x0082 ‚ () + 3 0x0083 ƒ () + 4 0x0084 „ () + 5 0x0085 … () + 6 0x0086 † () + 7 0x0087 ‡ () + 8 0x0088 ˆ () + 9 0x0089 ‰ () 10 0x008A Š () 11 0x008B ‹ () 12 0x008C Œ () diff --git a/package.json b/package.json index a6d3974..89c1f56 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,9 @@ "iso-8859-14.js" ], "scripts": { - "test": "node tests/tests.js", - "build": "node scripts/transform-data.js" + "download": "curl https://encoding.spec.whatwg.org/index-iso-8859-14.txt > data/index.txt", + "build": "node scripts/transform-data.js", + "test": "node tests/tests.js" }, "devDependencies": { "coveralls": "^2.11.6",