Git Product home page Git Product logo

string.prototype.iswellformed's Introduction

string.prototype.iswellformed Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant String.prototype.isWellFormed shim/polyfill/replacement that works as far down as ES3.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the expected ES2024 spec.

Because String.prototype.isWellFormed depends on a receiver (the this value), the main export takes the string to operate on as the first argument.

Getting started

npm install --save string.prototype.iswellformed

Usage/Examples

var isWellFormed = require('string.prototype.iswellformed');
var assert = require('assert');

var leadingPoo = '\uD83D';
var trailingPoo = '\uDCA9';
var wholePoo = leadingPoo + trailingPoo;

assert.ok(isWellFormed(wholePoo));
assert.notOk(isWellFormed(leadingPoo));
assert.notOk(isWellFormed(trailingPoo));
var isWellFormed = require('string.prototype.iswellformed');
var assert = require('assert');
/* when String#isWellFormed is not present */
delete String.prototype.isWellFormed;
var shimmed = isWellFormed.shim();

assert.equal(shimmed, isWellFormed.getPolyfill());
assert.deepEqual(wholePoo.isWellFormed(), isWellFormed(wholePoo));
var isWellFormed = require('string.prototype.iswellformed');
var assert = require('assert');
/* when String#at is present */
var shimmed = isWellFormed.shim();

assert.equal(shimmed, String.prototype.isWellFormed);
assert.deepEqual(wholePoo.isWellFormed(), isWellFormed(wholePoo));

Tests

Simply clone the repo, npm install, and run npm test

string.prototype.iswellformed's People

Contributors

ljharb avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

thehaff

string.prototype.iswellformed's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • [Deps] Update Update eslint to v8.56.0
  • [Deps] Update Update nyc to v15
  • ๐Ÿ” Create all pending approval PRs at once ๐Ÿ”

Detected dependencies

github-actions
.github/workflows/node-aught.yml
.github/workflows/node-esm.yml
.github/workflows/node-pretest.yml
.github/workflows/node-tens.yml
.github/workflows/rebase.yml
.github/workflows/require-allow-edits.yml
npm
package.json
  • call-bind ^1.0.2
  • define-properties ^1.2.0
  • es-abstract ^1.22.1
  • @es-shims/api ^2.4.2
  • @ljharb/eslint-config ^21.1.0
  • aud ^2.0.3
  • auto-changelog ^2.4.0
  • es-value-fixtures ^1.4.2
  • eslint =8.8.0
  • functions-have-names ^1.2.3
  • has-bigints ^1.0.2
  • has-strict-mode ^1.0.1
  • has-symbols ^1.0.3
  • in-publish ^2.0.1
  • mock-property ^1.0.0
  • npmignore ^0.3.0
  • nyc ^10.3.2
  • safe-publish-latest ^2.0.0
  • tape ^5.6.6

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.