File: shim.js

package info (click to toggle)
node-string.prototype.codepointat 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 140 kB
  • sloc: javascript: 197; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 363 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*! https://mths.be/codepointat v1.0.0 by @mathias */

'use strict';

var define = require('define-properties');

var getPolyfill = require('./polyfill');

module.exports = function shimCodePointAt() {
	var polyfill = getPolyfill();

	if (String.prototype.codePointAt !== polyfill) {
		define(String.prototype, { codePointAt: polyfill });
	}

	return polyfill;
}