@scurrlin/stencil 1.0.4 → 1.0.6

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/README.md CHANGED
@@ -14,7 +14,7 @@ Whether you are studying for technical interviews, or just starting your coding
14
14
 
15
15
  Most people when they attempt to memorize something study the full text and then attempt to regurgitate it on a blank page. Shocking, I know... but what if there was a step in between? What if memorization and pattern recognition weren't all or nothing games? This is where Stencil comes in.
16
16
 
17
- Stencil is a memorization tool that strips code files down to their first letters while preserving spacing, capitalization, and punctuation. The "stencil" of the file is designed to act as a bridge between having something partially memorized and fully memorized. Below is an example of Stencil in action using LeetCode problem 217 "Contains Duplicate":
17
+ Stencil is a language-agnostic memorization tool that strips code files down to their first letters while preserving spacing, capitalization, and punctuation. The "stencil" of the file is designed to act as a bridge between having something partially memorized and fully memorized. Below is an example of Stencil in action using LeetCode problem 217 "Contains Duplicate":
18
18
 
19
19
  ## Example
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scurrlin/stencil",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
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
  });