| Current Path : /home/emeraadmin/public_html/4d695/ |
| Current File : /home/emeraadmin/public_html/4d695/indent-string.tar |
package.json 0000644 00000001772 15170143023 0007035 0 ustar 00 {
"_id": "indent-string@4.0.0",
"_inBundle": true,
"_location": "/npm/indent-string",
"_phantomChildren": {},
"_requiredBy": [
"/npm/aggregate-error"
],
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/indent-string/issues"
},
"description": "Indent each line in a string",
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
},
"engines": {
"node": ">=8"
},
"files": [
"index.js",
"index.d.ts"
],
"homepage": "https://github.com/sindresorhus/indent-string#readme",
"keywords": [
"indent",
"string",
"pad",
"align",
"line",
"text",
"each",
"every"
],
"license": "MIT",
"name": "indent-string",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/indent-string.git"
},
"scripts": {
"test": "xo && ava && tsd"
},
"version": "4.0.0"
}
index.js 0000644 00000001347 15170143023 0006212 0 ustar 00 'use strict';
module.exports = (string, count = 1, options) => {
options = {
indent: ' ',
includeEmptyLines: false,
...options
};
if (typeof string !== 'string') {
throw new TypeError(
`Expected \`input\` to be a \`string\`, got \`${typeof string}\``
);
}
if (typeof count !== 'number') {
throw new TypeError(
`Expected \`count\` to be a \`number\`, got \`${typeof count}\``
);
}
if (typeof options.indent !== 'string') {
throw new TypeError(
`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``
);
}
if (count === 0) {
return string;
}
const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
return string.replace(regex, options.indent.repeat(count));
};
license 0000644 00000002125 15170143023 0006105 0 ustar 00 MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.