rolldown-license-plugin 1.2.0 → 1.3.0
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/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5743,6 +5743,8 @@ type RolldownLicensePluginOpts = {
|
|
|
5743
5743
|
match?: RegExp; /** When set, word-wrap `licenseText` to this column width */
|
|
5744
5744
|
wrapText?: number;
|
|
5745
5745
|
};
|
|
5746
|
+
/** Word-wrap plain text to a specified column width */
|
|
5747
|
+
declare function wrap(text: string, width: number): string;
|
|
5746
5748
|
/** Rolldown plugin that extracts license information from bundled dependencies */
|
|
5747
5749
|
declare const licensePlugin: ({
|
|
5748
5750
|
onDone,
|
|
@@ -5750,4 +5752,4 @@ declare const licensePlugin: ({
|
|
|
5750
5752
|
wrapText
|
|
5751
5753
|
}: RolldownLicensePluginOpts) => Plugin;
|
|
5752
5754
|
//#endregion
|
|
5753
|
-
export { LicenseInfo, RolldownLicensePluginOpts, licensePlugin };
|
|
5755
|
+
export { LicenseInfo, RolldownLicensePluginOpts, licensePlugin, wrap };
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { dirname, join } from "node:path";
|
|
|
4
4
|
|
|
5
5
|
//#region index.ts
|
|
6
6
|
const defaultMatch = /^((UN)?LICEN(S|C)E|COPYING).*$/i;
|
|
7
|
+
/** Word-wrap plain text to a specified column width */
|
|
7
8
|
function wrap(text, width) {
|
|
8
9
|
const lines = [];
|
|
9
10
|
for (const rawLine of text.replace(/\r/g, "").split("\n")) {
|
|
@@ -110,4 +111,4 @@ const licensePlugin = ({ onDone, match = defaultMatch, wrapText }) => ({
|
|
|
110
111
|
});
|
|
111
112
|
|
|
112
113
|
//#endregion
|
|
113
|
-
export { licensePlugin };
|
|
114
|
+
export { licensePlugin, wrap };
|
package/package.json
CHANGED