inital
This commit is contained in:
20
node_modules/string.prototype.trimend/.editorconfig
generated
vendored
Normal file
20
node_modules/string.prototype.trimend/.editorconfig
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 150
|
||||
|
||||
[CHANGELOG.md]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
max_line_length = off
|
||||
|
||||
[Makefile]
|
||||
max_line_length = off
|
24
node_modules/string.prototype.trimend/.eslintrc
generated
vendored
Normal file
24
node_modules/string.prototype.trimend/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"id-length": "off",
|
||||
"new-cap": ["error", {
|
||||
"capIsNewExceptions": [
|
||||
"RequireObjectCoercible",
|
||||
],
|
||||
}],
|
||||
},
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"id-length": 0,
|
||||
"no-invalid-this": 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
9
node_modules/string.prototype.trimend/.nycrc
generated
vendored
Normal file
9
node_modules/string.prototype.trimend/.nycrc
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
115
node_modules/string.prototype.trimend/CHANGELOG.md
generated
vendored
Normal file
115
node_modules/string.prototype.trimend/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.0.8](https://github.com/es-shims/String.prototype.trimEnd/compare/v1.0.7...v1.0.8) - 2024-03-16
|
||||
|
||||
### Commits
|
||||
|
||||
- [Refactor] replace `es-abstract` with `es-object-atoms` [`0df2b01`](https://github.com/es-shims/String.prototype.trimEnd/commit/0df2b018d3ba214e2435b9841a7a03fc06c24fd0)
|
||||
- [Dev Deps] update `aud`, `npmignore`, `tape` [`190e9c5`](https://github.com/es-shims/String.prototype.trimEnd/commit/190e9c5d74f84d8f90f61c9e9ad4b05f657df830)
|
||||
|
||||
## [v1.0.7](https://github.com/es-shims/String.prototype.trimEnd/compare/v1.0.6...v1.0.7) - 2023-09-07
|
||||
|
||||
### Commits
|
||||
|
||||
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `tape` [`1a10293`](https://github.com/es-shims/String.prototype.trimEnd/commit/1a102935636b564cd346d83666f62a9398864081)
|
||||
- [Deps] update `define-properties`, `es-abstract` [`6ba2e19`](https://github.com/es-shims/String.prototype.trimEnd/commit/6ba2e19a78f9c63bad2daf0627ce7f2e33f1aeb9)
|
||||
|
||||
## [v1.0.6](https://github.com/es-shims/String.prototype.trimEnd/compare/v1.0.5...v1.0.6) - 2022-11-07
|
||||
|
||||
### Commits
|
||||
|
||||
- [meta] use `npmignore` to autogenerate an npmignore file [`1d1e717`](https://github.com/es-shims/String.prototype.trimEnd/commit/1d1e71720ada81e484c9bffb386f65d7a6a1335e)
|
||||
- [actions] update rebase action to use reusable workflow [`83f2683`](https://github.com/es-shims/String.prototype.trimEnd/commit/83f268325cc37ca72bea995281167a9d2821810b)
|
||||
- [Dev Deps] update `aud`, `tape` [`a3a9129`](https://github.com/es-shims/String.prototype.trimEnd/commit/a3a9129dd995a949bdb93d278f403aa400e088ed)
|
||||
- [Deps] update `es-abstract` [`a6e476d`](https://github.com/es-shims/String.prototype.trimEnd/commit/a6e476dc0120a41a22e66b5079bf3b407da387fa)
|
||||
|
||||
## [v1.0.5](https://github.com/es-shims/String.prototype.trimEnd/compare/v1.0.4...v1.0.5) - 2022-05-02
|
||||
|
||||
### Commits
|
||||
|
||||
- [actions] reuse common workflows [`69a56ce`](https://github.com/es-shims/String.prototype.trimEnd/commit/69a56ce95343848d5e498f8e939a0697db8ac9f2)
|
||||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`5d7db31`](https://github.com/es-shims/String.prototype.trimEnd/commit/5d7db314948faac975705db56305b6cc3dae7ba9)
|
||||
- [Fix] ensure main entry point properly checks the receiver in ES3 engines [`bb1983d`](https://github.com/es-shims/String.prototype.trimEnd/commit/bb1983dc27504733ab883a42f55b134f679a642d)
|
||||
- [Fix] as of unicode v6, the mongolian vowel separator is no longer whitespace [`10a1091`](https://github.com/es-shims/String.prototype.trimEnd/commit/10a10916e1ffc8cdab78515b2cc521cc74c08277)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `safe-publish-latest`, `tape` [`a08e14b`](https://github.com/es-shims/String.prototype.trimEnd/commit/a08e14bfea5e27d419ef742e83f467a169a69971)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `functions-have-names`, `tape` [`1c4c8da`](https://github.com/es-shims/String.prototype.trimEnd/commit/1c4c8dab4aefc1c5823a61b5a0286bb6fe1e036c)
|
||||
- [actions] update codecov uploader [`70c4a7c`](https://github.com/es-shims/String.prototype.trimEnd/commit/70c4a7c566fd5bf72475df9318ec2cd218ceca26)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `auto-changelog`, `tape` [`4b08ed7`](https://github.com/es-shims/String.prototype.trimEnd/commit/4b08ed78a579585b593b3ca4ac7919d13906e840)
|
||||
- [readme] add github actions/codecov badges [`9805501`](https://github.com/es-shims/String.prototype.trimEnd/commit/980550105b304385bcccb8ec05a247e02c24d04a)
|
||||
- [Dev Deps] update `eslint`, `tape` [`50ec335`](https://github.com/es-shims/String.prototype.trimEnd/commit/50ec335ed42b59d1ab626dbe412f4ae23ab99b4b)
|
||||
- [actions] update workflows [`bf9c32e`](https://github.com/es-shims/String.prototype.trimEnd/commit/bf9c32efe08e98b53302df67581dc971b7a758cd)
|
||||
- [meta] use `prepublishOnly` script for npm 7+ [`9d921bd`](https://github.com/es-shims/String.prototype.trimEnd/commit/9d921bdbcaf8cebebbc302e6df518cbc3e4907bd)
|
||||
- [Deps] update `define-properties` [`15617ce`](https://github.com/es-shims/String.prototype.trimEnd/commit/15617ced8ac2ea3ab8324a04d16fd294b12059b5)
|
||||
|
||||
## [v1.0.4](https://github.com/es-shims/String.prototype.trimEnd/compare/v1.0.3...v1.0.4) - 2021-02-23
|
||||
|
||||
### Commits
|
||||
|
||||
- [meta] do not publish github action workflow files [`08e735c`](https://github.com/es-shims/String.prototype.trimEnd/commit/08e735cd55b00ae78a9dc16c6b4e786f7931085b)
|
||||
- [readme] remove travis badge [`10e0e47`](https://github.com/es-shims/String.prototype.trimEnd/commit/10e0e47cb2ecfd171e68b40f8486c5d007dcf3ef)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `functions-have-names`, `has-strict-mode`, `tape` [`0871432`](https://github.com/es-shims/String.prototype.trimEnd/commit/0871432c70c2f6a3929acd740a5d1f57c939f345)
|
||||
- [Tests] increase coverage [`711e6a6`](https://github.com/es-shims/String.prototype.trimEnd/commit/711e6a66660f30f7a30fef536be435af1a13d05c)
|
||||
- [actions] update workflows [`deb0d06`](https://github.com/es-shims/String.prototype.trimEnd/commit/deb0d06f41ac1c3e1e640ecd1cf0e69303ab5799)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`e250b4a`](https://github.com/es-shims/String.prototype.trimEnd/commit/e250b4a38401e7c02a067dab26cc68316da47ef7)
|
||||
- [meta] gitignore coverage output [`55231df`](https://github.com/es-shims/String.prototype.trimEnd/commit/55231dfd9829277ba5c3f07be5434dc385703ca9)
|
||||
- [Deps] update `call-bind` [`0580f5f`](https://github.com/es-shims/String.prototype.trimEnd/commit/0580f5f915ecb87677764d03fe3cf023e3bee7d8)
|
||||
|
||||
## [v1.0.3](https://github.com/es-shims/String.prototype.trimEnd/compare/v1.0.2...v1.0.3) - 2020-11-21
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] migrate tests to Github Actions [`23e7a09`](https://github.com/es-shims/String.prototype.trimEnd/commit/23e7a09a4ad37c21c3db3d7761212c7d84a371a2)
|
||||
- [Tests] add `implementation` test; run `es-shim-api` in postlint; use `tape` runner [`26e8623`](https://github.com/es-shims/String.prototype.trimEnd/commit/26e8623cf35c1859d0b482d4bb5b3450d101a810)
|
||||
- [Tests] run `nyc` on all tests [`a72a546`](https://github.com/es-shims/String.prototype.trimEnd/commit/a72a546f671c5d3ac65dff68b4db1a1cc7089bfd)
|
||||
- [Deps] replace `es-abstract` with `call-bind` [`f07b87d`](https://github.com/es-shims/String.prototype.trimEnd/commit/f07b87dd452090a2601d666edceb1daa90d45f24)
|
||||
- [Dev Deps] update `eslint`, `aud`; add `safe-publish-latest` [`122ecb7`](https://github.com/es-shims/String.prototype.trimEnd/commit/122ecb726b1dc043b9ef27fa5a7b4172a4d5df37)
|
||||
|
||||
## [v1.0.2](https://github.com/es-shims/String.prototype.trimEnd/compare/v1.0.1...v1.0.2) - 2020-10-20
|
||||
|
||||
### Commits
|
||||
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`a003e71`](https://github.com/es-shims/String.prototype.trimEnd/commit/a003e7166d8de16c551a14b0ec855187357cce43)
|
||||
- [actions] add "Allow Edits" workflow [`0b4b43c`](https://github.com/es-shims/String.prototype.trimEnd/commit/0b4b43cb605f7b3532e61c43dfc7f1795296c5a4)
|
||||
- [Deps] update `es-abstract` [`75ca6b0`](https://github.com/es-shims/String.prototype.trimEnd/commit/75ca6b0e9757d64013ae863cfaac49ebcb36f1cf)
|
||||
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`552016c`](https://github.com/es-shims/String.prototype.trimEnd/commit/552016cb631ac13c12bbbc0d6dd65012e5e79583)
|
||||
|
||||
## [v1.0.1](https://github.com/es-shims/String.prototype.trimEnd/compare/v1.0.0...v1.0.1) - 2020-04-09
|
||||
|
||||
### Commits
|
||||
|
||||
- [meta] add some missing repo metadata [`6abe248`](https://github.com/es-shims/String.prototype.trimEnd/commit/6abe248ba0b57a8b0e16bbe01de07a4d37c421bc)
|
||||
- [Dev Deps] update `auto-changelog` [`e2eaab2`](https://github.com/es-shims/String.prototype.trimEnd/commit/e2eaab2fd1bc27a3d224b3d76db16190c1dd6d08)
|
||||
|
||||
## [v1.0.0](https://github.com/es-shims/String.prototype.trimEnd/compare/v0.1.0...v1.0.0) - 2020-03-30
|
||||
|
||||
### Commits
|
||||
|
||||
- [Breaking] convert to es-shim API [`2c6ef13`](https://github.com/es-shims/String.prototype.trimEnd/commit/2c6ef13d3f0b07a9bc55e367b311dbb731780405)
|
||||
- [meta] add `auto-changelog` [`6f1fcc1`](https://github.com/es-shims/String.prototype.trimEnd/commit/6f1fcc1739de1e9541bd603b659807646a13dd7f)
|
||||
- [meta] update readme [`ed4ce0d`](https://github.com/es-shims/String.prototype.trimEnd/commit/ed4ce0d84d53e626b48375c5959be20332464eaf)
|
||||
- [Tests] add `npm run lint` [`eadaf2c`](https://github.com/es-shims/String.prototype.trimEnd/commit/eadaf2c83f2d791b54d80d7b30a9961ebc0f246f)
|
||||
- Only apps should have lockfiles [`44d355f`](https://github.com/es-shims/String.prototype.trimEnd/commit/44d355f7dafcb0b51c5001824b07f7a2b9f1d06e)
|
||||
- [actions] add automatic rebasing / merge commit blocking [`e78bf8e`](https://github.com/es-shims/String.prototype.trimEnd/commit/e78bf8e5fc04fcb3379dd1c98360d7df4f9ea7d6)
|
||||
- [Tests] use shared travis-ci configs [`983c563`](https://github.com/es-shims/String.prototype.trimEnd/commit/983c5639efca2c9bb8b93ebbb917fbcb2561b94c)
|
||||
- [meta] add `funding` field [`35139d6`](https://github.com/es-shims/String.prototype.trimEnd/commit/35139d6236ceacfc1501d08fb196d18a936ee583)
|
||||
- [meta] fix non-updated version number [`a2d308b`](https://github.com/es-shims/String.prototype.trimEnd/commit/a2d308b99967ca427936c54747175794ca7336e1)
|
||||
|
||||
## [v0.1.0](https://github.com/es-shims/String.prototype.trimEnd/compare/v0.0.1...v0.1.0) - 2017-12-19
|
||||
|
||||
### Commits
|
||||
|
||||
- updated README [`f1c71a0`](https://github.com/es-shims/String.prototype.trimEnd/commit/f1c71a0a882e89e1c207ed2b316d91670be2b075)
|
||||
|
||||
## v0.0.1 - 2017-12-19
|
||||
|
||||
### Commits
|
||||
|
||||
- finished polyfill [`e58d550`](https://github.com/es-shims/String.prototype.trimEnd/commit/e58d550ab8695924ff4221ebe91f00f29801aa4b)
|
||||
- created README file [`f78628a`](https://github.com/es-shims/String.prototype.trimEnd/commit/f78628ab123171f8b7759bba331d6a589702584f)
|
||||
- Initial commit [`9199478`](https://github.com/es-shims/String.prototype.trimEnd/commit/9199478256da953e2f5bddfc4d82a161f4537e85)
|
||||
- typo [`d1f4558`](https://github.com/es-shims/String.prototype.trimEnd/commit/d1f4558a51157833f14d8a424426d038d06576ce)
|
21
node_modules/string.prototype.trimend/LICENSE
generated
vendored
Normal file
21
node_modules/string.prototype.trimend/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Khaled Al-Ansari
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
46
node_modules/string.prototype.trimend/README.md
generated
vendored
Normal file
46
node_modules/string.prototype.trimend/README.md
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# String.prototype.trimEnd <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![dependency status][deps-svg]][deps-url]
|
||||
[![dev dependency status][dev-deps-svg]][dev-deps-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
An ES2019-spec-compliant `String.prototype.trimEnd` shim. Invoke its "shim" method to shim `String.prototype.trimEnd` if it is unavailable.
|
||||
|
||||
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://www.ecma-international.org/ecma-262/6.0/#sec-object.assign). In an ES6 environment, it will also work properly with `Symbol`s.
|
||||
|
||||
Most common usage:
|
||||
```js
|
||||
var trimEnd = require('string.prototype.trimend');
|
||||
|
||||
assert(trimEnd(' \t\na \t\n') === 'a \t\n');
|
||||
|
||||
if (!String.prototype.trimEnd) {
|
||||
trimEnd.shim();
|
||||
}
|
||||
|
||||
assert(trimEnd(' \t\na \t\n ') === ' \t\na \t\n '.trimEnd());
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.com/package/string.prototype.trimend
|
||||
[npm-version-svg]: https://vb.teelaun.ch/es-shims/String.prototype.trimEnd.svg
|
||||
[deps-svg]: https://david-dm.org/es-shims/String.prototype.trimEnd.svg
|
||||
[deps-url]: https://david-dm.org/es-shims/String.prototype.trimEnd
|
||||
[dev-deps-svg]: https://david-dm.org/es-shims/String.prototype.trimEnd/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/es-shims/String.prototype.trimEnd#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/string.prototype.trimend.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/string.prototype.trimend.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/string.prototype.trimend.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=string.prototype.trimend
|
||||
[codecov-image]: https://codecov.io/gh/es-shims/String.prototype.trimEnd/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/es-shims/String.prototype.trimEnd/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/String.prototype.trimEnd
|
||||
[actions-url]: https://github.com/es-shims/String.prototype.trimEnd/actions
|
3
node_modules/string.prototype.trimend/auto.js
generated
vendored
Normal file
3
node_modules/string.prototype.trimend/auto.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
require('./shim')();
|
15
node_modules/string.prototype.trimend/implementation.js
generated
vendored
Normal file
15
node_modules/string.prototype.trimend/implementation.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
var $replace = callBound('String.prototype.replace');
|
||||
|
||||
var mvsIsWS = (/^\s$/).test('\u180E');
|
||||
/* eslint-disable no-control-regex */
|
||||
var endWhitespace = mvsIsWS
|
||||
? /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/
|
||||
: /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;
|
||||
/* eslint-enable no-control-regex */
|
||||
|
||||
module.exports = function trimEnd() {
|
||||
return $replace(this, endWhitespace, '');
|
||||
};
|
23
node_modules/string.prototype.trimend/index.js
generated
vendored
Normal file
23
node_modules/string.prototype.trimend/index.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
var callBind = require('call-bind');
|
||||
var define = require('define-properties');
|
||||
var RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible');
|
||||
|
||||
var implementation = require('./implementation');
|
||||
var getPolyfill = require('./polyfill');
|
||||
var shim = require('./shim');
|
||||
|
||||
var bound = callBind(getPolyfill());
|
||||
var boundMethod = function trim(receiver) {
|
||||
RequireObjectCoercible(receiver);
|
||||
return bound(receiver);
|
||||
};
|
||||
|
||||
define(boundMethod, {
|
||||
getPolyfill: getPolyfill,
|
||||
implementation: implementation,
|
||||
shim: shim
|
||||
});
|
||||
|
||||
module.exports = boundMethod;
|
79
node_modules/string.prototype.trimend/package.json
generated
vendored
Normal file
79
node_modules/string.prototype.trimend/package.json
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"name": "string.prototype.trimend",
|
||||
"version": "1.0.8",
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"contributors": [
|
||||
"Jordan Harband <ljharb@gmail.com>",
|
||||
"Khaled Al-Ansari <khaledelansari@gmail.com>"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"description": "ES2019 spec-compliant String.prototype.trimEnd shim.",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepack": "npmignore --auto --commentLines=autogenerated",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"lint": "eslint --ext=js,mjs .",
|
||||
"postlint": "es-shim-api --bound",
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --production",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"version": "auto-changelog && git add CHANGELOG.md",
|
||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/es-shims/String.prototype.trimEnd.git"
|
||||
},
|
||||
"keywords": [
|
||||
"es6",
|
||||
"es7",
|
||||
"es8",
|
||||
"javascript",
|
||||
"prototype",
|
||||
"polyfill",
|
||||
"utility",
|
||||
"trim",
|
||||
"trimLeft",
|
||||
"trimRight",
|
||||
"trimStart",
|
||||
"trimEnd",
|
||||
"tc39"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@es-shims/api": "^2.4.2",
|
||||
"@ljharb/eslint-config": "^21.1.0",
|
||||
"aud": "^2.0.4",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"eslint": "=8.8.0",
|
||||
"functions-have-names": "^1.2.3",
|
||||
"has-strict-mode": "^1.0.1",
|
||||
"in-publish": "^2.0.1",
|
||||
"npmignore": "^0.3.1",
|
||||
"nyc": "^10.3.2",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.7.5"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
},
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"ignore": [
|
||||
".github/workflows"
|
||||
]
|
||||
}
|
||||
}
|
15
node_modules/string.prototype.trimend/polyfill.js
generated
vendored
Normal file
15
node_modules/string.prototype.trimend/polyfill.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var implementation = require('./implementation');
|
||||
|
||||
module.exports = function getPolyfill() {
|
||||
if (!String.prototype.trimEnd && !String.prototype.trimRight) {
|
||||
return implementation;
|
||||
}
|
||||
var zeroWidthSpace = '\u200b';
|
||||
var trimmed = zeroWidthSpace.trimEnd ? zeroWidthSpace.trimEnd() : zeroWidthSpace.trimRight();
|
||||
if (trimmed !== zeroWidthSpace) {
|
||||
return implementation;
|
||||
}
|
||||
return String.prototype.trimEnd || String.prototype.trimRight;
|
||||
};
|
14
node_modules/string.prototype.trimend/shim.js
generated
vendored
Normal file
14
node_modules/string.prototype.trimend/shim.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var getPolyfill = require('./polyfill');
|
||||
|
||||
module.exports = function shimTrimEnd() {
|
||||
var polyfill = getPolyfill();
|
||||
define(
|
||||
String.prototype,
|
||||
{ trimEnd: polyfill },
|
||||
{ trimEnd: function () { return String.prototype.trimEnd !== polyfill; } }
|
||||
);
|
||||
return polyfill;
|
||||
};
|
20
node_modules/string.prototype.trimend/test/implementation.js
generated
vendored
Normal file
20
node_modules/string.prototype.trimend/test/implementation.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var implementation = require('../implementation');
|
||||
var callBind = require('call-bind');
|
||||
var test = require('tape');
|
||||
var hasStrictMode = require('has-strict-mode')();
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('as a function', function (t) {
|
||||
t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
|
||||
/* eslint no-useless-call: 0 */
|
||||
st['throws'](function () { implementation.call(undefined); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { implementation.call(null); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(callBind(implementation), t);
|
||||
|
||||
t.end();
|
||||
});
|
17
node_modules/string.prototype.trimend/test/index.js
generated
vendored
Normal file
17
node_modules/string.prototype.trimend/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
var trimEnd = require('../');
|
||||
var test = require('tape');
|
||||
var runTests = require('./tests');
|
||||
|
||||
test('as a function', function (t) {
|
||||
t.test('bad array/this value', function (st) {
|
||||
st['throws'](function () { trimEnd(undefined, 'a'); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { trimEnd(null, 'a'); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(trimEnd, t);
|
||||
|
||||
t.end();
|
||||
});
|
36
node_modules/string.prototype.trimend/test/shimmed.js
generated
vendored
Normal file
36
node_modules/string.prototype.trimend/test/shimmed.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
require('../auto');
|
||||
|
||||
var runTests = require('./tests');
|
||||
|
||||
var test = require('tape');
|
||||
var defineProperties = require('define-properties');
|
||||
var callBind = require('call-bind');
|
||||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
var functionsHaveNames = require('functions-have-names')();
|
||||
|
||||
test('shimmed', function (t) {
|
||||
t.equal(String.prototype.trimEnd.length, 0, 'String#trimEnd has a length of 0');
|
||||
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
|
||||
st.equal((/^(?:trimRight|trimEnd)$/).test(String.prototype.trimEnd.name), true, 'String#trimEnd has name "trimRight" or "trimEnd"');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
|
||||
et.equal(false, isEnumerable.call(String.prototype, 'trimEnd'), 'String#trimEnd is not enumerable');
|
||||
et.end();
|
||||
});
|
||||
|
||||
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
|
||||
|
||||
t.test('bad string/this value', { skip: !supportsStrictMode }, function (st) {
|
||||
st['throws'](function () { return String.prototype.trimEnd.call(undefined, 'a'); }, TypeError, 'undefined is not an object');
|
||||
st['throws'](function () { return String.prototype.trimEnd.call(null, 'a'); }, TypeError, 'null is not an object');
|
||||
st.end();
|
||||
});
|
||||
|
||||
runTests(callBind(String.prototype.trimEnd), t);
|
||||
|
||||
t.end();
|
||||
});
|
31
node_modules/string.prototype.trimend/test/tests.js
generated
vendored
Normal file
31
node_modules/string.prototype.trimend/test/tests.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (trimEnd, t) {
|
||||
t.test('normal cases', function (st) {
|
||||
st.equal(trimEnd(' \t\na \t\n'), ' \t\na', 'strips whitespace off the left side');
|
||||
st.equal(trimEnd('a'), 'a', 'noop when no whitespace');
|
||||
|
||||
var allWhitespaceChars = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
||||
st.equal(trimEnd(allWhitespaceChars + 'a' + allWhitespaceChars), allWhitespaceChars + 'a', 'all expected whitespace chars are trimmed');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
// see https://codeblog.jonskeet.uk/2014/12/01/when-is-an-identifier-not-an-identifier-attack-of-the-mongolian-vowel-separator/
|
||||
var mongolianVowelSeparator = '\u180E';
|
||||
var mvsIsWS = (/^\s$/).test(mongolianVowelSeparator);
|
||||
t.test('mongolian vowel separator: unicode >= 4 && < 6.3', function (st) {
|
||||
st.equal(
|
||||
trimEnd(mongolianVowelSeparator + 'a' + mongolianVowelSeparator),
|
||||
mongolianVowelSeparator + 'a' + (mvsIsWS ? '' : mongolianVowelSeparator),
|
||||
'mongolian vowel separator is ' + (mvsIsWS ? '' : 'not ') + 'whitespace'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('zero-width spaces', function (st) {
|
||||
var zeroWidth = '\u200b';
|
||||
st.equal(trimEnd(zeroWidth), zeroWidth, 'zero width space does not trim');
|
||||
st.end();
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user