@scurrlin/stencil 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scurrlin/stencil",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "A memorization tool that strips code down to first letters and punctuation only.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -17,7 +17,7 @@ async function transformFile(filePath, options = {}) {
17
17
  throw new Error(`Unable to read file: ${err.message}`);
18
18
  });
19
19
 
20
- // Create an interface for reading the file line by line
20
+ // Create interface for reading the file line by line
21
21
  const rl = readline.createInterface({
22
22
  input: fileStream,
23
23
  crlfDelay: Infinity
@@ -44,11 +44,11 @@ async function transformFile(filePath, options = {}) {
44
44
  }
45
45
 
46
46
  function transformLine(line) {
47
- // Regular expression to match sequences of letters and numbers
47
+ // Regex to match sequences of letters and numbers
48
48
  // \p{L} matches any kind of letter from any language
49
49
  // \p{N} matches any kind of numeric character
50
- // The 'u' flag enables Unicode support
51
- // The 'g' flag enables global matching
50
+ // 'u' flag enables Unicode support
51
+ // 'g' flag enables global matching
52
52
  return line.replace(/[\p{L}\p{N}]+/gu, (match) => {
53
53
  return match[0]; // Retain only the first character
54
54
  });