Comparing version 1.0.0 to 1.0.1
@@ -1,20 +0,4 @@ | ||
/*! https://mths.be/ibm866 v1.0.0 by @mathias | MIT license */ | ||
;(function(root) { | ||
/*! https://mths.be/ibm866 v1.0.1 by @mathias | MIT license */ | ||
;(function() { | ||
// Detect free variables `exports`. | ||
var freeExports = typeof exports == 'object' && exports; | ||
// Detect free variable `module`. | ||
var freeModule = typeof module == 'object' && module && | ||
module.exports == freeExports && module; | ||
// Detect free variable `global`, from Node.js/io.js or Browserified code, | ||
// and use it as `root`. | ||
var freeGlobal = typeof global == 'object' && global; | ||
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { | ||
root = freeGlobal; | ||
} | ||
/*--------------------------------------------------------------------------*/ | ||
var object = {}; | ||
@@ -36,3 +20,3 @@ var hasOwnProperty = object.hasOwnProperty; | ||
// Else, `mode == 'fatal'`. | ||
throw Error(); | ||
throw new Error(); | ||
}; | ||
@@ -117,5 +101,5 @@ | ||
var ibm866 = { | ||
'encode': encode, | ||
'decode': decode, | ||
'labels': [ | ||
encode: encode, | ||
decode: decode, | ||
labels: [ | ||
'866', | ||
@@ -126,27 +110,7 @@ 'cp866', | ||
], | ||
'version': '1.0.0' | ||
version: '1.0.1', | ||
}; | ||
// Some AMD build optimizers, like r.js, check for specific condition patterns | ||
// like the following: | ||
if ( | ||
typeof define == 'function' && | ||
typeof define.amd == 'object' && | ||
define.amd | ||
) { | ||
define(function() { | ||
return ibm866; | ||
}); | ||
} else if (freeExports && !freeExports.nodeType) { | ||
if (freeModule) { // in Node.js, io.js or RingoJS v0.8.0+ | ||
freeModule.exports = ibm866; | ||
} else { // in Narwhal or RingoJS v0.7.0- | ||
for (var key in ibm866) { | ||
ibm866.hasOwnProperty(key) && (freeExports[key] = ibm866[key]); | ||
} | ||
} | ||
} else { // in Rhino or a web browser | ||
root.ibm866 = ibm866; | ||
} | ||
module.exports = ibm866; | ||
}(this)); | ||
}()); |
{ | ||
"name": "ibm866", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A robust ibm866 encoder/decoder written in JavaScript.", | ||
@@ -37,16 +37,10 @@ "homepage": "https://mths.be/ibm866", | ||
"build": "node scripts/transform-data.js", | ||
"test": "node tests/tests.js" | ||
"test": "node tests/tests.js", | ||
"cover": "istanbul cover --report html --verbose --dir coverage tests/tests.js" | ||
}, | ||
"devDependencies": { | ||
"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.22", | ||
"string.fromcodepoint": "^0.2.1" | ||
"jsesc": "^3.0.2", | ||
"lodash.template": "^4.5.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# ibm866 [![Build status](https://travis-ci.org/mathiasbynens/ibm866.svg?branch=master)](https://travis-ci.org/mathiasbynens/ibm866) [![Code coverage status](https://coveralls.io/repos/mathiasbynens/ibm866/badge.svg)](https://coveralls.io/r/mathiasbynens/ibm866) [![Dependency status](https://gemnasium.com/mathiasbynens/ibm866.svg)](https://gemnasium.com/mathiasbynens/ibm866) | ||
# ibm866 [![Build status](https://github.com/mathiasbynens/ibm866/workflows/run-checks/badge.svg)](https://github.com/mathiasbynens/ibm866/actions?query=workflow%3Arun-checks) [![ibm866 on npm](https://img.shields.io/npm/v/ibm866)](https://www.npmjs.com/package/ibm866) | ||
@@ -21,30 +21,8 @@ _ibm866_ is a robust JavaScript implementation of [the ibm866 character encoding as defined by the Encoding Standard](https://encoding.spec.whatwg.org/#ibm866). | ||
In [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/): | ||
In [Node.js](https://nodejs.org/): | ||
```js | ||
var ibm866 = require('ibm866'); | ||
const ibm866 = require('ibm866'); | ||
``` | ||
In [Rhino](https://www.mozilla.org/rhino/): | ||
```js | ||
load('ibm866.js'); | ||
``` | ||
Using an AMD loader like [RequireJS](http://requirejs.org/): | ||
```js | ||
require( | ||
{ | ||
'paths': { | ||
'ibm866': 'path/to/ibm866' | ||
} | ||
}, | ||
['ibm866'], | ||
function(ibm866) { | ||
console.log(ibm866); | ||
} | ||
); | ||
``` | ||
## API | ||
@@ -72,3 +50,3 @@ | ||
const encodedData = ibm866.encode(text, { | ||
'mode': 'html' | ||
mode: 'html' | ||
}); | ||
@@ -91,3 +69,3 @@ // If `text` contains a symbol that cannot be represented in ibm866, | ||
const text = ibm866.decode(encodedData, { | ||
'mode': 'fatal' | ||
mode: 'fatal' | ||
}); | ||
@@ -100,6 +78,2 @@ // If `encodedData` contains an invalid byte for the ibm866 encoding, | ||
## Support | ||
_ibm866_ 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. | ||
## Notes | ||
@@ -106,0 +80,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3
11129
117
88
1