ES2019 spec-compliant String.prototype.trimEnd shim.
The npm package / node module "string.prototype.trimend" is a vital tool for JavaScript developers. Its chief purpose is to provide an ES2019 spec-compliant shim for the String.prototype.trimEnd function. This function is beneficial as it removes any trailing white space from the end of a string, providing cleaner, more precise data. Its compliance with the ES2019 spec also ensures it's up-to-date and compatible with the latest JavaScript standards.
By simply typing "npm install string.prototype.trimend" into the command line, developers can easily add this valuable tool to their project. This command allows for swift installation and implementation of the package in any JavaScript environment. Once installed, it gives developers access to a reliable method for trimming the end of strings, enhancing the accuracy and efficiency of their code processing. Using "npm install string.prototype.trimend" is the first step to achieving cleaner and more manageable data in your project.
The "string.prototype.trimend" package is not just about trimming spaces off the end of a string, it's about enhancing the overall quality of data handling in JavaScript projects. By eliminating unnecessary spaces, it ensures a higher level of data accuracy and consistency. This npm package is a testament to the importance of precision and cleanliness in coding, making it a must-have tool for JavaScript developers seeking to optimize their data processing and manipulation tasks.
Core dependencies of this npm package and its dev dependencies.
call-bind, define-properties, es-object-atoms, @es-shims/api, @ljharb/eslint-config, aud, auto-changelog, eslint, functions-have-names, has-strict-mode, in-publish, npmignore, nyc, safe-publish-latest, tape
A README file for the string.prototype.trimend code repository. View Code
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 interface. It works in an ES3-supported environment and complies with the spec. In an ES6 environment, it will also work properly with Symbol
s.
Most common usage:
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());
Simply clone the repo, npm install
, and run npm test