Sha256: 5754f556e5e9888233cbef45872a7f8b49419527403a4fd5c77b99278b389fcd

Contents?: true

Size: 610 Bytes

Versions: 108

Compression:

Stored size: 610 Bytes

Contents

/* eslint-disable babel/new-cap, xo/throw-new-error */
'use strict';
module.exports = function (str, pos) {
	if (str === null || str === undefined) {
		throw TypeError();
	}

	str = String(str);

	var size = str.length;
	var i = pos ? Number(pos) : 0;

	if (Number.isNaN(i)) {
		i = 0;
	}

	if (i < 0 || i >= size) {
		return undefined;
	}

	var first = str.charCodeAt(i);

	if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) {
		var second = str.charCodeAt(i + 1);

		if (second >= 0xDC00 && second <= 0xDFFF) {
			return ((first - 0xD800) * 0x400) + second - 0xDC00 + 0x10000;
		}
	}

	return first;
};

Version data entries

108 entries across 86 versions & 17 rubygems

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