包详细信息

es-string-html-methods

es-shims1.3kMIT1.0.4

An ES-spec-compliant shim/polyfill/replacement for the Annex B String.prototype HTML methods that works as far down as ES3

ecmascript, javascript, string, string.prototype

自述文件

es-string-html-methods Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES-spec-compliant shim/polyfill/replacement for the Annex B String.prototype HTML methods that works as far down as ES3

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

Because the String.prototype HTML methods depend on a receiver (the this value), the main export in each subdirectory takes the string to operate on as the first argument.

The main export of the package itself is simply an array of the available directory names. It’s sole intended use is for build tooling and testing.

Supported methods

Getting started

npm install --save es-string-html-methods

Usage/Examples

var blink = require('es-string-html-methods/blink');
var link = require('es-string-html-methods/link');
var assert = require('assert');

assert.equal(
    blink('a'),
    '<blink>a</blink>'
);
assert.equal(
    link('a', 'b'),
    '<a href="b">a</a>'
);
require('./auto'); // shim all of the methods

require('./anchor/auto'); // shim the “anchor” method

Tests

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

更新日志

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.0.4 - 2025-03-14

Commits

  • [Deps] update call-bind, define-properties, es-abstract, safe-array-concat 0877d8d
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, auto-changelog, for-each, has-strict-mode, npmignore, tape 00d18d0
  • [Refactor] use call-bound directly 95cabd3
  • [Tests] replace aud with npm audit 851c854
  • [Dev Deps] add missing peer dep 6825251

v1.0.3 - 2023-08-28

Commits

  • [Deps] update es-abstract b74ac98
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, tape 0046d07

v1.0.2 - 2023-04-20

Commits

v1.0.1 - 2022-04-09

Commits

  • [actions] reuse common workflows f380102
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest, tape ee9648e
  • [Deps] update es-abstract bc16550
  • [actions] update codecov uploader 824a9f0
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 5f59694
  • [Deps] update es-abstract c8230aa
  • [Dev Deps] update @es-shims/api 9ba3568
  • [meta] eslintignore coverage a4cf0f8
  • [Deps] update es-abstract df69960
  • [readme] remove "proposed" 1d9802d

v1.0.0 - 2021-09-04

Commits