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O,QAAU,SAAmB,EAAK,EAAK,GAC1B,iBAAR,IACV,EAAU,EACV,EAAM,IAGP,EAAU,GAAW,CAAC,EAGtB,IAAI,EAA0B,iBAAR,EAAmB,MAAM,GAAO,EAGlD,EAA0B,iBAAR,EAAmB,QAAQ,EAAK,CAAE,WAAY,EAAQ,WAAc,EAE1F,QAAoC,IAAzB,EAAQ,eAAiC,MAAM,QAAQ,EAAQ,cACzE,MAAM,IAAI,UAAU,0DAErB,IACI,GADe,EAAQ,cAAgB,qBAChB,KAAI,SAAU,EAAM,GAC9C,MAAO,MAAc,IAAN,EAAU,gBAAkB,IAAM,CAClD,IAAG,KAAK,MAEJ,EAAQ,WACX,EAAW,KAAK,EAAU,GAAG,OAAO,EAAQ,WAC5C,EAAW,KAAK,EAAU,GAAG,OAAO,EAAQ,YAI7C,IAAI,EAAoB,KAAK,EAAU,EAAU,0BAOjD,OANA,EAAW,KAAK,EAAmB,GAE/B,EAAQ,SACX,EAAW,EAAS,OAAO,GAAG,OAAO,EAAQ,UAGvC,OAAO,EAAU,KAAK,GAAW,EACzC,EAMA,OAAO,QAAQ,QAAU","file":"/npm/npmignore@0.3.5/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/npmignore@0.3.5/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nvar defaultCommentLines = [\n\t'content above this line is automatically generated and modifications may be omitted',\n\t'see npmjs.com/npmignore for more details.',\n];\nvar commentPreamble = 'npmignore - ';\nvar re = /#\\s*npmignore/;\n\n/**\n * @param {string[]} `arr`\n * @returns {string[]} uniquified array\n */\nfunction uniq(arr) {\n\tvar obj = {};\n\tvar res = [];\n\tfor (var i = 0; i < arr.length; i += 1) {\n\t\tvar key = '$' + arr[i];\n\t\tif (!(key in obj)) {\n\t\t\tres.push(arr[i]);\n\t\t\tobj[key] = true;\n\t\t}\n\t}\n\treturn res;\n}\n\n/**\n * Rebuild array back into newline delimited,\n * merging .gitignore, .npmignore extras &\n * comments (expcted output).\n *\n * @param  {String} `str`\n * @return {String}\n * @api private\n */\n\nfunction format(git, npm, commentStr) {\n\tvar gitStr = [].concat(git).join('\\n');\n\tvar npmStr = [].concat(npm).join('\\n');\n\n\tvar res = '';\n\n\tif (gitStr) {\n\t\tres += gitStr;\n\t}\n\n\tif (npmStr) {\n\t\tres += '\\n\\n' + commentStr + '\\n' + npmStr;\n\t}\n\n\treturn res.replace(/\\n?$/, '\\n');\n}\n\n/**\n * Normalize newlines and split the string into an array.\n *\n * @param  {String} `str`\n * @return {String[]}\n * @api private\n */\n\nfunction split(str) {\n\treturn (str || '\\n\\n')\n\t\t.replace(/\\r/g, '')\n\t\t.split('\\n');\n}\n\n/**\n * Remove unwanted elements and uniquify the given `array`.\n *\n * @param {string[]} `arr` The array to uniquify\n * @param {string[] | string} `remove` elements to remove\n * @return {string[]} Filtered array\n * @api private\n */\n\nfunction diff(arr, remove) {\n\tif (arr == null) {\n\t\treturn [];\n\t}\n\n\t// istanbul ignore if - Defensive code: all internal calls to diff pass non-null second argument\n\tif (remove == null) {\n\t\treturn arr;\n\t}\n\n\tvar res = [];\n\tvar len = arr.length;\n\tvar i = 0;\n\n\twhile (i < len) {\n\t\tvar ele = arr[i++];\n\n\t\tif (remove.indexOf(ele) === -1) {\n\t\t\tres.push(ele);\n\t\t}\n\t}\n\n\treturn res;\n}\n\n/**\n * Extract relevant lines from `.npmignore`\n *\n * @param  {String} `npmignore` string\n * @return {String[]} Array of lines\n */\n\nfunction extract(npmignore, options) {\n\tif (typeof npmignore !== 'string') {\n\t\tthrow new TypeError('npmignore expects a string.');\n\t}\n\n\tvar lines = split(npmignore);\n\n\tif (options.npmignored) {\n\t\treturn lines;\n\t}\n\n\tvar npmignored = false;\n\tvar git = [];\n\tvar npm = [];\n\tvar i = 0;\n\n\twhile (i < lines.length) {\n\t\tvar line = lines[i++];\n\t\tif (re.test(line)) {\n\t\t\tnpmignored = true;\n\t\t}\n\n\t\tif (npmignored) {\n\t\t\tnpm.push(line);\n\t\t} else {\n\t\t\tgit.push(line);\n\t\t}\n\t}\n\n\treturn npm;\n}\n\n/**\n * Create or update a .npmignore file.\n *\n * @param  {String} `npm` String, from `.npmignore`\n * @param  {String} `git` String, from `.gitignore`\n * @param  {Object} `options`\n * @return {String}\n */\n\nmodule.exports = function npmignore(npm, git, options) {\n\tif (typeof git !== 'string') {\n\t\toptions = git;\n\t\tgit = '';\n\t}\n\n\toptions = options || {};\n\n\t// istanbul ignore next - Defensive code: git is always normalized to string at line 152 if not already a string\n\tvar gitLines = typeof git === 'string' ? split(git) : git;\n\n\t// get the relevant lines from `.npmignore`\n\tvar npmLines = typeof npm === 'string' ? extract(npm, { npmignored: options.keepdest }) : npm;\n\n\tif (typeof options.commentLines !== 'undefined' && !Array.isArray(options.commentLines)) {\n\t\tthrow new TypeError('`commentLines` option, when provided, must be an array');\n\t}\n\tvar commentLines = options.commentLines || defaultCommentLines;\n\tvar comment = commentLines.map(function (line, i) {\n\t\treturn '# ' + (i === 0 ? commentPreamble : '') + line;\n\t}).join('\\n');\n\n\tif (options.unignore) {\n\t\tgitLines = diff(gitLines, [].concat(options.unignore));\n\t\tnpmLines = diff(npmLines, [].concat(options.unignore));\n\t}\n\n\t// Remove the comment, we re-add later\n\tvar npmLinesNoComment = diff(npmLines, comment + '#npmignore # npmignore');\n\tnpmLines = diff(npmLinesNoComment, gitLines);\n\n\tif (options.ignore) {\n\t\tnpmLines = npmLines.concat([].concat(options.ignore));\n\t}\n\n\treturn format(gitLines, uniq(npmLines), comment);\n};\n\n/**\n * Expose `extract` function\n */\n\nmodule.exports.extract = extract;\n"]}