Sha256: 6701d64b4ad395f30b07f8685c04c6d61ca9c98094d75d0b2e06687e2386910f

Contents?: true

Size: 1.43 KB

Versions: 189

Compression:

Stored size: 1.43 KB

Contents

'use strict';
var numberIsNan = require('number-is-nan');

module.exports = function (x) {
	if (numberIsNan(x)) {
		return false;
	}

	// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369

	// code points are derived from:
	// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
	if (x >= 0x1100 && (
		x <= 0x115f ||  // Hangul Jamo
		0x2329 === x || // LEFT-POINTING ANGLE BRACKET
		0x232a === x || // RIGHT-POINTING ANGLE BRACKET
		// CJK Radicals Supplement .. Enclosed CJK Letters and Months
		(0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
		// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
		0x3250 <= x && x <= 0x4dbf ||
		// CJK Unified Ideographs .. Yi Radicals
		0x4e00 <= x && x <= 0xa4c6 ||
		// Hangul Jamo Extended-A
		0xa960 <= x && x <= 0xa97c ||
		// Hangul Syllables
		0xac00 <= x && x <= 0xd7a3 ||
		// CJK Compatibility Ideographs
		0xf900 <= x && x <= 0xfaff ||
		// Vertical Forms
		0xfe10 <= x && x <= 0xfe19 ||
		// CJK Compatibility Forms .. Small Form Variants
		0xfe30 <= x && x <= 0xfe6b ||
		// Halfwidth and Fullwidth Forms
		0xff01 <= x && x <= 0xff60 ||
		0xffe0 <= x && x <= 0xffe6 ||
		// Kana Supplement
		0x1b000 <= x && x <= 0x1b001 ||
		// Enclosed Ideographic Supplement
		0x1f200 <= x && x <= 0x1f251 ||
		// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
		0x20000 <= x && x <= 0x3fffd)) {
		return true;
	}

	return false;
}

Version data entries

189 entries across 153 versions & 20 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js
disco_app-0.18.0 test/dummy/node_modules/fsevents/node_modules/is-fullwidth-code-point/index.js
disco_app-0.18.0 test/dummy/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js
disco_app-0.18.2 test/dummy/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js
disco_app-0.16.1 test/dummy/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
disco_app-0.15.2 test/dummy/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
disco_app-0.18.4 test/dummy/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
disco_app-0.18.1 test/dummy/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
disco_app-0.14.0 test/dummy/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
tang-0.2.1 spec/tang_app/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
tang-0.2.0 spec/tang_app/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
tang-0.1.0 spec/tang_app/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
tang-0.0.9 spec/tang_app/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js
enju_library-0.3.8 spec/dummy/node_modules/fsevents/node_modules/is-fullwidth-code-point/index.js