font-range 1.0.0 → 1.0.1

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/build/main.js CHANGED
@@ -117,10 +117,10 @@ function loadAST(dirPath, url = exports.targets.korean, parseOption = parseOptio
117
117
  return (0, css_tree_1.parse)(css, parseOption);
118
118
  });
119
119
  }
120
- function setBlock(block, elem, property) {
121
- if (elem.property === property) {
120
+ function setBlock(block, elem, blockProp, elemProp) {
121
+ if (elem.property === elemProp) {
122
122
  if (elem.value.type === "Raw") {
123
- block[property] = elem.value.value;
123
+ block[blockProp] = elem.value.value;
124
124
  }
125
125
  }
126
126
  }
@@ -135,8 +135,8 @@ function parseCSS(dirPath = "src", url = exports.targets.korean) {
135
135
  unicodes: ""
136
136
  };
137
137
  (0, css_tree_1.walk)(node, { visit: "Declaration", enter(elem) {
138
- setBlock(block, elem, "src");
139
- setBlock(block, elem, "unicode-range");
138
+ setBlock(block, elem, "src", "src");
139
+ setBlock(block, elem, "unicodes", "unicode-range");
140
140
  } });
141
141
  if (block.src !== "" || block.unicodes !== "") {
142
142
  parsed.push(block);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "font-range",
3
3
  "description": " Font subset with google font's ML result.",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "author": "black7375 <alstjr7375@daum.net>",
6
6
  "license": "MIT",
7
7
  "keywords": [
package/src/main.ts CHANGED
@@ -141,10 +141,10 @@ interface BlockI {
141
141
  src: string;
142
142
  unicodes: string;
143
143
  }
144
- function setBlock(block: BlockI, elem: Declaration, property: string) {
145
- if(elem.property === property) {
144
+ function setBlock(block: BlockI, elem: Declaration, blockProp: keyof BlockI, elemProp: string) {
145
+ if(elem.property === elemProp) {
146
146
  if(elem.value.type === "Raw") {
147
- block[property] = elem.value.value;
147
+ block[blockProp] = elem.value.value;
148
148
  }
149
149
  }
150
150
  }
@@ -160,8 +160,8 @@ export async function parseCSS(dirPath = "src", url = targets.korean) {
160
160
  unicodes: ""
161
161
  };
162
162
  walk(node, { visit: "Declaration", enter(elem) {
163
- setBlock(block, elem, "src");
164
- setBlock(block, elem, "unicode-range");
163
+ setBlock(block, elem, "src", "src");
164
+ setBlock(block, elem, "unicodes", "unicode-range");
165
165
  }});
166
166
 
167
167
  if(block.src !== "" || block.unicodes !== "") {