Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
string.prototype.split
Advanced tools
An ES spec-compliant `String.prototype.split` shim/polyfill/replacement that works as far down as ES3
An ES spec-compliant String.prototype.split
shim/polyfill/replacement that works as far down as ES3. There's a number of bugs in various browser versions that this package addresses.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.
Because String.prototype.split
depends on a receiver (the “this” value), the main export takes the string to operate on as the first argument.
var split = require('string.prototype.split');
var assert = require('assert');
assert.deepEqual(split('abc', ''), ['a', 'b', 'c']);
var split = require('string.prototype.split');
var assert = require('assert');
/* when String#split is not present */
delete String.prototype.split;
var shimmedSplit = split.shim();
assert.equal(shimmedSplit, String.prototype.split);
assert.deepEqual(shimmedSplit('abc', ''), ['a', 'b', 'c']);
var split = require('string.prototype.split');
var assert = require('assert');
/* when String#split is present */
var shimmedSplit = split.shim();
assert.equal(shimmedSplit, String.prototype.split);
assert.deepEqual(shimmedSplit('abc', ''), ['a', 'b', 'c']);
Simply clone the repo, npm install
, and run npm test
v1.0.7 - 2022-11-07
npmignore
to autogenerate an npmignore file 8937c2c
faadd00
es-abstract
, get-intrinsic
f4238bc
define-properties
, es-abstract
, regexp.prototype.flags
6ae258a
aud
, tape
c23a919
@ljharb/eslint-config
, functions-have-names
c351cf4
bb8f836
FAQs
An ES spec-compliant `String.prototype.split` shim/polyfill/replacement that works as far down as ES3
The npm package string.prototype.split receives a total of 2,242 weekly downloads. As such, string.prototype.split popularity was classified as popular.
We found that string.prototype.split demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.