ES2019 spec-compliant String.prototype.trimStart shim.
The npm package "string.prototype.trimstart" is a powerful utility tool that is compliant with ES2019 specifications. It is designed to enhance the functionality of string manipulations in JavaScript by trimming the start of a string. This means it removes any white space characters from the beginning of a string. The key purpose of this package is to provide developers with an efficient and reliable method to manipulate strings in their projects. The benefit of using "string.prototype.trimstart" is that it simplifies the process of string manipulation, allowing for cleaner and more efficient coding.
Developers can easily integrate this package into their projects through the command "npm install string.prototype.trimstart". This command initiates the installation process of the package into their project dependencies. Once installed, the package can be imported and used in any part of the project that requires string manipulation. This ease of integration is one of the many advantages of using npm modules in JavaScript projects.
Furthermore, the string.prototype.trimstart npm package is maintained and updated regularly to ensure that it remains compatible with the latest versions of JavaScript and npm. It also has a solid test coverage and dependency status, which makes it reliable for use in different types of projects. By using this package, developers can save time and resources that would have been spent writing and debugging custom code to achieve the same functionality.
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.trimstart code repository. View Code
An ES2019-spec-compliant String.prototype.trimStart
shim. Invoke its "shim" method to shim String.prototype.trimStart
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 trimStart = require('string.prototype.trimstart');
assert(trimStart(' \t\na \t\n') === 'a \t\n');
if (!String.prototype.trimStart) {
trimStart.shim();
}
assert(trimStart(' \t\na \t\n') === ' \t\na \t\n'.trimStart());
Simply clone the repo, npm install
, and run npm test