PHP 8.1.33
Preview: index.js Size: 459 B
//lib/node_modules/npm/node_modules/split-on-first/index.js

'use strict';

module.exports = (string, separator) => {
	if (!(typeof string === 'string' && typeof separator === 'string')) {
		throw new TypeError('Expected the arguments to be of type `string`');
	}

	if (separator === '') {
		return [string];
	}

	const separatorIndex = string.indexOf(separator);

	if (separatorIndex === -1) {
		return [string];
	}

	return [
		string.slice(0, separatorIndex),
		string.slice(separatorIndex + separator.length)
	];
};

Directory Contents

Dirs: 0 × Files: 5

Name Size Perms Modified Actions
547 B lrw-r--r-- 2021-03-10 14:36:38
Edit Download
459 B lrw-r--r-- 2021-03-10 14:36:38
Edit Download
1.08 KB lrw-r--r-- 2021-03-10 14:36:38
Edit Download
1.70 KB lrw-r--r-- 2021-03-10 14:36:38
Edit Download
1.06 KB lrw-r--r-- 2021-03-10 14:36:38
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).