Giter Club home page Giter Club logo

is-surrogate-pair-x's Introduction

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

is-surrogate-pair-x

Tests if 2 characters together are a surrogate pair.

module.exports(char1, [char2])boolean

Tests if the two character arguments combined are a valid UTF-16 surrogate pair.

Kind: Exported function
Returns: boolean - Returns true if the two characters create a valid 'UTF-16' surrogate pair; otherwise false.

Param Type Description
char1 * The character combination, or if char2 is supplied then the first character of a suspected surrogate pair.
[char2] * The second character of a suspected surrogate pair.

Example

import isSurrogatePair from 'is-surrogate-pair-x';

const test1 = 'a';
const test2 = '𠮟';

console.log(isSurrogatePair(test1)); // false
console.log(isSurrogatePair(test1.charAt(0), test1.charAt(1))); // false
console.log(isSurrogatePair(test2)); // true
console.log(isSurrogatePair(test2.charAt(0), test2.charAt(1))); // true

is-surrogate-pair-x's People

Contributors

xotic750 avatar

Watchers

 avatar  avatar

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.