iso-8859-15
Advanced tools
Comparing version 0.1.2 to 1.0.0
@@ -1,2 +0,2 @@ | ||
/*! http://mths.be/iso-8859-15 v0.1.2 by @mathias | MIT license */ | ||
/*! https://mths.be/iso-8859-15 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; | ||
@@ -28,3 +28,3 @@ if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { | ||
// 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) { | ||
@@ -130,3 +130,3 @@ var mode; | ||
], | ||
'version': '0.1.2' | ||
'version': '1.0.0' | ||
}; | ||
@@ -145,3 +145,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 = iso885915; | ||
@@ -148,0 +148,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": "iso-8859-15", | ||
"version": "0.1.2", | ||
"version": "1.0.0", | ||
"description": "A robust iso-8859-15 encoder/decoder written in JavaScript.", | ||
"homepage": "http://mths.be/iso-8859-15", | ||
"homepage": "https://mths.be/iso-8859-15", | ||
"main": "iso-8859-15.js", | ||
@@ -22,11 +22,6 @@ "keywords": [ | ||
], | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://mths.be/mit" | ||
} | ||
], | ||
"license": "MIT", | ||
"author": { | ||
"name": "Mathias Bynens", | ||
"url": "http://mathiasbynens.be/" | ||
"url": "https://mathiasbynens.be/" | ||
}, | ||
@@ -37,5 +32,3 @@ "repository": { | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/mathiasbynens/iso-8859-15/issues" | ||
}, | ||
"bugs": "https://github.com/mathiasbynens/iso-8859-15/issues", | ||
"files": [ | ||
@@ -45,19 +38,19 @@ "LICENSE-MIT.txt", | ||
], | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"scripts": { | ||
"download": "curl https://encoding.spec.whatwg.org/index-iso-8859-15.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 @@ | ||
# iso-8859-15 [![Build status](https://travis-ci.org/mathiasbynens/iso-8859-15.svg?branch=master)](https://travis-ci.org/mathiasbynens/iso-8859-15) [![Dependency status](https://gemnasium.com/mathiasbynens/iso-8859-15.svg)](https://gemnasium.com/mathiasbynens/iso-8859-15) | ||
# iso-8859-15 [![Build status](https://travis-ci.org/mathiasbynens/iso-8859-15.svg?branch=master)](https://travis-ci.org/mathiasbynens/iso-8859-15) [![Code coverage status](https://coveralls.io/repos/mathiasbynens/iso-8859-15/badge.svg)](https://coveralls.io/r/mathiasbynens/iso-8859-15) [![Dependency status](https://gemnasium.com/mathiasbynens/iso-8859-15.svg)](https://gemnasium.com/mathiasbynens/iso-8859-15) | ||
_iso-8859-15_ is a robust JavaScript implementation of [the iso-8859-15 character encoding as defined by the Encoding Standard](http://encoding.spec.whatwg.org/#iso-8859-15). | ||
_iso-8859-15_ is a robust JavaScript implementation of [the iso-8859-15 character encoding as defined by the Encoding Standard](https://encoding.spec.whatwg.org/#iso-8859-15). | ||
@@ -9,3 +9,3 @@ This encoding is known under the following names: csisolatin9, iso-8859-15, iso8859-15, iso885915, iso_8859-15, and l9. | ||
Via [npm](http://npmjs.org/): | ||
Via [npm](https://www.npmjs.com/): | ||
@@ -16,14 +16,2 @@ ```bash | ||
Via [Bower](http://bower.io/): | ||
```bash | ||
bower install iso-8859-15 | ||
``` | ||
Via [Component](https://github.com/component/component): | ||
```bash | ||
component install mathiasbynens/iso-8859-15 | ||
``` | ||
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 @@ ### `iso885915.encode(input, options)` | ||
```js | ||
var encodedData = iso885915.encode(text); | ||
const encodedData = iso885915.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 = iso885915.encode(text, { | ||
const encodedData = iso885915.encode(text, { | ||
'mode': 'html' | ||
@@ -100,9 +88,9 @@ }); | ||
```js | ||
var text = iso885915.decode(encodedData); | ||
const text = iso885915.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 = iso885915.decode(encodedData, { | ||
const text = iso885915.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 | ||
_iso-8859-15_ 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. | ||
_iso-8859-15_ 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 | ||
_iso-8859-15_ is available under the [MIT](http://mths.be/mit) license. | ||
_iso-8859-15_ is available under the [MIT](https://mths.be/mit) license. |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
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
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
13126
10
1
114