@iconify/tools 4.0.5 → 4.0.7

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.
@@ -98,7 +98,7 @@ async function exportJSONPackage(iconSet, options) {
98
98
  await misc_writeJson.writeJSONFile(`${dir}/${jsonFilename}`, data);
99
99
  cjsImports.push(`const ${attr} = require('${relativeFile}');`);
100
100
  mjsImports.push(
101
- `import ${attr} from '${relativeFile}' assert { type: 'json' };`
101
+ `import ${attr} from '${relativeFile}' with { type: 'json' };`
102
102
  );
103
103
  packageJSONIconSet[attr] = attr + ".json";
104
104
  packageJSONExports[relativeFile] = relativeFile;
@@ -96,7 +96,7 @@ async function exportJSONPackage(iconSet, options) {
96
96
  await writeJSONFile(`${dir}/${jsonFilename}`, data);
97
97
  cjsImports.push(`const ${attr} = require('${relativeFile}');`);
98
98
  mjsImports.push(
99
- `import ${attr} from '${relativeFile}' assert { type: 'json' };`
99
+ `import ${attr} from '${relativeFile}' with { type: 'json' };`
100
100
  );
101
101
  packageJSONIconSet[attr] = attr + ".json";
102
102
  packageJSONExports[relativeFile] = relativeFile;
@@ -125,15 +125,18 @@ async function figmaImagesQuery(options, nodes, cache) {
125
125
  if (options.version) {
126
126
  params.set("version", options.version);
127
127
  }
128
- if (svgOptions.includeID) {
129
- params.set("svg_include_id", "true");
130
- }
131
- if (svgOptions.simplifyStroke) {
132
- params.set("svg_simplify_stroke", "true");
133
- }
134
- if (svgOptions.useAbsoluteBounds) {
135
- params.set("use_absolute_bounds", "true");
136
- }
128
+ params.set(
129
+ "svg_include_id",
130
+ svgOptions.includeID ? "true" : "false"
131
+ );
132
+ params.set(
133
+ "svg_simplify_stroke",
134
+ svgOptions.simplifyStroke ? "true" : "false"
135
+ );
136
+ params.set(
137
+ "use_absolute_bounds",
138
+ svgOptions.useAbsoluteBounds ? "true" : "false"
139
+ );
137
140
  download_api_index.sendAPIQuery(
138
141
  {
139
142
  uri,
@@ -123,15 +123,18 @@ async function figmaImagesQuery(options, nodes, cache) {
123
123
  if (options.version) {
124
124
  params.set("version", options.version);
125
125
  }
126
- if (svgOptions.includeID) {
127
- params.set("svg_include_id", "true");
128
- }
129
- if (svgOptions.simplifyStroke) {
130
- params.set("svg_simplify_stroke", "true");
131
- }
132
- if (svgOptions.useAbsoluteBounds) {
133
- params.set("use_absolute_bounds", "true");
134
- }
126
+ params.set(
127
+ "svg_include_id",
128
+ svgOptions.includeID ? "true" : "false"
129
+ );
130
+ params.set(
131
+ "svg_simplify_stroke",
132
+ svgOptions.simplifyStroke ? "true" : "false"
133
+ );
134
+ params.set(
135
+ "use_absolute_bounds",
136
+ svgOptions.useAbsoluteBounds ? "true" : "false"
137
+ );
135
138
  sendAPIQuery(
136
139
  {
137
140
  uri,
package/lib/svg/index.cjs CHANGED
@@ -136,7 +136,7 @@ class SVG {
136
136
  remove('xml:space="preserve"', "", "");
137
137
  content = content.replace(/<g>\s*<\/g>/g, "");
138
138
  this.$svg = cheerio__namespace.load(content.trim(), {
139
- // @ts-expect-error Legacy attribute, kept because Cheerio types are a mess
139
+ // @ts-expect-error Legacy attribute, kept because Cheerio types are a unstable
140
140
  lowerCaseAttributeNames: false,
141
141
  xmlMode: true
142
142
  });
package/lib/svg/index.mjs CHANGED
@@ -120,7 +120,7 @@ class SVG {
120
120
  remove('xml:space="preserve"', "", "");
121
121
  content = content.replace(/<g>\s*<\/g>/g, "");
122
122
  this.$svg = cheerio.load(content.trim(), {
123
- // @ts-expect-error Legacy attribute, kept because Cheerio types are a mess
123
+ // @ts-expect-error Legacy attribute, kept because Cheerio types are a unstable
124
124
  lowerCaseAttributeNames: false,
125
125
  xmlMode: true
126
126
  });
package/license.txt CHANGED
File without changes