1.2.9 • Published 1 month ago

string.prototype.trim v1.2.9

Weekly downloads
2,859,323
License
MIT
Repository
github
Last release
1 month ago

String.prototype.trim Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES5 spec-compliant String.prototype.trim shim. Invoke its "shim" method to shim String.prototype.trim if it is unavailable.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec (both ES5 and current).

Most common usage:

var assert = require('assert');
var trim = require('string.prototype.trim');

assert(trim(' \t\na \t\n') === 'a');

trim.shim(); // will be a no-op if not needed

assert(trim(' \t\na \t\n') === ' \t\na \t\n'.trim());

Engine Bugs

Some implementations of String#trim incorrectly trim zero-width spaces. This shim detects and corrects this behavior.

Tests

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

es-abstractenzymearchetype-libraryeasy-select-rn@infinitebrahmanuniverse/nolb-string_opea-bootstraapluminos-ui-coresklif-ui-kitsklif-api@everything-registry/sub-chunk-2836jawwy-sdkjawwy_gamification_release@deepakorg/test@deepak757/testreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uimachinebeemrcapsreact-native-jawwy_sampleangletearx12@aurelianoa/metadataupdatableapps-bogeg@anonybit-modules/videoreconstruction@axles/capacitor-mux@afria/afria-libraries@ali5049/react-native-buttons@amiruldev/wajs@albawid/albawidapp@albgen/capacitor-escpos-plugin@ahmed-hairon/sharing8mm487lpoawesome-module-kdappcharge-checkoutappcharge-checkout-reactjs-sdkap-vue-captchaarchlibraryarkalone-yogyakarta@beccablaster7/emin@bee-icons/qwik@born3am/eslint-configbackend-testing-core@bonsaiswap-lib/lib@bonsaiswapv3/core@bonsaiswapv3/deploybarakudaanons23@brantalikp/rn-resizebetter-tape@cetiak/cetiakaswgwaswwwww@baghoez/djarum12async-computed-vue3@borealisswap/borealis-swap-libbahenol94bagashandoyo61bangjoeletseeayenaurang@bismilah15/kintilidin15azumietea66@chakra-swap/core@cs6/react-native-test-native-view-libraryboston-essary-dropdownboskuetlampard82bloggggcapacitor-plugin-video-capturecanvas-render--rootcyberuscukul94cssesc-wbgdagangaseupandavidbeckahm45cpdek1cpdek2cpdek3cpdek4cpdek5node-polyglotns-dropdown-menunumhandleropea-bootstrapconstellation-frontendconsoleeeemyzallnaonetatehnayladanzahranative-modal-damage-vehiclenew-awesome-4321@ayi0910/tahu-bulat@bigacz/dropdown-menu@bigacz/image-sliderayang94berduayanihil1novacap-componentsdegeamunited28demo-test-scrn
1.2.9

1 month ago

1.2.8

7 months ago

1.2.7

1 year ago

1.2.6

2 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

5 years ago

1.1.2

8 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago