@e-llm-studio/citation 0.0.69 → 0.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/browser.js +2 -0
- package/dist/_virtual/browser.js.map +1 -0
- package/dist/_virtual/form_data.js +2 -0
- package/dist/_virtual/form_data.js.map +1 -0
- package/dist/_virtual/index14.js +2 -0
- package/dist/_virtual/index14.js.map +1 -0
- package/dist/_virtual/index15.js +2 -0
- package/dist/_virtual/index15.js.map +1 -0
- package/dist/_virtual/index16.js +2 -0
- package/dist/_virtual/index16.js.map +1 -0
- package/dist/_virtual/index17.js +2 -0
- package/dist/_virtual/index17.js.map +1 -0
- package/dist/_virtual/index18.js +2 -0
- package/dist/_virtual/index18.js.map +1 -0
- package/dist/_virtual/index19.js +2 -0
- package/dist/_virtual/index19.js.map +1 -0
- package/dist/_virtual/node.js +2 -0
- package/dist/_virtual/node.js.map +1 -0
- package/dist/_virtual/serialOrdered.js +2 -0
- package/dist/_virtual/serialOrdered.js.map +1 -0
- package/dist/cjs/_virtual/browser.js +2 -0
- package/dist/cjs/_virtual/browser.js.map +1 -0
- package/dist/cjs/_virtual/form_data.js +2 -0
- package/dist/cjs/_virtual/form_data.js.map +1 -0
- package/dist/cjs/_virtual/index14.js +2 -0
- package/dist/cjs/_virtual/index14.js.map +1 -0
- package/dist/cjs/_virtual/index15.js +2 -0
- package/dist/cjs/_virtual/index15.js.map +1 -0
- package/dist/cjs/_virtual/index16.js +2 -0
- package/dist/cjs/_virtual/index16.js.map +1 -0
- package/dist/cjs/_virtual/index17.js +2 -0
- package/dist/cjs/_virtual/index17.js.map +1 -0
- package/dist/cjs/_virtual/index18.js +2 -0
- package/dist/cjs/_virtual/index18.js.map +1 -0
- package/dist/cjs/_virtual/index19.js +2 -0
- package/dist/cjs/_virtual/index19.js.map +1 -0
- package/dist/cjs/_virtual/node.js +2 -0
- package/dist/cjs/_virtual/node.js.map +1 -0
- package/dist/cjs/_virtual/serialOrdered.js +2 -0
- package/dist/cjs/_virtual/serialOrdered.js.map +1 -0
- package/dist/cjs/features/Bookemon/BookOverviewCard/BookOverviewCard.js +1 -1
- package/dist/cjs/features/Bookemon/BookPreview/BookPreview.js +1 -1
- package/dist/cjs/node_modules/asynckit/index.js +2 -0
- package/dist/cjs/node_modules/asynckit/index.js.map +1 -0
- package/dist/cjs/node_modules/asynckit/lib/abort.js +2 -0
- package/dist/cjs/node_modules/asynckit/lib/abort.js.map +1 -0
- package/dist/cjs/node_modules/asynckit/lib/async.js +2 -0
- package/dist/cjs/node_modules/asynckit/lib/async.js.map +1 -0
- package/dist/cjs/node_modules/asynckit/lib/defer.js +2 -0
- package/dist/cjs/node_modules/asynckit/lib/defer.js.map +1 -0
- package/dist/cjs/node_modules/asynckit/lib/iterate.js +2 -0
- package/dist/cjs/node_modules/asynckit/lib/iterate.js.map +1 -0
- package/dist/cjs/node_modules/asynckit/lib/state.js +2 -0
- package/dist/cjs/node_modules/asynckit/lib/state.js.map +1 -0
- package/dist/cjs/node_modules/asynckit/lib/terminator.js +2 -0
- package/dist/cjs/node_modules/asynckit/lib/terminator.js.map +1 -0
- package/dist/cjs/node_modules/asynckit/parallel.js +2 -0
- package/dist/cjs/node_modules/asynckit/parallel.js.map +1 -0
- package/dist/cjs/node_modules/asynckit/serial.js +2 -0
- package/dist/cjs/node_modules/asynckit/serial.js.map +1 -0
- package/dist/cjs/node_modules/asynckit/serialOrdered.js +2 -0
- package/dist/cjs/node_modules/asynckit/serialOrdered.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/adapters/http.js +2 -0
- package/dist/cjs/node_modules/axios/lib/adapters/http.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/AxiosTransformStream.js +2 -0
- package/dist/cjs/node_modules/axios/lib/helpers/AxiosTransformStream.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +2 -0
- package/dist/cjs/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/callbackify.js +2 -0
- package/dist/cjs/node_modules/axios/lib/helpers/callbackify.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/formDataToStream.js +2 -0
- package/dist/cjs/node_modules/axios/lib/helpers/formDataToStream.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/fromDataURI.js +2 -0
- package/dist/cjs/node_modules/axios/lib/helpers/fromDataURI.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/readBlob.js +2 -0
- package/dist/cjs/node_modules/axios/lib/helpers/readBlob.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/platform/node/classes/FormData.js +2 -0
- package/dist/cjs/node_modules/axios/lib/platform/node/classes/FormData.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +2 -0
- package/dist/cjs/node_modules/axios/lib/platform/node/classes/URLSearchParams.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/platform/node/index.js +2 -0
- package/dist/cjs/node_modules/axios/lib/platform/node/index.js.map +1 -0
- package/dist/cjs/node_modules/combined-stream/lib/combined_stream.js +2 -0
- package/dist/cjs/node_modules/combined-stream/lib/combined_stream.js.map +1 -0
- package/dist/cjs/node_modules/debug/src/browser.js +2 -0
- package/dist/cjs/node_modules/debug/src/browser.js.map +1 -0
- package/dist/cjs/node_modules/debug/src/common.js +2 -0
- package/dist/cjs/node_modules/debug/src/common.js.map +1 -0
- package/dist/cjs/node_modules/debug/src/index.js +2 -0
- package/dist/cjs/node_modules/debug/src/index.js.map +1 -0
- package/dist/cjs/node_modules/debug/src/node.js +2 -0
- package/dist/cjs/node_modules/debug/src/node.js.map +1 -0
- package/dist/cjs/node_modules/decode-named-character-reference/index.js +2 -0
- package/dist/cjs/node_modules/decode-named-character-reference/index.js.map +1 -0
- package/dist/cjs/node_modules/decode-named-character-reference/node_modules/character-entities/index.js +2 -0
- package/dist/cjs/node_modules/decode-named-character-reference/node_modules/character-entities/index.js.map +1 -0
- package/dist/cjs/node_modules/delayed-stream/lib/delayed_stream.js +2 -0
- package/dist/cjs/node_modules/delayed-stream/lib/delayed_stream.js.map +1 -0
- package/dist/cjs/node_modules/follow-redirects/debug.js +2 -0
- package/dist/cjs/node_modules/follow-redirects/debug.js.map +1 -0
- package/dist/cjs/node_modules/follow-redirects/index.js +2 -0
- package/dist/cjs/node_modules/follow-redirects/index.js.map +1 -0
- package/dist/cjs/node_modules/form-data/lib/form_data.js +2 -0
- package/dist/cjs/node_modules/form-data/lib/form_data.js.map +1 -0
- package/dist/cjs/node_modules/form-data/lib/populate.js +2 -0
- package/dist/cjs/node_modules/form-data/lib/populate.js.map +1 -0
- package/dist/cjs/node_modules/has-flag/index.js +2 -0
- package/dist/cjs/node_modules/has-flag/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents/lib/color.js +2 -0
- package/dist/cjs/node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-find-and-replace/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-find-and-replace/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-newline-to-break/lib/index.js +2 -0
- package/dist/cjs/node_modules/mdast-util-newline-to-break/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/mdast-util-to-hast/node_modules/unist-util-visit-parents/lib/color.js +2 -0
- package/dist/cjs/node_modules/mdast-util-to-hast/node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
- package/dist/cjs/node_modules/mime-db/db.json.js +2 -0
- package/dist/cjs/node_modules/mime-db/db.json.js.map +1 -0
- package/dist/cjs/node_modules/mime-db/index.js +8 -0
- package/dist/cjs/node_modules/mime-db/index.js.map +1 -0
- package/dist/cjs/node_modules/mime-types/index.js +8 -0
- package/dist/cjs/node_modules/mime-types/index.js.map +1 -0
- package/dist/cjs/node_modules/ms/index.js +2 -0
- package/dist/cjs/node_modules/ms/index.js.map +1 -0
- package/dist/cjs/node_modules/proxy-from-env/index.js +2 -0
- package/dist/cjs/node_modules/proxy-from-env/index.js.map +1 -0
- package/dist/cjs/node_modules/react-markdown/node_modules/unist-util-visit-parents/lib/color.js +2 -0
- package/dist/cjs/node_modules/react-markdown/node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
- package/dist/cjs/node_modules/react-resizable-panels/dist/react-resizable-panels.js +2 -0
- package/dist/cjs/node_modules/react-resizable-panels/dist/react-resizable-panels.js.map +1 -0
- package/dist/cjs/node_modules/remark-breaks/lib/index.js +2 -0
- package/dist/cjs/node_modules/remark-breaks/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/supports-color/index.js +2 -0
- package/dist/cjs/node_modules/supports-color/index.js.map +1 -0
- package/dist/features/Bookemon/BookOverviewCard/BookOverviewCard.js +1 -1
- package/dist/features/Bookemon/BookPreview/BookPreview.js +1 -1
- package/dist/node_modules/asynckit/index.js +2 -0
- package/dist/node_modules/asynckit/index.js.map +1 -0
- package/dist/node_modules/asynckit/lib/abort.js +2 -0
- package/dist/node_modules/asynckit/lib/abort.js.map +1 -0
- package/dist/node_modules/asynckit/lib/async.js +2 -0
- package/dist/node_modules/asynckit/lib/async.js.map +1 -0
- package/dist/node_modules/asynckit/lib/defer.js +2 -0
- package/dist/node_modules/asynckit/lib/defer.js.map +1 -0
- package/dist/node_modules/asynckit/lib/iterate.js +2 -0
- package/dist/node_modules/asynckit/lib/iterate.js.map +1 -0
- package/dist/node_modules/asynckit/lib/state.js +2 -0
- package/dist/node_modules/asynckit/lib/state.js.map +1 -0
- package/dist/node_modules/asynckit/lib/terminator.js +2 -0
- package/dist/node_modules/asynckit/lib/terminator.js.map +1 -0
- package/dist/node_modules/asynckit/parallel.js +2 -0
- package/dist/node_modules/asynckit/parallel.js.map +1 -0
- package/dist/node_modules/asynckit/serial.js +2 -0
- package/dist/node_modules/asynckit/serial.js.map +1 -0
- package/dist/node_modules/asynckit/serialOrdered.js +2 -0
- package/dist/node_modules/asynckit/serialOrdered.js.map +1 -0
- package/dist/node_modules/axios/lib/adapters/http.js +2 -0
- package/dist/node_modules/axios/lib/adapters/http.js.map +1 -0
- package/dist/node_modules/axios/lib/helpers/AxiosTransformStream.js +2 -0
- package/dist/node_modules/axios/lib/helpers/AxiosTransformStream.js.map +1 -0
- package/dist/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +2 -0
- package/dist/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js.map +1 -0
- package/dist/node_modules/axios/lib/helpers/callbackify.js +2 -0
- package/dist/node_modules/axios/lib/helpers/callbackify.js.map +1 -0
- package/dist/node_modules/axios/lib/helpers/formDataToStream.js +2 -0
- package/dist/node_modules/axios/lib/helpers/formDataToStream.js.map +1 -0
- package/dist/node_modules/axios/lib/helpers/fromDataURI.js +2 -0
- package/dist/node_modules/axios/lib/helpers/fromDataURI.js.map +1 -0
- package/dist/node_modules/axios/lib/helpers/readBlob.js +2 -0
- package/dist/node_modules/axios/lib/helpers/readBlob.js.map +1 -0
- package/dist/node_modules/axios/lib/platform/node/classes/FormData.js +2 -0
- package/dist/node_modules/axios/lib/platform/node/classes/FormData.js.map +1 -0
- package/dist/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +2 -0
- package/dist/node_modules/axios/lib/platform/node/classes/URLSearchParams.js.map +1 -0
- package/dist/node_modules/axios/lib/platform/node/index.js +2 -0
- package/dist/node_modules/axios/lib/platform/node/index.js.map +1 -0
- package/dist/node_modules/combined-stream/lib/combined_stream.js +2 -0
- package/dist/node_modules/combined-stream/lib/combined_stream.js.map +1 -0
- package/dist/node_modules/debug/src/browser.js +2 -0
- package/dist/node_modules/debug/src/browser.js.map +1 -0
- package/dist/node_modules/debug/src/common.js +2 -0
- package/dist/node_modules/debug/src/common.js.map +1 -0
- package/dist/node_modules/debug/src/index.js +2 -0
- package/dist/node_modules/debug/src/index.js.map +1 -0
- package/dist/node_modules/debug/src/node.js +2 -0
- package/dist/node_modules/debug/src/node.js.map +1 -0
- package/dist/node_modules/decode-named-character-reference/index.js +2 -0
- package/dist/node_modules/decode-named-character-reference/index.js.map +1 -0
- package/dist/node_modules/decode-named-character-reference/node_modules/character-entities/index.js +2 -0
- package/dist/node_modules/decode-named-character-reference/node_modules/character-entities/index.js.map +1 -0
- package/dist/node_modules/delayed-stream/lib/delayed_stream.js +2 -0
- package/dist/node_modules/delayed-stream/lib/delayed_stream.js.map +1 -0
- package/dist/node_modules/follow-redirects/debug.js +2 -0
- package/dist/node_modules/follow-redirects/debug.js.map +1 -0
- package/dist/node_modules/follow-redirects/index.js +2 -0
- package/dist/node_modules/follow-redirects/index.js.map +1 -0
- package/dist/node_modules/form-data/lib/form_data.js +2 -0
- package/dist/node_modules/form-data/lib/form_data.js.map +1 -0
- package/dist/node_modules/form-data/lib/populate.js +2 -0
- package/dist/node_modules/form-data/lib/populate.js.map +1 -0
- package/dist/node_modules/has-flag/index.js +2 -0
- package/dist/node_modules/has-flag/index.js.map +1 -0
- package/dist/node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents/lib/color.js +2 -0
- package/dist/node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
- package/dist/node_modules/mdast-util-find-and-replace/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-find-and-replace/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js +2 -0
- package/dist/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js.map +1 -0
- package/dist/node_modules/mdast-util-newline-to-break/lib/index.js +2 -0
- package/dist/node_modules/mdast-util-newline-to-break/lib/index.js.map +1 -0
- package/dist/node_modules/mdast-util-to-hast/node_modules/unist-util-visit-parents/lib/color.js +2 -0
- package/dist/node_modules/mdast-util-to-hast/node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
- package/dist/node_modules/mime-db/db.json.js +2 -0
- package/dist/node_modules/mime-db/db.json.js.map +1 -0
- package/dist/node_modules/mime-db/index.js +8 -0
- package/dist/node_modules/mime-db/index.js.map +1 -0
- package/dist/node_modules/mime-types/index.js +8 -0
- package/dist/node_modules/mime-types/index.js.map +1 -0
- package/dist/node_modules/ms/index.js +2 -0
- package/dist/node_modules/ms/index.js.map +1 -0
- package/dist/node_modules/proxy-from-env/index.js +2 -0
- package/dist/node_modules/proxy-from-env/index.js.map +1 -0
- package/dist/node_modules/react-markdown/node_modules/unist-util-visit-parents/lib/color.js +2 -0
- package/dist/node_modules/react-markdown/node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
- package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.js +2 -0
- package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.js.map +1 -0
- package/dist/node_modules/remark-breaks/lib/index.js +2 -0
- package/dist/node_modules/remark-breaks/lib/index.js.map +1 -0
- package/dist/node_modules/supports-color/index.js +2 -0
- package/dist/node_modules/supports-color/index.js.map +1 -0
- package/dist/types/src/BookemonTest.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/BookOverviewCard/BookOverviewCard.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/BookPreview/BookPreview.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form_data.js","sources":["../../../../node_modules/form-data/lib/form_data.js"],"sourcesContent":["var CombinedStream = require('combined-stream');\nvar util = require('util');\nvar path = require('path');\nvar http = require('http');\nvar https = require('https');\nvar parseUrl = require('url').parse;\nvar fs = require('fs');\nvar Stream = require('stream').Stream;\nvar mime = require('mime-types');\nvar asynckit = require('asynckit');\nvar populate = require('./populate.js');\n\n// Public API\nmodule.exports = FormData;\n\n// make it a Stream\nutil.inherits(FormData, CombinedStream);\n\n/**\n * Create readable \"multipart/form-data\" streams.\n * Can be used to submit forms\n * and file uploads to other web applications.\n *\n * @constructor\n * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream\n */\nfunction FormData(options) {\n if (!(this instanceof FormData)) {\n return new FormData(options);\n }\n\n this._overheadLength = 0;\n this._valueLength = 0;\n this._valuesToMeasure = [];\n\n CombinedStream.call(this);\n\n options = options || {};\n for (var option in options) {\n this[option] = options[option];\n }\n}\n\nFormData.LINE_BREAK = '\\r\\n';\nFormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';\n\nFormData.prototype.append = function(field, value, options) {\n\n options = options || {};\n\n // allow filename as single option\n if (typeof options == 'string') {\n options = {filename: options};\n }\n\n var append = CombinedStream.prototype.append.bind(this);\n\n // all that streamy business can't handle numbers\n if (typeof value == 'number') {\n value = '' + value;\n }\n\n // https://github.com/felixge/node-form-data/issues/38\n if (Array.isArray(value)) {\n // Please convert your array into string\n // the way web server expects it\n this._error(new Error('Arrays are not supported.'));\n return;\n }\n\n var header = this._multiPartHeader(field, value, options);\n var footer = this._multiPartFooter();\n\n append(header);\n append(value);\n append(footer);\n\n // pass along options.knownLength\n this._trackLength(header, value, options);\n};\n\nFormData.prototype._trackLength = function(header, value, options) {\n var valueLength = 0;\n\n // used w/ getLengthSync(), when length is known.\n // e.g. for streaming directly from a remote server,\n // w/ a known file a size, and not wanting to wait for\n // incoming file to finish to get its size.\n if (options.knownLength != null) {\n valueLength += +options.knownLength;\n } else if (Buffer.isBuffer(value)) {\n valueLength = value.length;\n } else if (typeof value === 'string') {\n valueLength = Buffer.byteLength(value);\n }\n\n this._valueLength += valueLength;\n\n // @check why add CRLF? does this account for custom/multiple CRLFs?\n this._overheadLength +=\n Buffer.byteLength(header) +\n FormData.LINE_BREAK.length;\n\n // empty or either doesn't have path or not an http response or not a stream\n if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) {\n return;\n }\n\n // no need to bother with the length\n if (!options.knownLength) {\n this._valuesToMeasure.push(value);\n }\n};\n\nFormData.prototype._lengthRetriever = function(value, callback) {\n\n if (value.hasOwnProperty('fd')) {\n\n // take read range into a account\n // `end` = Infinity –> read file till the end\n //\n // TODO: Looks like there is bug in Node fs.createReadStream\n // it doesn't respect `end` options without `start` options\n // Fix it when node fixes it.\n // https://github.com/joyent/node/issues/7819\n if (value.end != undefined && value.end != Infinity && value.start != undefined) {\n\n // when end specified\n // no need to calculate range\n // inclusive, starts with 0\n callback(null, value.end + 1 - (value.start ? value.start : 0));\n\n // not that fast snoopy\n } else {\n // still need to fetch file size from fs\n fs.stat(value.path, function(err, stat) {\n\n var fileSize;\n\n if (err) {\n callback(err);\n return;\n }\n\n // update final size based on the range options\n fileSize = stat.size - (value.start ? value.start : 0);\n callback(null, fileSize);\n });\n }\n\n // or http response\n } else if (value.hasOwnProperty('httpVersion')) {\n callback(null, +value.headers['content-length']);\n\n // or request stream http://github.com/mikeal/request\n } else if (value.hasOwnProperty('httpModule')) {\n // wait till response come back\n value.on('response', function(response) {\n value.pause();\n callback(null, +response.headers['content-length']);\n });\n value.resume();\n\n // something else\n } else {\n callback('Unknown stream');\n }\n};\n\nFormData.prototype._multiPartHeader = function(field, value, options) {\n // custom header specified (as string)?\n // it becomes responsible for boundary\n // (e.g. to handle extra CRLFs on .NET servers)\n if (typeof options.header == 'string') {\n return options.header;\n }\n\n var contentDisposition = this._getContentDisposition(value, options);\n var contentType = this._getContentType(value, options);\n\n var contents = '';\n var headers = {\n // add custom disposition as third element or keep it two elements if not\n 'Content-Disposition': ['form-data', 'name=\"' + field + '\"'].concat(contentDisposition || []),\n // if no content type. allow it to be empty array\n 'Content-Type': [].concat(contentType || [])\n };\n\n // allow custom headers.\n if (typeof options.header == 'object') {\n populate(headers, options.header);\n }\n\n var header;\n for (var prop in headers) {\n if (!headers.hasOwnProperty(prop)) continue;\n header = headers[prop];\n\n // skip nullish headers.\n if (header == null) {\n continue;\n }\n\n // convert all headers to arrays.\n if (!Array.isArray(header)) {\n header = [header];\n }\n\n // add non-empty headers.\n if (header.length) {\n contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;\n }\n }\n\n return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;\n};\n\nFormData.prototype._getContentDisposition = function(value, options) {\n\n var filename\n , contentDisposition\n ;\n\n if (typeof options.filepath === 'string') {\n // custom filepath for relative paths\n filename = path.normalize(options.filepath).replace(/\\\\/g, '/');\n } else if (options.filename || value.name || value.path) {\n // custom filename take precedence\n // formidable and the browser add a name property\n // fs- and request- streams have path property\n filename = path.basename(options.filename || value.name || value.path);\n } else if (value.readable && value.hasOwnProperty('httpVersion')) {\n // or try http response\n filename = path.basename(value.client._httpMessage.path || '');\n }\n\n if (filename) {\n contentDisposition = 'filename=\"' + filename + '\"';\n }\n\n return contentDisposition;\n};\n\nFormData.prototype._getContentType = function(value, options) {\n\n // use custom content-type above all\n var contentType = options.contentType;\n\n // or try `name` from formidable, browser\n if (!contentType && value.name) {\n contentType = mime.lookup(value.name);\n }\n\n // or try `path` from fs-, request- streams\n if (!contentType && value.path) {\n contentType = mime.lookup(value.path);\n }\n\n // or if it's http-reponse\n if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {\n contentType = value.headers['content-type'];\n }\n\n // or guess it from the filepath or filename\n if (!contentType && (options.filepath || options.filename)) {\n contentType = mime.lookup(options.filepath || options.filename);\n }\n\n // fallback to the default content type if `value` is not simple value\n if (!contentType && typeof value == 'object') {\n contentType = FormData.DEFAULT_CONTENT_TYPE;\n }\n\n return contentType;\n};\n\nFormData.prototype._multiPartFooter = function() {\n return function(next) {\n var footer = FormData.LINE_BREAK;\n\n var lastPart = (this._streams.length === 0);\n if (lastPart) {\n footer += this._lastBoundary();\n }\n\n next(footer);\n }.bind(this);\n};\n\nFormData.prototype._lastBoundary = function() {\n return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;\n};\n\nFormData.prototype.getHeaders = function(userHeaders) {\n var header;\n var formHeaders = {\n 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()\n };\n\n for (header in userHeaders) {\n if (userHeaders.hasOwnProperty(header)) {\n formHeaders[header.toLowerCase()] = userHeaders[header];\n }\n }\n\n return formHeaders;\n};\n\nFormData.prototype.setBoundary = function(boundary) {\n this._boundary = boundary;\n};\n\nFormData.prototype.getBoundary = function() {\n if (!this._boundary) {\n this._generateBoundary();\n }\n\n return this._boundary;\n};\n\nFormData.prototype.getBuffer = function() {\n var dataBuffer = new Buffer.alloc( 0 );\n var boundary = this.getBoundary();\n\n // Create the form content. Add Line breaks to the end of data.\n for (var i = 0, len = this._streams.length; i < len; i++) {\n if (typeof this._streams[i] !== 'function') {\n\n // Add content to the buffer.\n if(Buffer.isBuffer(this._streams[i])) {\n dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]);\n }else {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]);\n }\n\n // Add break after content.\n if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] );\n }\n }\n }\n\n // Add the footer and return the Buffer object.\n return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] );\n};\n\nFormData.prototype._generateBoundary = function() {\n // This generates a 50 character boundary similar to those used by Firefox.\n // They are optimized for boyer-moore parsing.\n var boundary = '--------------------------';\n for (var i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16);\n }\n\n this._boundary = boundary;\n};\n\n// Note: getLengthSync DOESN'T calculate streams length\n// As workaround one can calculate file size manually\n// and add it as knownLength option\nFormData.prototype.getLengthSync = function() {\n var knownLength = this._overheadLength + this._valueLength;\n\n // Don't get confused, there are 3 \"internal\" streams for each keyval pair\n // so it basically checks if there is any value added to the form\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n // https://github.com/form-data/form-data/issues/40\n if (!this.hasKnownLength()) {\n // Some async length retrievers are present\n // therefore synchronous length calculation is false.\n // Please use getLength(callback) to get proper length\n this._error(new Error('Cannot calculate proper length in synchronous way.'));\n }\n\n return knownLength;\n};\n\n// Public API to check if length of added values is known\n// https://github.com/form-data/form-data/issues/196\n// https://github.com/form-data/form-data/issues/262\nFormData.prototype.hasKnownLength = function() {\n var hasKnownLength = true;\n\n if (this._valuesToMeasure.length) {\n hasKnownLength = false;\n }\n\n return hasKnownLength;\n};\n\nFormData.prototype.getLength = function(cb) {\n var knownLength = this._overheadLength + this._valueLength;\n\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n if (!this._valuesToMeasure.length) {\n process.nextTick(cb.bind(this, null, knownLength));\n return;\n }\n\n asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {\n if (err) {\n cb(err);\n return;\n }\n\n values.forEach(function(length) {\n knownLength += length;\n });\n\n cb(null, knownLength);\n });\n};\n\nFormData.prototype.submit = function(params, cb) {\n var request\n , options\n , defaults = {method: 'post'}\n ;\n\n // parse provided url if it's string\n // or treat it as options object\n if (typeof params == 'string') {\n\n params = parseUrl(params);\n options = populate({\n port: params.port,\n path: params.pathname,\n host: params.hostname,\n protocol: params.protocol\n }, defaults);\n\n // use custom params\n } else {\n\n options = populate(params, defaults);\n // if no port provided use default one\n if (!options.port) {\n options.port = options.protocol == 'https:' ? 443 : 80;\n }\n }\n\n // put that good code in getHeaders to some use\n options.headers = this.getHeaders(params.headers);\n\n // https if specified, fallback to http in any other case\n if (options.protocol == 'https:') {\n request = https.request(options);\n } else {\n request = http.request(options);\n }\n\n // get content length and fire away\n this.getLength(function(err, length) {\n if (err && err !== 'Unknown stream') {\n this._error(err);\n return;\n }\n\n // add content length\n if (length) {\n request.setHeader('Content-Length', length);\n }\n\n this.pipe(request);\n if (cb) {\n var onResponse;\n\n var callback = function (error, responce) {\n request.removeListener('error', callback);\n request.removeListener('response', onResponse);\n\n return cb.call(this, error, responce);\n };\n\n onResponse = callback.bind(this, null);\n\n request.on('error', callback);\n request.on('response', onResponse);\n }\n }.bind(this));\n\n return request;\n};\n\nFormData.prototype._error = function(err) {\n if (!this.error) {\n this.error = err;\n this.pause();\n this.emit('error', err);\n }\n};\n\nFormData.prototype.toString = function () {\n return '[object FormData]';\n};\n"],"names":["CombinedStream","require$$0","util","require$$1","path","require$$2","http","require$$3","https","require$$4","parseUrl","require$$5","parse","fs","require$$6","Stream","require$$7","mime","require$$8","asynckit","require$$9","populate","require$$10","FormData","options","this","option","_overheadLength","_valueLength","_valuesToMeasure","call","form_data","inherits","LINE_BREAK","DEFAULT_CONTENT_TYPE","prototype","append","field","value","filename","bind","Array","isArray","_error","Error","header","_multiPartHeader","footer","_multiPartFooter","_trackLength","valueLength","knownLength","Buffer","isBuffer","length","byteLength","readable","hasOwnProperty","push","_lengthRetriever","callback","undefined","end","Infinity","start","stat","err","fileSize","size","headers","on","response","pause","resume","contentDisposition","_getContentDisposition","contentType","_getContentType","contents","concat","prop","join","getBoundary","filepath","normalize","replace","name","basename","client","_httpMessage","lookup","next","_streams","_lastBoundary","getHeaders","userHeaders","formHeaders","toLowerCase","setBoundary","boundary","_boundary","_generateBoundary","getBuffer","dataBuffer","alloc","i","len","from","substring","Math","floor","random","toString","getLengthSync","hasKnownLength","getLength","cb","parallel","values","forEach","process","nextTick","submit","params","request","defaults","method","port","pathname","host","hostname","protocol","setHeader","pipe","onResponse","error","responce","removeListener","emit"],"mappings":"gZAAA,IAAIA,EAAiBC,IACjBC,EAAOC,EACPC,EAAOC,EACPC,EAAOC,EACPC,EAAQC,EACRC,EAAWC,EAAeC,MAC1BC,EAAKC,EACLC,EAASC,EAAkBD,OAC3BE,EAAOC,IACPC,EAAWC,IACXC,EAAWC,IAgBf,SAASC,EAASC,GAChB,KAAMC,gBAAgBF,GACpB,OAAO,IAAIA,EAASC,GAUtB,IAAK,IAAIE,KAPTD,KAAKE,gBAAkB,EACvBF,KAAKG,aAAe,EACpBH,KAAKI,iBAAmB,GAExB7B,EAAe8B,KAAKL,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G,QAASV,GACpBgE,EAAQtD,GAAG,WAAYgE,EAC7B,CACA,EAAI9F,KAAKf,OAEAmG,GAGTrG,EAASY,UAAUQ,OAAS,SAASuB,GAC9BzC,KAAK8G,QACR9G,KAAK8G,MAAQrE,EACbzC,KAAK+C,QACL/C,KAAKiH,KAAK,QAASxE,KAIvB3C,EAASY,UAAU6E,SAAW,WAC5B,MAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"populate.js","sources":["../../../../node_modules/form-data/lib/populate.js"],"sourcesContent":["// populates missing values\nmodule.exports = function(dst, src) {\n\n Object.keys(src).forEach(function(prop)\n {\n dst[prop] = dst[prop] || src[prop];\n });\n\n return dst;\n};\n"],"names":["populate","dst","src","Object","keys","forEach","prop"],"mappings":"qCACAA,EAAiB,SAASC,EAAKC,GAO7B,OALAC,OAAOC,KAAKF,GAAKG,SAAQ,SAASC,GAEhCL,EAAIK,GAAQL,EAAIK,IAASJ,EAAII,EACjC,IAESL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/has-flag/index.js"],"sourcesContent":["'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n"],"names":["hasFlag","flag","argv","process","prefix","startsWith","length","position","indexOf","terminatorPosition"],"mappings":"qCAEcA,EAAG,CAACC,EAAMC,EAAOC,QAAQD,QACtC,MAAME,EAASH,EAAKI,WAAW,KAAO,GAAsB,IAAhBJ,EAAKK,OAAe,IAAM,KAChEC,EAAWL,EAAKM,QAAQJ,EAASH,GACjCQ,EAAqBP,EAAKM,QAAQ,MACxC,OAAqB,IAAdD,KAA4C,IAAxBE,GAA6BF,EAAWE,EAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.js","sources":["../../../../../../node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents/lib/color.js"],"sourcesContent":["/**\n * @param {string} d\n * @returns {string}\n */\nexport function color(d) {\n return '\\u001B[33m' + d + '\\u001B[39m'\n}\n"],"names":["color","d"],"mappings":"AAIO,SAASA,EAAMC,GACpB,MAAO,QAAeA,EAAI,OAC5B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"../node_modules/escape-string-regexp/index.js";import{visitParents as t}from"../../unist-util-visit-parents/lib/index.js";import{convert as n}from"../../unist-util-is/lib/index.js";function r(e,r,o){const s=n((o||{}).ignore||[]),u=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([i(e[0]),l(e[1])])}return t}(r);let c=-1;for(;++c<u.length;)t(e,"text",p);function p(e,t){let n,r=-1;for(;++r<t.length;){const e=t[r],i=n?n.children:void 0;if(s(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=u[c][0],i=u[c][1];let l=0;const o=n.children.indexOf(e);let s=!1,p=[];r.lastIndex=0;let f=r.exec(e.value);for(;f;){const n=f.index,o={index:f.index,input:f.input,stack:[...t,e]};let u=i(...f,o);if("string"==typeof u&&(u=u.length>0?{type:"text",value:u}:void 0),!1===u?r.lastIndex=n+1:(l!==n&&p.push({type:"text",value:e.value.slice(l,n)}),Array.isArray(u)?p.push(...u):u&&p.push(u),l=n+f[0].length,s=!0),!r.global)break;f=r.exec(e.value)}s?(l<e.value.length&&p.push({type:"text",value:e.value.slice(l)}),n.children.splice(o,1,...p)):p=[e];return o+p.length}(e,t)}}function i(t){return"string"==typeof t?new RegExp(e(t),"g"):t}function l(e){return"function"==typeof e?e:function(){return e}}export{r as findAndReplace};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/mdast-util-find-and-replace/lib/index.js"],"sourcesContent":["/**\n * @import {Nodes, Parents, PhrasingContent, Root, Text} from 'mdast'\n * @import {BuildVisitor, Test, VisitorResult} from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef RegExpMatchObject\n * Info on the match.\n * @property {number} index\n * The index of the search at which the result was found.\n * @property {string} input\n * A copy of the search string in the text node.\n * @property {[...Array<Parents>, Text]} stack\n * All ancestors of the text node, where the last node is the text itself.\n *\n * @typedef {RegExp | string} Find\n * Pattern to find.\n *\n * Strings are escaped and then turned into global expressions.\n *\n * @typedef {Array<FindAndReplaceTuple>} FindAndReplaceList\n * Several find and replaces, in array form.\n *\n * @typedef {[Find, Replace?]} FindAndReplaceTuple\n * Find and replace in tuple form.\n *\n * @typedef {ReplaceFunction | string | null | undefined} Replace\n * Thing to replace with.\n *\n * @callback ReplaceFunction\n * Callback called when a search matches.\n * @param {...any} parameters\n * The parameters are the result of corresponding search expression:\n *\n * * `value` (`string`) — whole match\n * * `...capture` (`Array<string>`) — matches from regex capture groups\n * * `match` (`RegExpMatchObject`) — info on the match\n * @returns {Array<PhrasingContent> | PhrasingContent | string | false | null | undefined}\n * Thing to replace with.\n *\n * * when `null`, `undefined`, `''`, remove the match\n * * …or when `false`, do not replace at all\n * * …or when `string`, replace with a text node of that value\n * * …or when `Node` or `Array<Node>`, replace with those nodes\n *\n * @typedef {[RegExp, ReplaceFunction]} Pair\n * Normalized find and replace.\n *\n * @typedef {Array<Pair>} Pairs\n * All find and replaced.\n *\n * @typedef Options\n * Configuration.\n * @property {Test | null | undefined} [ignore]\n * Test for which nodes to ignore (optional).\n */\n\nimport escape from 'escape-string-regexp'\nimport {visitParents} from 'unist-util-visit-parents'\nimport {convert} from 'unist-util-is'\n\n/**\n * Find patterns in a tree and replace them.\n *\n * The algorithm searches the tree in *preorder* for complete values in `Text`\n * nodes.\n * Partial matches are not supported.\n *\n * @param {Nodes} tree\n * Tree to change.\n * @param {FindAndReplaceList | FindAndReplaceTuple} list\n * Patterns to find.\n * @param {Options | null | undefined} [options]\n * Configuration (when `find` is not `Find`).\n * @returns {undefined}\n * Nothing.\n */\nexport function findAndReplace(tree, list, options) {\n const settings = options || {}\n const ignored = convert(settings.ignore || [])\n const pairs = toPairs(list)\n let pairIndex = -1\n\n while (++pairIndex < pairs.length) {\n visitParents(tree, 'text', visitor)\n }\n\n /** @type {BuildVisitor<Root, 'text'>} */\n function visitor(node, parents) {\n let index = -1\n /** @type {Parents | undefined} */\n let grandparent\n\n while (++index < parents.length) {\n const parent = parents[index]\n /** @type {Array<Nodes> | undefined} */\n const siblings = grandparent ? grandparent.children : undefined\n\n if (\n ignored(\n parent,\n siblings ? siblings.indexOf(parent) : undefined,\n grandparent\n )\n ) {\n return\n }\n\n grandparent = parent\n }\n\n if (grandparent) {\n return handler(node, parents)\n }\n }\n\n /**\n * Handle a text node which is not in an ignored parent.\n *\n * @param {Text} node\n * Text node.\n * @param {Array<Parents>} parents\n * Parents.\n * @returns {VisitorResult}\n * Result.\n */\n function handler(node, parents) {\n const parent = parents[parents.length - 1]\n const find = pairs[pairIndex][0]\n const replace = pairs[pairIndex][1]\n let start = 0\n /** @type {Array<Nodes>} */\n const siblings = parent.children\n const index = siblings.indexOf(node)\n let change = false\n /** @type {Array<PhrasingContent>} */\n let nodes = []\n\n find.lastIndex = 0\n\n let match = find.exec(node.value)\n\n while (match) {\n const position = match.index\n /** @type {RegExpMatchObject} */\n const matchObject = {\n index: match.index,\n input: match.input,\n stack: [...parents, node]\n }\n let value = replace(...match, matchObject)\n\n if (typeof value === 'string') {\n value = value.length > 0 ? {type: 'text', value} : undefined\n }\n\n // It wasn’t a match after all.\n if (value === false) {\n // False acts as if there was no match.\n // So we need to reset `lastIndex`, which currently being at the end of\n // the current match, to the beginning.\n find.lastIndex = position + 1\n } else {\n if (start !== position) {\n nodes.push({\n type: 'text',\n value: node.value.slice(start, position)\n })\n }\n\n if (Array.isArray(value)) {\n nodes.push(...value)\n } else if (value) {\n nodes.push(value)\n }\n\n start = position + match[0].length\n change = true\n }\n\n if (!find.global) {\n break\n }\n\n match = find.exec(node.value)\n }\n\n if (change) {\n if (start < node.value.length) {\n nodes.push({type: 'text', value: node.value.slice(start)})\n }\n\n parent.children.splice(index, 1, ...nodes)\n } else {\n nodes = [node]\n }\n\n return index + nodes.length\n }\n}\n\n/**\n * Turn a tuple or a list of tuples into pairs.\n *\n * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList\n * Schema.\n * @returns {Pairs}\n * Clean pairs.\n */\nfunction toPairs(tupleOrList) {\n /** @type {Pairs} */\n const result = []\n\n if (!Array.isArray(tupleOrList)) {\n throw new TypeError('Expected find and replace tuple or list of tuples')\n }\n\n /** @type {FindAndReplaceList} */\n // @ts-expect-error: correct.\n const list =\n !tupleOrList[0] || Array.isArray(tupleOrList[0])\n ? tupleOrList\n : [tupleOrList]\n\n let index = -1\n\n while (++index < list.length) {\n const tuple = list[index]\n result.push([toExpression(tuple[0]), toFunction(tuple[1])])\n }\n\n return result\n}\n\n/**\n * Turn a find into an expression.\n *\n * @param {Find} find\n * Find.\n * @returns {RegExp}\n * Expression.\n */\nfunction toExpression(find) {\n return typeof find === 'string' ? new RegExp(escape(find), 'g') : find\n}\n\n/**\n * Turn a replace into a function.\n *\n * @param {Replace} replace\n * Replace.\n * @returns {ReplaceFunction}\n * Function.\n */\nfunction toFunction(replace) {\n return typeof replace === 'function'\n ? replace\n : function () {\n return replace\n }\n}\n"],"names":["findAndReplace","tree","list","options","ignored","convert","ignore","pairs","tupleOrList","result","Array","isArray","TypeError","index","length","tuple","push","toExpression","toFunction","toPairs","pairIndex","visitParents","visitor","node","parents","grandparent","parent","siblings","children","undefined","indexOf","find","replace","start","change","nodes","lastIndex","match","exec","value","position","matchObject","input","stack","type","slice","global","splice","handler","RegExp","escape"],"mappings":"mMA6EO,SAASA,EAAeC,EAAMC,EAAMC,GACzC,MACMC,EAAUC,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AAC8B,KAAM,OAAQL,cAASV,IAIvC,IAAVU,EAIFR,EAAKK,UAAYI,EAAW,GAExBP,IAAUO,GACZL,EAAMnB,KAAK,CACT4B,KAAM,OACNL,MAAOhB,EAAKgB,MAAMM,MAAMZ,EAAOO,KAI/B9B,MAAMC,QAAQ4B,GAChBJ,EAAMnB,QAAQuB,GACLA,GACTJ,EAAMnB,KAAKuB,GAGbN,EAAQO,EAAWH,EAAM,GAAGvB,OAC5BoB,GAAS,IAGNH,EAAKe,OACR,MAGFT,EAAQN,EAAKO,KAAKf,EAAKgB,MACxB,CAEGL,GACED,EAAQV,EAAKgB,MAAMzB,QACrBqB,EAAMnB,KAAK,CAAC4B,KAAM,OAAQL,MAAOhB,EAAKgB,MAAMM,MAAMZ,KAGpDP,EAAOE,SAASmB,OAAOlC,EAAO,KAAMsB,IAEpCA,EAAQ,CAACZ,GAGX,OAAOV,EAAQsB,EAAMrB,MACtB,CAtFUkC,CAAQzB,EAAMC,EAExB,CAqFH,CA2CA,SAASP,EAAac,GACpB,MAAuB,iBAATA,EAAoB,IAAIkB,OAAOC,EAAOnB,GAAO,KAAOA,CACpE,CAUA,SAASb,EAAWc,GAClB,MAA0B,mBAAZA,EACVA,EACA,WACE,OAAOA,CACR,CACP"}
|
package/dist/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js"],"sourcesContent":["export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n"],"names":["escapeStringRegexp","string","TypeError","replace"],"mappings":"AAAe,SAASA,EAAmBC,GAC1C,GAAsB,iBAAXA,EACV,MAAM,IAAIC,UAAU,qBAKrB,OAAOD,EACLE,QAAQ,sBAAuB,QAC/BA,QAAQ,KAAM,QACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/mdast-util-newline-to-break/lib/index.js"],"sourcesContent":["/**\n * @typedef {import('mdast').Nodes} Nodes\n * @typedef {import('mdast-util-find-and-replace').ReplaceFunction} ReplaceFunction\n */\n\nimport {findAndReplace} from 'mdast-util-find-and-replace'\n\n/**\n * Turn normal line endings into hard breaks.\n *\n * @param {Nodes} tree\n * Tree to change.\n * @returns {undefined}\n * Nothing.\n */\nexport function newlineToBreak(tree) {\n findAndReplace(tree, [/\\r?\\n|\\r/g, replace])\n}\n\n/**\n * Replace line endings.\n *\n * @type {ReplaceFunction}\n */\nfunction replace() {\n return {type: 'break'}\n}\n"],"names":["newlineToBreak","tree","findAndReplace","replace","type"],"mappings":"gFAeO,SAASA,EAAeC,GAC7BC,EAAeD,EAAM,CAAC,YAAaE,GACrC,CAOA,SAASA,IACP,MAAO,CAACC,KAAM,QAChB"}
|
package/dist/node_modules/mdast-util-to-hast/node_modules/unist-util-visit-parents/lib/color.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.js","sources":["../../../../../../node_modules/mdast-util-to-hast/node_modules/unist-util-visit-parents/lib/color.js"],"sourcesContent":["/**\n * @param {string} d\n * @returns {string}\n */\nexport function color(d) {\n return '\\u001B[33m' + d + '\\u001B[39m'\n}\n"],"names":["color","d"],"mappings":"AAIO,SAASA,EAAMC,GACpB,MAAO,QAAeA,EAAI,OAC5B"}
|