Socket
Socket
Sign inDemoInstall

punycode

Package Overview
Dependencies
0
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.0 to 2.2.2

10

package.json
{
"name": "punycode",
"version": "2.2.0",
"version": "2.2.2",
"description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.",

@@ -34,5 +34,5 @@ "homepage": "https://mths.be/punycode",

"type": "git",
"url": "https://github.com/bestiejs/punycode.js.git"
"url": "https://github.com/mathiasbynens/punycode.js.git"
},
"bugs": "https://github.com/bestiejs/punycode.js/issues",
"bugs": "https://github.com/mathiasbynens/punycode.js/issues",
"files": [

@@ -45,3 +45,3 @@ "LICENSE-MIT.txt",

"test": "mocha tests",
"prepublish": "node scripts/prepublish.js"
"build": "node scripts/prepublish.js"
},

@@ -51,3 +51,3 @@ "devDependencies": {

"istanbul": "^0.4.1",
"mocha": "^2.5.3"
"mocha": "^10.2.0"
},

@@ -54,0 +54,0 @@ "jspm": {

@@ -18,3 +18,3 @@ 'use strict';

const regexPunycode = /^xn--/;
const regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too.
const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators

@@ -146,9 +146,9 @@

const basicToDigit = function(codePoint) {
if (codePoint - 0x30 < 0x0A) {
return codePoint - 0x16;
if (codePoint >= 0x30 && codePoint < 0x3A) {
return 26 + (codePoint - 0x30);
}
if (codePoint - 0x41 < 0x1A) {
if (codePoint >= 0x41 && codePoint < 0x5B) {
return codePoint - 0x41;
}
if (codePoint - 0x61 < 0x1A) {
if (codePoint >= 0x61 && codePoint < 0x7B) {
return codePoint - 0x61;

@@ -233,3 +233,3 @@ }

// value at the end to obtain `delta`.
let oldi = i;
const oldi = i;
for (let w = 1, k = base; /* no condition */; k += base) {

@@ -243,3 +243,6 @@

if (digit >= base || digit > floor((maxInt - i) / w)) {
if (digit >= base) {
error('invalid-input');
}
if (digit > floor((maxInt - i) / w)) {
error('overflow');

@@ -298,3 +301,3 @@ }

// Cache the length.
let inputLength = input.length;
const inputLength = input.length;

@@ -313,3 +316,3 @@ // Initialize the state.

let basicLength = output.length;
const basicLength = output.length;
let handledCPCount = basicLength;

@@ -316,0 +319,0 @@

@@ -18,3 +18,3 @@ 'use strict';

const regexPunycode = /^xn--/;
const regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too.
const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators

@@ -146,9 +146,9 @@

const basicToDigit = function(codePoint) {
if (codePoint - 0x30 < 0x0A) {
return codePoint - 0x16;
if (codePoint >= 0x30 && codePoint < 0x3A) {
return 26 + (codePoint - 0x30);
}
if (codePoint - 0x41 < 0x1A) {
if (codePoint >= 0x41 && codePoint < 0x5B) {
return codePoint - 0x41;
}
if (codePoint - 0x61 < 0x1A) {
if (codePoint >= 0x61 && codePoint < 0x7B) {
return codePoint - 0x61;

@@ -233,3 +233,3 @@ }

// value at the end to obtain `delta`.
let oldi = i;
const oldi = i;
for (let w = 1, k = base; /* no condition */; k += base) {

@@ -243,3 +243,6 @@

if (digit >= base || digit > floor((maxInt - i) / w)) {
if (digit >= base) {
error('invalid-input');
}
if (digit > floor((maxInt - i) / w)) {
error('overflow');

@@ -298,3 +301,3 @@ }

// Cache the length.
let inputLength = input.length;
const inputLength = input.length;

@@ -313,3 +316,3 @@ // Initialize the state.

let basicLength = output.length;
const basicLength = output.length;
let handledCPCount = basicLength;

@@ -316,0 +319,0 @@

@@ -1,2 +0,2 @@

# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/codecov/c/github/bestiejs/punycode.js.svg)](https://codecov.io/gh/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js)
# Punycode.js [![punycode on npm](https://img.shields.io/npm/v/punycode)](https://www.npmjs.com/package/emoji-test-regex-pattern) [![](https://data.jsdelivr.com/v1/package/npm/punycode/badge)](https://www.jsdelivr.com/package/npm/punycode)

@@ -15,3 +15,3 @@ Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891).

The current version supports recent versions of Node.js only. It provides a CommonJS module and an ES6 module. For the old version that offers the same functionality with broader support, including Rhino, Ringo, Narwhal, and web browsers, see [v1.4.1](https://github.com/bestiejs/punycode.js/releases/tag/v1.4.1).
This project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1).

@@ -18,0 +18,0 @@ ## Installation

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc