string-extract-sass-vars 4.2.0 → 4.2.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/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.2.1 (2026-08-22)
|
|
7
|
+
|
|
8
|
+
### Performance Improvements
|
|
9
|
+
|
|
10
|
+
- optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
|
|
11
|
+
|
|
6
12
|
## 4.2.0 (2026-08-19)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
9
15
|
|
|
10
16
|
- make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
|
|
11
|
-
- resolve review findings
|
|
17
|
+
- resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
12
18
|
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
13
19
|
- standardise Sass extraction errs ([1233a89](https://github.com/codsen/codsen/commit/1233a8999b3413c569868e7a85101eeef68d2bfc))
|
|
14
20
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-extract-sass-vars
|
|
3
3
|
* @fileoverview Parse SASS variables file into a plain object of CSS key-value pairs
|
|
4
|
-
* @version 4.2.
|
|
4
|
+
* @version 4.2.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-extract-sass-vars/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{formatDiagnosticValue as p}from"codsen-utils";var h="4.2.
|
|
10
|
+
import{formatDiagnosticValue as p}from"codsen-utils";var h="4.2.1";var V=h,g="\\",S={throwIfEmpty:!1,cb:null};function E(t,n){if(typeof t!="string")return{};if(n&&typeof n!="object")throw new Error(`string-extract-sass-vars/extractVars(): [THROW_ID_01] the second input argument should be a plain object but it was given as ${p(n,4)} (type ${typeof n})`);let r={...S,...n};if(r.cb&&typeof r.cb!="function")throw new Error(`string-extract-sass-vars/extractVars(): [THROW_ID_02] resolvedOpts.cb should be function! But it was given as ${p(n,4)} (type ${typeof n})`);let f=t.length,a=null,l=null,u=null,i=null,o=null,b=null,s=!1,m=!1,$=!1,c={};for(let e=0;e<f;e++)!s&&o&&t[e]===o&&t[e-1]!==g?o=null:!o&&!s&&t[e-1]!==g&&`'"`.includes(t[e])&&(o=t[e]),m&&`\r
|
|
11
11
|
`.includes(t[e])&&(m=!1),!s&&t[e]==="/"&&t[e+1]==="/"&&(m=!0),$&&t[e-2]==="*"&&t[e-1]==="/"&&($=!1),!s&&t[e]==="/"&&t[e+1]==="*"&&($=!0),s=m||$,!s&&t[e]==="$"&&a===null&&(a=e+1),!s&&l!==null&&!o&&t[e]===";"&&(i=t.slice(`"'`.includes(t[l])?l+1:l,(b||0)+1),/^-?\d*\.?\d*$/.test(i)&&(i=+i),c[u]=r.cb?r.cb(i):i,a=null,l=null,u=null,i=null),!s&&u!==null&&t[e]?.trim()&&l===null&&(l=e),!s&&!u&&a!==null&&t[e]===":"&&!o&&(u=t.slice(a,e)),`'"`.includes(t[e])||(b=e);if(!Object.keys(c).length&&r.throwIfEmpty)throw new Error("string-extract-sass-vars/extractVars(): [THROW_ID_03] no keys extracted! (setting resolvedOpts.opts)");return c}export{S as defaults,E as extractVars,V as version};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-extract-sass-vars
|
|
3
3
|
* @fileoverview Parse SASS variables file into a plain object of CSS key-value pairs
|
|
4
|
-
* @version 4.2.
|
|
4
|
+
* @version 4.2.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-extract-sass-vars/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var stringExtractSassVars=(()=>{var S=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,
|
|
10
|
+
"use strict";var stringExtractSassVars=(()=>{var S=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var x=(e,r,t)=>r in e?S(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,A=(e,r)=>{for(var t in r||(r={}))k.call(r,t)&&x(e,t,r[t]);if(O)for(var t of O(r))T.call(r,t)&&x(e,t,r[t]);return e};var B=(e,r)=>{for(var t in r)S(e,t,{get:r[t],enumerable:!0})},M=(e,r,t,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of I(r))!k.call(e,o)&&o!==t&&S(e,o,{get:()=>r[o],enumerable:!(l=W(r,o))||l.enumerable});return e};var L=e=>M(S({},"__esModule",{value:!0}),e);var H={};B(H,{defaults:()=>R,extractVars:()=>_,version:()=>J});function P(){let e=[],r=0,t=!1;return{append(l){return t?!1:r+l.length>1999?(e.push("\u2026"),r+=1,t=!0,!1):(e.push(l),r+=l.length,!0)},result(){return e.join("")},stopped(){return t}}}function U(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function w(e,r){if(e.append('"')){for(let t=0;t<r.length&&!e.stopped();t+=1){let l=r.charCodeAt(t);l===34?e.append('\\"'):l===92?e.append("\\\\"):l===8?e.append("\\b"):l===9?e.append("\\t"):l===10?e.append("\\n"):l===12?e.append("\\f"):l===13?e.append("\\r"):l<32||l===8232||l===8233||l>=55296&&l<=57343?e.append(U(l)):e.append(r[t])}e.append('"')}}function Q(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function j(e,r){e.append("Symbol(");let t=String(r);t.length>8&&w(e,t.slice(7,-1)),e.append(")")}function D(e,r){typeof r=="symbol"?j(e,r):w(e,String(r))}function C(e,r=0){let t=P(),l=r===4?4:0,o=new WeakSet,u=0;function m(n){l&&t.append(" ".repeat(n*l))}function a(n,s){n&&t.append(","),l&&(t.append("\n"),m(s+1))}function p(n,s,i){l&&s&&(t.append("\n"),m(i)),t.append(n)}function v(n,s){Object.prototype.hasOwnProperty.call(n,"value")?$(n.value,s):t.append(Q(n))}function c(n,s){let i;try{i=Reflect.getOwnPropertyDescriptor(n,"length")}catch(h){t.append("[Uninspectable]");return}let f=i==null?void 0:i.value;if(!Number.isSafeInteger(f)||f<0){t.append("[Uninspectable]");return}t.append("[");let d=!1;for(let h=0;h<f&&!t.stopped();h+=1){if(a(d,s),d=!0,u>=50){t.append("[MaxEntries]");break}u+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(n,String(h))}catch(K){t.append("[Uninspectable]");continue}y!=null&&y.enumerable?v(y,s+1):t.append("[Empty]")}p("]",d,s)}function g(n,s){let i;try{i=Reflect.ownKeys(n)}catch(d){t.append("[Uninspectable]");return}t.append("{");let f=!1;for(let d of i){if(t.stopped())break;if(u>=50){a(f,s),f=!0,w(t,"\u2026"),t.append(l?": ":":"),t.append("[MaxEntries]");break}u+=1;let h;try{h=Reflect.getOwnPropertyDescriptor(n,d)}catch(y){a(f,s),f=!0,D(t,d),t.append(l?": ":":"),t.append("[Uninspectable]");continue}h!=null&&h.enumerable&&(a(f,s),f=!0,D(t,d),t.append(l?": ":":"),v(h,s+1))}p("}",f,s)}function b(n,s){if(o.has(n)){t.append("[Circular]");return}if(s>=5){t.append("[MaxDepth]");return}let i;try{i=Array.isArray(n)}catch(f){t.append("[Uninspectable]");return}o.add(n);try{i?c(n,s):g(n,s)}finally{o.delete(n)}}function $(n,s){n===null?t.append("null"):typeof n=="string"?w(t,n):typeof n=="number"?t.append(Object.is(n,-0)?"-0":String(n)):typeof n=="boolean"?t.append(n?"true":"false"):typeof n>"u"?t.append("undefined"):typeof n=="bigint"?t.append("".concat(n,"n")):typeof n=="symbol"?j(t,n):typeof n=="function"?t.append("[Function]"):b(n,s)}try{return $(e,0),t.result()}catch(n){return"[Uninspectable]"}}var Z=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);var E,q=(E=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:E.get;var Y=Date.prototype.getTime;var V="4.2.1";var J=V,N="\\",R={throwIfEmpty:!1,cb:null};function _(e,r){var s;if(typeof e!="string")return{};if(r&&typeof r!="object")throw new Error("string-extract-sass-vars/extractVars(): [THROW_ID_01] the second input argument should be a plain object but it was given as ".concat(C(r,4)," (type ").concat(typeof r,")"));let t=A(A({},R),r);if(t.cb&&typeof t.cb!="function")throw new Error("string-extract-sass-vars/extractVars(): [THROW_ID_02] resolvedOpts.cb should be function! But it was given as ".concat(C(r,4)," (type ").concat(typeof r,")"));let l=e.length,o=null,u=null,m=null,a=null,p=null,v=null,c=!1,g=!1,b=!1,$={};for(let i=0;i<l;i++)!c&&p&&e[i]===p&&e[i-1]!==N?p=null:!p&&!c&&e[i-1]!==N&&"'\"".includes(e[i])&&(p=e[i]),g&&"\r\n".includes(e[i])&&(g=!1),!c&&e[i]==="/"&&e[i+1]==="/"&&(g=!0),b&&e[i-2]==="*"&&e[i-1]==="/"&&(b=!1),!c&&e[i]==="/"&&e[i+1]==="*"&&(b=!0),c=g||b,!c&&e[i]==="$"&&o===null&&(o=i+1),!c&&u!==null&&!p&&e[i]===";"&&(a=e.slice("\"'".includes(e[u])?u+1:u,(v||0)+1),/^-?\d*\.?\d*$/.test(a)&&(a=+a),$[m]=t.cb?t.cb(a):a,o=null,u=null,m=null,a=null),!c&&m!==null&&((s=e[i])!=null&&s.trim())&&u===null&&(u=i),!c&&!m&&o!==null&&e[i]===":"&&!p&&(m=e.slice(o,i)),"'\"".includes(e[i])||(v=i);if(!Object.keys($).length&&t.throwIfEmpty)throw new Error("string-extract-sass-vars/extractVars(): [THROW_ID_03] no keys extracted! (setting resolvedOpts.opts)");return $}return L(H);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.
|
|
14
|
+
* @version 1.9.0
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-extract-sass-vars",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "Parse SASS variables file into a plain object of CSS key-value pairs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"various": {}
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"codsen-utils": "^1.
|
|
72
|
+
"codsen-utils": "^1.9.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"color-shorthand-hex-to-six-digit": "^5.2.
|
|
75
|
+
"color-shorthand-hex-to-six-digit": "^5.2.1"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
78
|
"node": ">=18.20.8"
|