Sha256: 4a6b56028709031c73ddfeba601052f623b8d065df29fda1f3cdd36ccb27ac15

Contents?: true

Size: 783 Bytes

Versions: 81

Compression:

Stored size: 783 Bytes

Contents

'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');

var UTF16EncodeCodePoint = require('./UTF16EncodeCodePoint');
var IsArray = require('./IsArray');

var forEach = require('../helpers/forEach');
var isCodePoint = require('../helpers/isCodePoint');

// https://262.ecma-international.org/12.0/#sec-codepointstostring

module.exports = function CodePointsToString(text) {
	if (!IsArray(text)) {
		throw new $TypeError('Assertion failed: `text` must be a sequence of Unicode Code Points');
	}
	var result = '';
	forEach(text, function (cp) {
		if (!isCodePoint(cp)) {
			throw new $TypeError('Assertion failed: `text` must be a sequence of Unicode Code Points');
		}
		result += UTF16EncodeCodePoint(cp);
	});
	return result;
};

Version data entries

81 entries across 27 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.32 node_modules/es-abstract/2022/CodePointsToString.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2021/CodePointsToString.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2023/CodePointsToString.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2021/CodePointsToString.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2022/CodePointsToString.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2023/CodePointsToString.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2022/CodePointsToString.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2023/CodePointsToString.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2021/CodePointsToString.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2023/CodePointsToString.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2022/CodePointsToString.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2021/CodePointsToString.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2021/CodePointsToString.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2023/CodePointsToString.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2022/CodePointsToString.js
immosquare-cleaner-0.1.27 node_modules/es-abstract/2021/CodePointsToString.js
immosquare-cleaner-0.1.27 node_modules/es-abstract/2022/CodePointsToString.js
immosquare-cleaner-0.1.27 node_modules/es-abstract/2023/CodePointsToString.js
immosquare-cleaner-0.1.26 node_modules/es-abstract/2022/CodePointsToString.js
immosquare-cleaner-0.1.26 node_modules/es-abstract/2023/CodePointsToString.js