Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More ā†’
Socket
Sign inDemoInstall
Socket

sass-embedded

Package Overview
Dependencies
Maintainers
2
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sass-embedded - npm Package Compare versions

Comparing version 1.80.6 to 1.80.7

dist/tsconfig.build.tsbuildinfo

4

dist/lib/src/canonicalize-context.js

@@ -8,2 +8,4 @@ "use strict";

class CanonicalizeContext {
fromImport;
_containingUrl;
get containingUrl() {

@@ -13,2 +15,3 @@ this._containingUrlAccessed = true;

}
_containingUrlAccessed = false;
/**

@@ -25,3 +28,2 @@ * Whether the `containingUrl` getter has been accessed.

constructor(containingUrl, fromImport) {
this._containingUrlAccessed = false;
this._containingUrl = containingUrl;

@@ -28,0 +30,0 @@ this.fromImport = fromImport;

@@ -28,2 +28,32 @@ "use strict";

class AsyncCompiler {
/** The underlying process that's being wrapped. */
process = (0, child_process_1.spawn)(compiler_path_1.compilerCommand[0], [...compiler_path_1.compilerCommand.slice(1), '--embedded'], {
// Use the command's cwd so the compiler survives the removal of the
// current working directory.
// https://github.com/sass/embedded-host-node/pull/261#discussion_r1438712923
cwd: path.dirname(compiler_path_1.compilerCommand[0]),
// Node blocks launching .bat and .cmd without a shell due to CVE-2024-27980
shell: ['.bat', '.cmd'].includes(path.extname(compiler_path_1.compilerCommand[0]).toLowerCase()),
windowsHide: true,
});
/** The next compilation ID. */
compilationId = 1;
/** A list of active compilations. */
compilations = new Set();
/** Whether the underlying compiler has already exited. */
disposed = false;
/** Reusable message transformer for all compilations. */
messageTransformer;
/** The child process's exit event. */
exit$ = new Promise(resolve => {
this.process.on('exit', code => resolve(code));
});
/** The buffers emitted by the child process's stdout. */
stdout$ = new rxjs_1.Observable(observer => {
this.process.stdout.on('data', buffer => observer.next(buffer));
}).pipe((0, operators_1.takeUntil)(this.exit$));
/** The buffers emitted by the child process's stderr. */
stderr$ = new rxjs_1.Observable(observer => {
this.process.stderr.on('data', buffer => observer.next(buffer));
}).pipe((0, operators_1.takeUntil)(this.exit$));
/** Writes `buffer` to the child process's stdin. */

@@ -46,5 +76,5 @@ writeStdin(buffer) {

const optionsKey = Symbol();
deprecations_1.activeDeprecationOptions.set(optionsKey, options !== null && options !== void 0 ? options : {});
deprecations_1.activeDeprecationOptions.set(optionsKey, options ?? {});
try {
const functions = new function_registry_1.FunctionRegistry(options === null || options === void 0 ? void 0 : options.functions);
const functions = new function_registry_1.FunctionRegistry(options?.functions);
const dispatcher = (0, utils_1.createDispatcher)(this.compilationId++, this.messageTransformer, {

@@ -80,30 +110,2 @@ handleImportRequest: request => importers.import(request),

constructor(flag) {
/** The underlying process that's being wrapped. */
this.process = (0, child_process_1.spawn)(compiler_path_1.compilerCommand[0], [...compiler_path_1.compilerCommand.slice(1), '--embedded'], {
// Use the command's cwd so the compiler survives the removal of the
// current working directory.
// https://github.com/sass/embedded-host-node/pull/261#discussion_r1438712923
cwd: path.dirname(compiler_path_1.compilerCommand[0]),
// Node blocks launching .bat and .cmd without a shell due to CVE-2024-27980
shell: ['.bat', '.cmd'].includes(path.extname(compiler_path_1.compilerCommand[0]).toLowerCase()),
windowsHide: true,
});
/** The next compilation ID. */
this.compilationId = 1;
/** A list of active compilations. */
this.compilations = new Set();
/** Whether the underlying compiler has already exited. */
this.disposed = false;
/** The child process's exit event. */
this.exit$ = new Promise(resolve => {
this.process.on('exit', code => resolve(code));
});
/** The buffers emitted by the child process's stdout. */
this.stdout$ = new rxjs_1.Observable(observer => {
this.process.stdout.on('data', buffer => observer.next(buffer));
}).pipe((0, operators_1.takeUntil)(this.exit$));
/** The buffers emitted by the child process's stderr. */
this.stderr$ = new rxjs_1.Observable(observer => {
this.process.stderr.on('data', buffer => observer.next(buffer));
}).pipe((0, operators_1.takeUntil)(this.exit$));
if (flag !== initFlag) {

@@ -110,0 +112,0 @@ throw utils.compilerError('AsyncCompiler can not be directly constructed. ' +

@@ -9,2 +9,3 @@ "use strict";

const rxjs_1 = require("rxjs");
const sync_child_process_1 = require("sync-child-process");
const path = require("path");

@@ -18,3 +19,2 @@ const utils_1 = require("./utils");

const packet_transformer_1 = require("../packet-transformer");
const sync_process_1 = require("../sync-process");
const utils = require("../utils");

@@ -29,2 +29,24 @@ /**

class Compiler {
/** The underlying process that's being wrapped. */
process = new sync_child_process_1.SyncChildProcess(compiler_path_1.compilerCommand[0], [...compiler_path_1.compilerCommand.slice(1), '--embedded'], {
// Use the command's cwd so the compiler survives the removal of the
// current working directory.
// https://github.com/sass/embedded-host-node/pull/261#discussion_r1438712923
cwd: path.dirname(compiler_path_1.compilerCommand[0]),
// Node blocks launching .bat and .cmd without a shell due to CVE-2024-27980
shell: ['.bat', '.cmd'].includes(path.extname(compiler_path_1.compilerCommand[0]).toLowerCase()),
windowsHide: true,
});
/** The next compilation ID. */
compilationId = 1;
/** A list of active dispatchers. */
dispatchers = new Set();
/** The buffers emitted by the child process's stdout. */
stdout$ = new rxjs_1.Subject();
/** The buffers emitted by the child process's stderr. */
stderr$ = new rxjs_1.Subject();
/** Whether the underlying compiler has already exited. */
disposed = false;
/** Reusable message transformer for all compilations. */
messageTransformer;
/** Writes `buffer` to the child process's stdin. */

@@ -36,3 +58,8 @@ writeStdin(buffer) {

yield() {
const event = this.process.yield();
const result = this.process.next();
if (result.done) {
this.disposed = true;
return false;
}
const event = result.value;
switch (event.type) {

@@ -45,5 +72,2 @@ case 'stdout':

return true;
case 'exit':
this.disposed = true;
return false;
}

@@ -63,5 +87,5 @@ }

const optionsKey = Symbol();
deprecations_1.activeDeprecationOptions.set(optionsKey, options !== null && options !== void 0 ? options : {});
deprecations_1.activeDeprecationOptions.set(optionsKey, options ?? {});
try {
const functions = new function_registry_1.FunctionRegistry(options === null || options === void 0 ? void 0 : options.functions);
const functions = new function_registry_1.FunctionRegistry(options?.functions);
const dispatcher = (0, utils_1.createDispatcher)(this.compilationId++, this.messageTransformer, {

@@ -113,22 +137,2 @@ handleImportRequest: request => importers.import(request),

constructor(flag) {
/** The underlying process that's being wrapped. */
this.process = new sync_process_1.SyncProcess(compiler_path_1.compilerCommand[0], [...compiler_path_1.compilerCommand.slice(1), '--embedded'], {
// Use the command's cwd so the compiler survives the removal of the
// current working directory.
// https://github.com/sass/embedded-host-node/pull/261#discussion_r1438712923
cwd: path.dirname(compiler_path_1.compilerCommand[0]),
// Node blocks launching .bat and .cmd without a shell due to CVE-2024-27980
shell: ['.bat', '.cmd'].includes(path.extname(compiler_path_1.compilerCommand[0]).toLowerCase()),
windowsHide: true,
});
/** The next compilation ID. */
this.compilationId = 1;
/** A list of active dispatchers. */
this.dispatchers = new Set();
/** The buffers emitted by the child process's stdout. */
this.stdout$ = new rxjs_1.Subject();
/** The buffers emitted by the child process's stderr. */
this.stderr$ = new rxjs_1.Subject();
/** Whether the underlying compiler has already exited. */
this.disposed = false;
if (flag !== initFlag) {

@@ -135,0 +139,0 @@ throw utils.compilerError('Compiler can not be directly constructed. ' +

@@ -31,19 +31,18 @@ "use strict";

function newCompileRequest(importers, options) {
var _a, _b, _c, _d, _e, _f, _g;
const request = (0, protobuf_1.create)(proto.InboundMessage_CompileRequestSchema, {
importers: importers.importers,
globalFunctions: Object.keys((_a = options === null || options === void 0 ? void 0 : options.functions) !== null && _a !== void 0 ? _a : {}),
sourceMap: !!(options === null || options === void 0 ? void 0 : options.sourceMap),
sourceMapIncludeSources: !!(options === null || options === void 0 ? void 0 : options.sourceMapIncludeSources),
alertColor: (_b = options === null || options === void 0 ? void 0 : options.alertColor) !== null && _b !== void 0 ? _b : !!supportsColor.stdout,
alertAscii: !!(options === null || options === void 0 ? void 0 : options.alertAscii),
quietDeps: !!(options === null || options === void 0 ? void 0 : options.quietDeps),
verbose: !!(options === null || options === void 0 ? void 0 : options.verbose),
charset: !!((_c = options === null || options === void 0 ? void 0 : options.charset) !== null && _c !== void 0 ? _c : true),
silent: (options === null || options === void 0 ? void 0 : options.logger) === logger_1.Logger.silent,
fatalDeprecation: (0, deprecations_1.getDeprecationIds)((_d = options === null || options === void 0 ? void 0 : options.fatalDeprecations) !== null && _d !== void 0 ? _d : []),
silenceDeprecation: (0, deprecations_1.getDeprecationIds)((_e = options === null || options === void 0 ? void 0 : options.silenceDeprecations) !== null && _e !== void 0 ? _e : []),
futureDeprecation: (0, deprecations_1.getDeprecationIds)((_f = options === null || options === void 0 ? void 0 : options.futureDeprecations) !== null && _f !== void 0 ? _f : []),
globalFunctions: Object.keys(options?.functions ?? {}),
sourceMap: !!options?.sourceMap,
sourceMapIncludeSources: !!options?.sourceMapIncludeSources,
alertColor: options?.alertColor ?? !!supportsColor.stdout,
alertAscii: !!options?.alertAscii,
quietDeps: !!options?.quietDeps,
verbose: !!options?.verbose,
charset: !!(options?.charset ?? true),
silent: options?.logger === logger_1.Logger.silent,
fatalDeprecation: (0, deprecations_1.getDeprecationIds)(options?.fatalDeprecations ?? []),
silenceDeprecation: (0, deprecations_1.getDeprecationIds)(options?.silenceDeprecations ?? []),
futureDeprecation: (0, deprecations_1.getDeprecationIds)(options?.futureDeprecations ?? []),
});
switch ((_g = options === null || options === void 0 ? void 0 : options.style) !== null && _g !== void 0 ? _g : 'expanded') {
switch (options?.style ?? 'expanded') {
case 'expanded':

@@ -56,3 +55,3 @@ request.style = proto.OutputStyle.EXPANDED;

default:
throw new Error(`Unknown options.style: "${options === null || options === void 0 ? void 0 : options.style}"`);
throw new Error(`Unknown options.style: "${options?.style}"`);
}

@@ -70,8 +69,7 @@ return request;

function newCompileStringRequest(source, importers, options) {
var _a, _b;
const input = (0, protobuf_1.create)(proto.InboundMessage_CompileRequest_StringInputSchema, {
source,
syntax: utils.protofySyntax((_a = options === null || options === void 0 ? void 0 : options.syntax) !== null && _a !== void 0 ? _a : 'scss'),
syntax: utils.protofySyntax(options?.syntax ?? 'scss'),
});
const url = (_b = options === null || options === void 0 ? void 0 : options.url) === null || _b === void 0 ? void 0 : _b.toString();
const url = options?.url?.toString();
if (url && url !== utils_1.legacyImporterProtocol) {

@@ -102,11 +100,10 @@ input.url = url;

function handleLogEvent(options, event) {
var _a, _b;
let span = event.span ? (0, deprotofy_span_1.deprotofySourceSpan)(event.span) : null;
if (span && (options === null || options === void 0 ? void 0 : options.legacy))
if (span && options?.legacy)
span = (0, utils_1.removeLegacyImporterFromSpan)(span);
let message = event.message;
if (options === null || options === void 0 ? void 0 : options.legacy)
if (options?.legacy)
message = (0, utils_1.removeLegacyImporter)(message);
let formatted = event.formatted;
if (options === null || options === void 0 ? void 0 : options.legacy)
if (options?.legacy)
formatted = (0, utils_1.removeLegacyImporter)(formatted);

@@ -117,3 +114,3 @@ const deprecationType = validDeprecationId(event.deprecationType)

if (event.type === proto.LogEventType.DEBUG) {
if ((_a = options === null || options === void 0 ? void 0 : options.logger) === null || _a === void 0 ? void 0 : _a.debug) {
if (options?.logger?.debug) {
options.logger.debug(message, {

@@ -128,3 +125,3 @@ span: span,

else {
if ((_b = options === null || options === void 0 ? void 0 : options.logger) === null || _b === void 0 ? void 0 : _b.warn) {
if (options?.logger?.warn) {
const params = deprecationType

@@ -137,3 +134,3 @@ ? { deprecation: true, deprecationType: deprecationType }

if (stack) {
params.stack = (options === null || options === void 0 ? void 0 : options.legacy) ? (0, utils_1.removeLegacyImporter)(stack) : stack;
params.stack = options?.legacy ? (0, utils_1.removeLegacyImporter)(stack) : stack;
}

@@ -140,0 +137,0 @@ options.logger.warn(message, params);

@@ -59,3 +59,2 @@ "use strict";

function isSilent(deprecation, options) {
var _a;
if (!options) {

@@ -68,3 +67,3 @@ for (const potentialOptions of exports.activeDeprecationOptions.values()) {

}
return getDeprecationIds((_a = options.silenceDeprecations) !== null && _a !== void 0 ? _a : []).includes(deprecation.id);
return getDeprecationIds(options.silenceDeprecations ?? []).includes(deprecation.id);
}

@@ -76,3 +75,2 @@ /**

function isEnabledFuture(deprecation, options) {
var _a;
if (!options) {

@@ -85,3 +83,3 @@ for (const potentialOptions of exports.activeDeprecationOptions.values()) {

}
return getDeprecationIds((_a = options.futureDeprecations) !== null && _a !== void 0 ? _a : []).includes(deprecation.id);
return getDeprecationIds(options.futureDeprecations ?? []).includes(deprecation.id);
}

@@ -93,3 +91,2 @@ /**

function isFatal(deprecation, options) {
var _a;
if (!options) {

@@ -107,3 +104,3 @@ for (const potentialOptions of exports.activeDeprecationOptions.values()) {

deprecation.deprecatedIn.patch;
for (const fatal of (_a = options.fatalDeprecations) !== null && _a !== void 0 ? _a : []) {
for (const fatal of options.fatalDeprecations ?? []) {
if (fatal instanceof version_1.Version) {

@@ -110,0 +107,0 @@ if (versionNumber === null)

@@ -34,2 +34,30 @@ "use strict";

class Dispatcher {
compilationId;
outboundMessages$;
writeInboundMessage;
outboundRequestHandlers;
// Tracks the IDs of all outbound requests. An inbound response with matching
// ID and type will remove the ID.
pendingOutboundRequests = new request_tracker_1.RequestTracker();
// All outbound messages for this compilation. If we detect any errors while
// dispatching messages, this completes.
messages$ = new rxjs_1.Subject();
// Subject to unsubscribe from all outbound messages to prevent past
// dispatchers with compilation IDs reused by future dispatchers from
// receiving messages intended for future dispatchers.
unsubscribe$ = new rxjs_1.Subject();
// If the dispatcher encounters an error, this errors out. It is publicly
// exposed as a readonly Observable.
errorInternal$ = new rxjs_1.Subject();
/**
* If the dispatcher encounters an error, this errors out. Upon error, the
* dispatcher rejects all promises awaiting an outbound response, and silently
* closes all subscriptions to outbound events.
*/
error$ = this.errorInternal$.pipe();
/**
* Outbound log events. If an error occurs, the dispatcher closes this
* silently.
*/
logEvents$ = this.messages$.pipe((0, operators_1.filter)(message => message.message.case === 'logEvent'), (0, operators_1.map)(message => message.message.value));
constructor(compilationId, outboundMessages$, writeInboundMessage, outboundRequestHandlers) {

@@ -40,26 +68,2 @@ this.compilationId = compilationId;

this.outboundRequestHandlers = outboundRequestHandlers;
// Tracks the IDs of all outbound requests. An inbound response with matching
// ID and type will remove the ID.
this.pendingOutboundRequests = new request_tracker_1.RequestTracker();
// All outbound messages for this compilation. If we detect any errors while
// dispatching messages, this completes.
this.messages$ = new rxjs_1.Subject();
// Subject to unsubscribe from all outbound messages to prevent past
// dispatchers with compilation IDs reused by future dispatchers from
// receiving messages intended for future dispatchers.
this.unsubscribe$ = new rxjs_1.Subject();
// If the dispatcher encounters an error, this errors out. It is publicly
// exposed as a readonly Observable.
this.errorInternal$ = new rxjs_1.Subject();
/**
* If the dispatcher encounters an error, this errors out. Upon error, the
* dispatcher rejects all promises awaiting an outbound response, and silently
* closes all subscriptions to outbound events.
*/
this.error$ = this.errorInternal$.pipe();
/**
* Outbound log events. If an error occurs, the dispatcher closes this
* silently.
*/
this.logEvents$ = this.messages$.pipe((0, operators_1.filter)(message => message.message.case === 'logEvent'), (0, operators_1.map)(message => message.message.value));
if (compilationId < 1) {

@@ -66,0 +70,0 @@ throw Error(`Invalid compilation ID ${compilationId}.`);

@@ -9,2 +9,5 @@ "use strict";

class Exception extends Error {
sassMessage;
sassStack;
span;
constructor(failure) {

@@ -11,0 +14,0 @@ super(failure.formatted);

@@ -19,9 +19,9 @@ "use strict";

class FunctionRegistry {
functionsByName = new Map();
functionsById = new Map();
idsByFunction = new Map();
/** The next ID to use for a function. */
id = 0;
constructor(functionsBySignature) {
this.functionsByName = new Map();
this.functionsById = new Map();
this.idsByFunction = new Map();
/** The next ID to use for a function. */
this.id = 0;
for (const [signature, fn] of Object.entries(functionsBySignature !== null && functionsBySignature !== void 0 ? functionsBySignature : {})) {
for (const [signature, fn] of Object.entries(functionsBySignature ?? {})) {
const openParen = signature.indexOf('(');

@@ -28,0 +28,0 @@ if (openParen === -1) {

@@ -18,7 +18,7 @@ "use strict";

class NodePackageImporter {
[entryPointDirectoryKey];
constructor(entryPointDirectory) {
var _a;
entryPointDirectory = entryPointDirectory
? p.resolve(entryPointDirectory)
: ((_a = require.main) === null || _a === void 0 ? void 0 : _a.filename)
: require.main?.filename
? p.dirname(require.main.filename)

@@ -44,13 +44,14 @@ : // TODO: Find a way to use `import.meta.main` once

class ImporterRegistry {
/** Protocol buffer representations of the registered importers. */
importers;
/** A map from importer IDs to their corresponding importers. */
importersById = new Map();
/** A map from file importer IDs to their corresponding importers. */
fileImportersById = new Map();
/** The next ID to use for an importer. */
id = 0;
constructor(options) {
var _a, _b;
/** A map from importer IDs to their corresponding importers. */
this.importersById = new Map();
/** A map from file importer IDs to their corresponding importers. */
this.fileImportersById = new Map();
/** The next ID to use for an importer. */
this.id = 0;
this.importers = ((_a = options === null || options === void 0 ? void 0 : options.importers) !== null && _a !== void 0 ? _a : [])
this.importers = (options?.importers ?? [])
.map(importer => this.register(importer))
.concat(((_b = options === null || options === void 0 ? void 0 : options.loadPaths) !== null && _b !== void 0 ? _b : []).map(path => (0, protobuf_1.create)(proto.InboundMessage_CompileRequest_ImporterSchema, {
.concat((options?.loadPaths ?? []).map(path => (0, protobuf_1.create)(proto.InboundMessage_CompileRequest_ImporterSchema, {
importer: { case: 'path', value: p.resolve(path) },

@@ -61,3 +62,2 @@ })));

register(importer) {
var _a;
const message = (0, protobuf_1.create)(proto.InboundMessage_CompileRequest_ImporterSchema, {});

@@ -82,3 +82,3 @@ if (importer instanceof NodePackageImporter) {

? [importer.nonCanonicalScheme]
: (_a = importer.nonCanonicalScheme) !== null && _a !== void 0 ? _a : [];
: (importer.nonCanonicalScheme ?? []);
this.importersById.set(this.id, importer);

@@ -119,3 +119,2 @@ }

return (0, utils_1.thenOr)(importer.load(new url_1.URL(request.url)), result => {
var _a, _b;
if (!result)

@@ -136,3 +135,3 @@ return (0, protobuf_1.create)(proto.InboundMessage_ImportResponseSchema, {});

syntax: utils.protofySyntax(result.syntax),
sourceMapUrl: (_b = (_a = result.sourceMapUrl) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '',
sourceMapUrl: result.sourceMapUrl?.toString() ?? '',
},

@@ -139,0 +138,0 @@ },

@@ -39,2 +39,11 @@ "use strict";

class LegacyImporterWrapper {
self;
callbacks;
loadPaths;
sync;
// A stack of previous URLs passed to `this.callbacks`.
prev = [];
// The `contents` field returned by the last successful invocation of
// `this.callbacks`, if it returned one.
lastContents;
constructor(self, callbacks, loadPaths, initialPrev, sync) {

@@ -45,4 +54,2 @@ this.self = self;

this.sync = sync;
// A stack of previous URLs passed to `this.callbacks`.
this.prev = [];
const path = initialPrev !== 'stdin';

@@ -117,3 +124,2 @@ this.prev.push({ url: path ? p.resolve(initialPrev) : 'stdin', path });

return (0, utils_1.thenOr)((0, utils_1.thenOr)(this.invokeCallbacks(url, prev.url, options), result => {
var _a;
if (result instanceof Error)

@@ -128,3 +134,3 @@ throw result;

if ('contents' in result || !('file' in result)) {
this.lastContents = (_a = result.contents) !== null && _a !== void 0 ? _a : '';
this.lastContents = result.contents ?? '';
if ('file' in result) {

@@ -176,3 +182,2 @@ return new URL(utils_2.legacyImporterProtocol +

load(canonicalUrl) {
var _a;
if (canonicalUrl.protocol === exports.endOfLoadProtocol) {

@@ -192,3 +197,4 @@ this.prev.pop();

: 'scss';
let contents = (_a = this.lastContents) !== null && _a !== void 0 ? _a : fs.readFileSync((0, utils_2.legacyFileUrlToPath)(canonicalUrl), 'utf-8');
let contents = this.lastContents ??
fs.readFileSync((0, utils_2.legacyFileUrlToPath)(canonicalUrl), 'utf-8');
this.lastContents = undefined;

@@ -195,0 +201,0 @@ if (syntax === 'css') {

@@ -56,3 +56,2 @@ "use strict";

function adjustOptions(options) {
var _a;
if (!('file' in options && options.file) && !('data' in options)) {

@@ -63,3 +62,3 @@ throw new Error('Either options.data or options.file must be set.');

// any load path.
options.includePaths = [process.cwd(), ...((_a = options.includePaths) !== null && _a !== void 0 ? _a : [])];
options.includePaths = [process.cwd(), ...(options.includePaths ?? [])];
if (!isStringOptions(options) &&

@@ -90,3 +89,2 @@ // The `indentedSyntax` option takes precedence over the file extension in the

function convertOptions(options, sync) {
var _a, _b, _c;
if ('outputStyle' in options &&

@@ -99,3 +97,3 @@ options.outputStyle !== 'compressed' &&

const functions = {};
for (let [signature, callback] of Object.entries((_a = options.functions) !== null && _a !== void 0 ? _a : {})) {
for (let [signature, callback] of Object.entries(options.functions ?? {})) {
// The legacy API allows signatures without parentheses but the modern API

@@ -112,3 +110,3 @@ // does not.

? options.importer
: [options.importer], (_b = options.includePaths) !== null && _b !== void 0 ? _b : [], (_c = options.file) !== null && _c !== void 0 ? _c : 'stdin', sync),
: [options.importer], options.includePaths ?? [], options.file ?? 'stdin', sync),
]

@@ -119,3 +117,3 @@ : undefined;

importers: options.pkgImporter instanceof importer_registry_1.NodePackageImporter
? [options.pkgImporter, ...(importers !== null && importers !== void 0 ? importers : [])]
? [options.pkgImporter, ...(importers ?? [])]
: importers,

@@ -138,7 +136,6 @@ sourceMap: wasSourceMapRequested(options),

function convertStringOptions(options, sync) {
var _a;
const modernOptions = convertOptions(options, sync);
// Use a no-op base importer, because the LegacyImporterWrapper will emulate
// the base importer by itself in order to mark containingUrl as accessed.
const importer = ((_a = modernOptions.importers) === null || _a === void 0 ? void 0 : _a.some(importer => importer instanceof importer_1.LegacyImporterWrapper))
const importer = modernOptions.importers?.some(importer => importer instanceof importer_1.LegacyImporterWrapper)
? {

@@ -171,3 +168,2 @@ canonicalize() {

function pluginThis(options) {
var _a, _b;
const pluginThis = {

@@ -178,3 +174,3 @@ options: {

data: options.data,
includePaths: ((_a = options.includePaths) !== null && _a !== void 0 ? _a : []).join(p.delimiter),
includePaths: (options.includePaths ?? []).join(p.delimiter),
precision: 10,

@@ -188,3 +184,3 @@ style: 1,

start: Date.now(),
entry: (_b = options.file) !== null && _b !== void 0 ? _b : 'data',
entry: options.file ?? 'data',
},

@@ -200,3 +196,2 @@ },

function newLegacyResult(options, start, result) {
var _a, _b;
const end = Date.now();

@@ -207,3 +202,3 @@ let css = result.css;

const sourceMap = result.sourceMap;
sourceMap.sourceRoot = (_a = options.sourceMapRoot) !== null && _a !== void 0 ? _a : '';
sourceMap.sourceRoot = options.sourceMapRoot ?? '';
const sourceMapPath = typeof options.sourceMap === 'string'

@@ -255,3 +250,3 @@ ? options.sourceMap

stats: {
entry: (_b = options.file) !== null && _b !== void 0 ? _b : 'data',
entry: options.file ?? 'data',
start,

@@ -277,3 +272,2 @@ end,

function newLegacyException(error) {
var _a, _b;
if (!(error instanceof exception_1.Exception)) {

@@ -287,3 +281,3 @@ return Object.assign(error, {

let file;
if (!(span === null || span === void 0 ? void 0 : span.url)) {
if (!span?.url) {
file = 'stdin';

@@ -308,6 +302,6 @@ }

stack: error.stack ? (0, utils_2.removeLegacyImporter)(error.stack) : undefined,
line: (0, utils_1.isNullOrUndefined)((_a = error.span) === null || _a === void 0 ? void 0 : _a.start.line)
line: (0, utils_1.isNullOrUndefined)(error.span?.start.line)
? undefined
: error.span.start.line + 1,
column: (0, utils_1.isNullOrUndefined)((_b = error.span) === null || _b === void 0 ? void 0 : _b.start.column)
column: (0, utils_1.isNullOrUndefined)(error.span?.start.column)
? undefined

@@ -314,0 +308,0 @@ : error.span.start.column + 1,

@@ -16,10 +16,11 @@ "use strict";

function resolvePath(path, fromImport) {
var _a, _b, _c;
const extension = p.extname(path);
if (extension === '.sass' || extension === '.scss' || extension === '.css') {
return ((_a = (fromImport
return ((fromImport
? exactlyOne(tryPath(`${withoutExtension(path)}.import${extension}`))
: null)) !== null && _a !== void 0 ? _a : exactlyOne(tryPath(path)));
: null) ?? exactlyOne(tryPath(path)));
}
return ((_c = (_b = (fromImport ? exactlyOne(tryPathWithExtensions(`${path}.import`)) : null)) !== null && _b !== void 0 ? _b : exactlyOne(tryPathWithExtensions(path))) !== null && _c !== void 0 ? _c : tryPathAsDirectory(path, fromImport));
return ((fromImport ? exactlyOne(tryPathWithExtensions(`${path}.import`)) : null) ??
exactlyOne(tryPathWithExtensions(path)) ??
tryPathAsDirectory(path, fromImport));
}

@@ -45,8 +46,7 @@ // Like `tryPath`, but checks `.sass`, `.scss`, and `.css` extensions.

function tryPathAsDirectory(path, fromImport) {
var _a;
if (!dirExists(path))
return null;
return ((_a = (fromImport
return ((fromImport
? exactlyOne(tryPathWithExtensions(p.join(path, 'index.import')))
: null)) !== null && _a !== void 0 ? _a : exactlyOne(tryPathWithExtensions(p.join(path, 'index'))));
: null) ?? exactlyOne(tryPathWithExtensions(p.join(path, 'index'))));
}

@@ -53,0 +53,0 @@ // If `paths` contains exactly one path, returns that path. If it contains no

@@ -12,2 +12,3 @@ "use strict";

class LegacyValueBase {
inner;
constructor(inner) {

@@ -14,0 +15,0 @@ this.inner = inner;

@@ -7,2 +7,3 @@ "use strict";

exports.LegacyColor = void 0;
const utils_1 = require("../../utils");
const color_1 = require("../../value/color");

@@ -17,3 +18,3 @@ const base_1 = require("./base");

let red;
if (!green || !blue) {
if ((0, utils_1.isNullOrUndefined)(green) || (0, utils_1.isNullOrUndefined)(blue)) {
const argb = redOrArgb;

@@ -20,0 +21,0 @@ alpha = (argb >> 24) / 0xff;

@@ -18,13 +18,15 @@ "use strict";

class MessageTransformer {
outboundProtobufs$;
writeInboundProtobuf;
// The decoded messages are written to this Subject. It is publicly exposed
// as a readonly Observable.
outboundMessagesInternal$ = new rxjs_1.Subject();
/**
* The OutboundMessages, decoded from protocol buffers. If this fails to
* decode a message, it will emit an error.
*/
outboundMessages$ = this.outboundMessagesInternal$.pipe();
constructor(outboundProtobufs$, writeInboundProtobuf) {
this.outboundProtobufs$ = outboundProtobufs$;
this.writeInboundProtobuf = writeInboundProtobuf;
// The decoded messages are written to this Subject. It is publicly exposed
// as a readonly Observable.
this.outboundMessagesInternal$ = new rxjs_1.Subject();
/**
* The OutboundMessages, decoded from protocol buffers. If this fails to
* decode a message, it will emit an error.
*/
this.outboundMessages$ = this.outboundMessagesInternal$.pipe();
this.outboundProtobufs$

@@ -31,0 +33,0 @@ .pipe((0, operators_1.map)(decode))

@@ -25,15 +25,17 @@ "use strict";

class PacketTransformer {
outboundBuffers$;
writeInboundBuffer;
// The packet that is actively being decoded as buffers come in.
packet = new Packet();
// The decoded protobufs are written to this Subject. It is publicly exposed
// as a readonly Observable.
outboundProtobufsInternal$ = new rxjs_1.Subject();
/**
* The fully-decoded, outbound protobufs. If any errors are encountered
* during encoding/decoding, this Observable will error out.
*/
outboundProtobufs$ = this.outboundProtobufsInternal$.pipe();
constructor(outboundBuffers$, writeInboundBuffer) {
this.outboundBuffers$ = outboundBuffers$;
this.writeInboundBuffer = writeInboundBuffer;
// The packet that is actively being decoded as buffers come in.
this.packet = new Packet();
// The decoded protobufs are written to this Subject. It is publicly exposed
// as a readonly Observable.
this.outboundProtobufsInternal$ = new rxjs_1.Subject();
/**
* The fully-decoded, outbound protobufs. If any errors are encountered
* during encoding/decoding, this Observable will error out.
*/
this.outboundProtobufs$ = this.outboundProtobufsInternal$.pipe();
this.outboundBuffers$

@@ -91,15 +93,18 @@ .pipe((0, operators_1.mergeMap)(buffer => this.decode(buffer)))

class Packet {
constructor() {
// The number of bits we've consumed so far to fill out `payloadLength`.
this.payloadLengthBits = 0;
// The length of the next message, in bytes.
//
// This is built up from a [varint]. Once it's fully consumed, `payload` is
// initialized and this is reset to 0.
//
// [varint]: https://developers.google.com/protocol-buffers/docs/encoding#varints
this.payloadLength = 0;
// The offset in [payload] that should be written to next time data arrives.
this.payloadOffset = 0;
}
// The number of bits we've consumed so far to fill out `payloadLength`.
payloadLengthBits = 0;
// The length of the next message, in bytes.
//
// This is built up from a [varint]. Once it's fully consumed, `payload` is
// initialized and this is reset to 0.
//
// [varint]: https://developers.google.com/protocol-buffers/docs/encoding#varints
payloadLength = 0;
/**
* The packet's payload. Constructed by calls to write().
* @see write
*/
payload;
// The offset in [payload] that should be written to next time data arrives.
payloadOffset = 0;
/** Whether the packet construction is complete. */

@@ -106,0 +111,0 @@ get isComplete() {

@@ -29,2 +29,5 @@ "use strict";

class Protofier {
functions;
/** All the argument lists returned by `deprotofy()`. */
argumentLists = [];
/**

@@ -47,4 +50,2 @@ * Returns IDs of all argument lists passed to `deprotofy()` whose keywords

this.functions = functions;
/** All the argument lists returned by `deprotofy()`. */
this.argumentLists = [];
}

@@ -223,3 +224,2 @@ /** Converts `value` to its protocol buffer representation. */

deprotofy(value) {
var _a, _b, _c, _d;
switch (value.value.case) {

@@ -237,6 +237,6 @@ case 'string': {

const color = value.value.value;
const channel1 = (_a = color.channel1) !== null && _a !== void 0 ? _a : null;
const channel2 = (_b = color.channel2) !== null && _b !== void 0 ? _b : null;
const channel3 = (_c = color.channel3) !== null && _c !== void 0 ? _c : null;
const alpha = (_d = color.alpha) !== null && _d !== void 0 ? _d : null;
const channel1 = color.channel1 ?? null;
const channel2 = color.channel2 ?? null;
const channel3 = color.channel3 ?? null;
const alpha = color.alpha ?? null;
const space = color.space;

@@ -243,0 +243,0 @@ switch (color.space.toLowerCase()) {

@@ -12,7 +12,5 @@ "use strict";

class RequestTracker {
constructor() {
// The indices of this array correspond to each pending request's ID. Stores
// the response type expected by each request.
this.requests = [];
}
// The indices of this array correspond to each pending request's ID. Stores
// the response type expected by each request.
requests = [];
/** The next available request ID. */

@@ -19,0 +17,0 @@ get nextId() {

@@ -11,2 +11,24 @@ "use strict";

/**
* The `FunctionCallRequest`-scoped ID of this argument list, used to tell the
* compiler which argument lists have had their keywords accessed during a
* function call.
*
* The special ID 0 indicates an argument list constructed in the host.
*
* This is marked as public so that the protofier can access it, but it's not
* part of the package's public API and should not be accessed by user code.
* It may be renamed or removed without warning in the future.
*/
id;
/**
* The argument list's keywords. This isn't exposed directly so that we can
* set `keywordsAccessed` when the user reads it.
*
* This is marked as public so that the protofier can access it, but it's not
* part of the package's public API and should not be accessed by user code.
* It may be renamed or removed without warning in the future.
*/
keywordsInternal;
_keywordsAccessed = false;
/**
* Whether the `keywords` getter has been accessed.

@@ -27,7 +49,6 @@ *

super(contents, { separator });
this._keywordsAccessed = false;
this.keywordsInternal = (0, immutable_1.isOrderedMap)(keywords)
? keywords
: (0, immutable_1.OrderedMap)(keywords);
this.id = id !== null && id !== void 0 ? id : 0;
this.id = id ?? 0;
}

@@ -34,0 +55,0 @@ }

@@ -12,2 +12,7 @@ "use strict";

class SassBooleanInternal extends index_1.Value {
valueInternal;
// Whether callers are allowed to construct this class. This is set to
// `false` once the two constants are constructed so that the constructor
// throws an error for future calls, in accordance with the legacy API.
static constructionAllowed = true;
constructor(valueInternal) {

@@ -40,2 +45,5 @@ super();

}
// Legacy API support
static TRUE;
static FALSE;
getValue() {

@@ -46,6 +54,2 @@ return this.value;

exports.SassBooleanInternal = SassBooleanInternal;
// Whether callers are allowed to construct this class. This is set to
// `false` once the two constants are constructed so that the constructor
// throws an error for future calls, in accordance with the legacy API.
SassBooleanInternal.constructionAllowed = true;
/** The singleton instance of SassScript true. */

@@ -52,0 +56,0 @@ exports.sassTrue = new SassBooleanInternal(true);

@@ -21,2 +21,4 @@ "use strict";

class SassCalculation extends index_1.Value {
name;
arguments;
constructor(name, args) {

@@ -70,2 +72,5 @@ super();

class CalculationOperation {
operator;
left;
right;
constructor(operator, left, right) {

@@ -93,2 +98,3 @@ this.operator = operator;

class CalculationInterpolation {
value;
constructor(value) {

@@ -95,0 +101,0 @@ this.value = value;

@@ -162,4 +162,3 @@ "use strict";

function decodeCoordsFromColorJs(coords, // ColorJS coordinates
isRgb = false // Whether this color is in the `rgb` color space
) {
isRgb = false) {
let newCoords = coords;

@@ -225,2 +224,15 @@ // If this color is in the `rgb` space, convert channel values to `0-255`

class SassColor extends index_1.Value {
// ColorJS color object
color;
// Boolean indicating whether this color is in RGB format
//
// ColorJS treats `rgb` as an output format of the `srgb` color space, while
// Sass treats it as its own color space. By internally tracking whether this
// color is `rgb` or not, we can use `srgb` consistently for ColorJS while
// still returning expected `rgb` values for Sass users.
isRgb = false;
// Names for the channels of this color
channel0Id;
channel1Id;
channel2Id;
// Sets channel names based on this color's color space

@@ -272,11 +284,3 @@ setChannelIds(space) {

constructor(optionsMaybeWithColor) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
super();
// Boolean indicating whether this color is in RGB format
//
// ColorJS treats `rgb` as an output format of the `srgb` color space, while
// Sass treats it as its own color space. By internally tracking whether this
// color is `rgb` or not, we can use `srgb` consistently for ColorJS while
// still returning expected `rgb` values for Sass users.
this.isRgb = false;
let options;

@@ -295,3 +299,3 @@ // Use existing ColorJS color object from options for the new SassColor

}
const space = (_a = options.space) !== null && _a !== void 0 ? _a : getColorSpace(options);
const space = options.space ?? getColorSpace(options);
this.setChannelIds(space);

@@ -315,5 +319,5 @@ if (space === 'rgb')

case 'srgb': {
const red = (_b = options.red) !== null && _b !== void 0 ? _b : NaN;
const green = (_c = options.green) !== null && _c !== void 0 ? _c : NaN;
const blue = (_d = options.blue) !== null && _d !== void 0 ? _d : NaN;
const red = options.red ?? NaN;
const green = options.green ?? NaN;
const blue = options.blue ?? NaN;
if (this.isRgb) {

@@ -344,5 +348,5 @@ this.color = new colorjs_io_1.default({

coords: [
(_e = options.red) !== null && _e !== void 0 ? _e : NaN,
(_f = options.green) !== null && _f !== void 0 ? _f : NaN,
(_g = options.blue) !== null && _g !== void 0 ? _g : NaN,
options.red ?? NaN,
options.green ?? NaN,
options.blue ?? NaN,
],

@@ -353,5 +357,5 @@ alpha,

case 'hsl': {
let hue = normalizeHue((_h = options.hue) !== null && _h !== void 0 ? _h : NaN);
let saturation = (_j = options.saturation) !== null && _j !== void 0 ? _j : NaN;
const lightness = (_k = options.lightness) !== null && _k !== void 0 ? _k : NaN;
let hue = normalizeHue(options.hue ?? NaN);
let saturation = options.saturation ?? NaN;
const lightness = options.lightness ?? NaN;
if (!Number.isNaN(saturation) && (0, utils_2.fuzzyLessThan)(saturation, 0)) {

@@ -369,5 +373,5 @@ saturation = Math.abs(saturation);

case 'hwb': {
const hue = normalizeHue((_l = options.hue) !== null && _l !== void 0 ? _l : NaN);
const whiteness = (_m = options.whiteness) !== null && _m !== void 0 ? _m : NaN;
const blackness = (_o = options.blackness) !== null && _o !== void 0 ? _o : NaN;
const hue = normalizeHue(options.hue ?? NaN);
const whiteness = options.whiteness ?? NaN;
const blackness = options.blackness ?? NaN;
this.color = new colorjs_io_1.default({

@@ -382,5 +386,5 @@ spaceId: encodeSpaceForColorJs(space),

case 'oklab': {
const lightness = (_p = options.lightness) !== null && _p !== void 0 ? _p : NaN;
const a = (_q = options.a) !== null && _q !== void 0 ? _q : NaN;
const b = (_r = options.b) !== null && _r !== void 0 ? _r : NaN;
const lightness = options.lightness ?? NaN;
const a = options.a ?? NaN;
const b = options.b ?? NaN;
this.color = new colorjs_io_1.default({

@@ -395,5 +399,5 @@ spaceId: encodeSpaceForColorJs(space),

case 'oklch': {
const lightness = (_s = options.lightness) !== null && _s !== void 0 ? _s : NaN;
let chroma = (_t = options.chroma) !== null && _t !== void 0 ? _t : NaN;
let hue = normalizeHue((_u = options.hue) !== null && _u !== void 0 ? _u : NaN);
const lightness = options.lightness ?? NaN;
let chroma = options.chroma ?? NaN;
let hue = normalizeHue(options.hue ?? NaN);
if (!Number.isNaN(chroma) && (0, utils_2.fuzzyLessThan)(chroma, 0)) {

@@ -415,3 +419,3 @@ chroma = Math.abs(chroma);

spaceId: encodeSpaceForColorJs(space),
coords: [(_v = options.x) !== null && _v !== void 0 ? _v : NaN, (_w = options.y) !== null && _w !== void 0 ? _w : NaN, (_x = options.z) !== null && _x !== void 0 ? _x : NaN],
coords: [options.x ?? NaN, options.y ?? NaN, options.z ?? NaN],
alpha,

@@ -577,12 +581,11 @@ });

});
return new SassColor({ color, space: space !== null && space !== void 0 ? space : this.space });
return new SassColor({ color, space: space ?? this.space });
}
channel(channel, options) {
var _a;
if (channel === 'alpha')
return this.alpha;
let val;
const space = (_a = options === null || options === void 0 ? void 0 : options.space) !== null && _a !== void 0 ? _a : this.space;
const space = options?.space ?? this.space;
validateChannelInSpace(channel, space);
if (options === null || options === void 0 ? void 0 : options.space) {
if (options?.space) {
val = this.color.get({

@@ -621,3 +624,3 @@ space: encodeSpaceForColorJs(options.space),

return false;
const color = (options === null || options === void 0 ? void 0 : options.space) ? this.toSpace(options.space) : this;
const color = options?.space ? this.toSpace(options.space) : this;
validateChannelInSpace(channel, color.space);

@@ -656,5 +659,5 @@ const channels = color.channels.toArray();

interpolate(color2, options) {
var _a, _b;
const hueInterpolationMethod = (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : (isPolarColorSpace(this.space) ? 'shorter' : undefined);
const weight = (_b = options === null || options === void 0 ? void 0 : options.weight) !== null && _b !== void 0 ? _b : 0.5;
const hueInterpolationMethod = options?.method ??
(isPolarColorSpace(this.space) ? 'shorter' : undefined);
const weight = options?.weight ?? 0.5;
if ((0, utils_2.fuzzyEquals)(weight, 0))

@@ -702,3 +705,3 @@ return color2;

emitColor4ApiChangeSpaceDeprecation();
return space !== null && space !== void 0 ? space : this.space;
return space ?? this.space;
}

@@ -710,3 +713,2 @@ /**

getChangedColor(options, space, spaceSetExplicitly) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
const color = this.toSpace(space);

@@ -732,6 +734,6 @@ function getChangedValue(channel) {

return new SassColor({
hue: (_a = options.hue) !== null && _a !== void 0 ? _a : color.channel('hue'),
saturation: (_b = options.saturation) !== null && _b !== void 0 ? _b : color.channel('saturation'),
lightness: (_c = options.lightness) !== null && _c !== void 0 ? _c : color.channel('lightness'),
alpha: (_d = options.alpha) !== null && _d !== void 0 ? _d : color.channel('alpha'),
hue: options.hue ?? color.channel('hue'),
saturation: options.saturation ?? color.channel('saturation'),
lightness: options.lightness ?? color.channel('lightness'),
alpha: options.alpha ?? color.channel('alpha'),
space,

@@ -753,6 +755,6 @@ });

return new SassColor({
hue: (_e = options.hue) !== null && _e !== void 0 ? _e : color.channel('hue'),
whiteness: (_f = options.whiteness) !== null && _f !== void 0 ? _f : color.channel('whiteness'),
blackness: (_g = options.blackness) !== null && _g !== void 0 ? _g : color.channel('blackness'),
alpha: (_h = options.alpha) !== null && _h !== void 0 ? _h : color.channel('alpha'),
hue: options.hue ?? color.channel('hue'),
whiteness: options.whiteness ?? color.channel('whiteness'),
blackness: options.blackness ?? color.channel('blackness'),
alpha: options.alpha ?? color.channel('alpha'),
space,

@@ -774,6 +776,6 @@ });

return new SassColor({
red: (_j = options.red) !== null && _j !== void 0 ? _j : color.channel('red'),
green: (_k = options.green) !== null && _k !== void 0 ? _k : color.channel('green'),
blue: (_l = options.blue) !== null && _l !== void 0 ? _l : color.channel('blue'),
alpha: (_m = options.alpha) !== null && _m !== void 0 ? _m : color.channel('alpha'),
red: options.red ?? color.channel('red'),
green: options.green ?? color.channel('green'),
blue: options.blue ?? color.channel('blue'),
alpha: options.alpha ?? color.channel('alpha'),
space,

@@ -826,5 +828,4 @@ });

change(options) {
var _a;
const spaceSetExplicitly = !!options.space;
let space = (_a = options.space) !== null && _a !== void 0 ? _a : this.space;
let space = options.space ?? this.space;
if (this.isLegacy && !spaceSetExplicitly) {

@@ -831,0 +832,0 @@ space = this.getLegacyChangeSpace(options);

@@ -11,2 +11,29 @@ "use strict";

class SassFunction extends index_1.Value {
/**
* If this function is defined in the compiler, this is the unique ID that the
* compiler uses to determine which function it refers to.
*
* This is marked as public so that the protofier can access it, but it's not
* part of the package's public API and should not be accessed by user code.
* It may be renamed or removed without warning in the future.
*/
id;
/**
* If this function is defined in the host, this is the signature that
* describes how to pass arguments to it.
*
* This is marked as public so that the protofier can access it, but it's not
* part of the package's public API and should not be accessed by user code.
* It may be renamed or removed without warning in the future.
*/
signature;
/**
* If this function is defined in the host, this is the callback to run when
* the function is invoked from a stylesheet.
*
* This is marked as public so that the protofier can access it, but it's not
* part of the package's public API and should not be accessed by user code.
* It may be renamed or removed without warning in the future.
*/
callback;
constructor(idOrSignature, callback) {

@@ -13,0 +40,0 @@ super();

@@ -16,4 +16,6 @@ "use strict";

class SassList extends index_1.Value {
contentsInternal;
separatorInternal;
hasBracketsInternal;
constructor(contentsOrOptions, options) {
var _a;
super();

@@ -27,8 +29,8 @@ if ((0, immutable_1.isList)(contentsOrOptions) || Array.isArray(contentsOrOptions)) {

}
if (this.contentsInternal.size > 1 && (options === null || options === void 0 ? void 0 : options.separator) === null) {
if (this.contentsInternal.size > 1 && options?.separator === null) {
throw Error('Non-null separator required for SassList with more than one element.');
}
this.separatorInternal =
(options === null || options === void 0 ? void 0 : options.separator) === undefined ? ',' : options.separator;
this.hasBracketsInternal = (_a = options === null || options === void 0 ? void 0 : options.brackets) !== null && _a !== void 0 ? _a : false;
options?.separator === undefined ? ',' : options.separator;
this.hasBracketsInternal = options?.brackets ?? false;
}

@@ -35,0 +37,0 @@ get asList() {

@@ -12,6 +12,7 @@ "use strict";

class SassMap extends index_1.Value {
contentsInternal;
/** Returns a map that contains `contents`. */
constructor(contents) {
super();
this.contentsInternal = contents !== null && contents !== void 0 ? contents : (0, immutable_1.OrderedMap)();
this.contentsInternal = contents ?? (0, immutable_1.OrderedMap)();
}

@@ -18,0 +19,0 @@ /** The separator for `this`'s contents as a list. */

@@ -11,2 +11,11 @@ "use strict";

class SassMixin extends index_1.Value {
/**
* This is the unique ID that the compiler uses to determine which mixin it
* refers to.
*
* This is marked as public so that the protofier can access it, but it's not
* part of the package's public API and should not be accessed by user code.
* It may be renamed or removed without warning in the future.
*/
id;
constructor(id) {

@@ -13,0 +22,0 @@ super();

@@ -13,2 +13,6 @@ "use strict";

class SassNull extends index_1.Value {
// Whether callers are allowed to construct this class. This is set to
// `false` once the two constants are constructed so that the constructor
// throws an error for future calls, in accordance with the legacy API.
static constructionAllowed = true;
constructor() {

@@ -37,8 +41,6 @@ super();

}
// Legacy API support
static NULL;
}
exports.SassNull = SassNull;
// Whether callers are allowed to construct this class. This is set to
// `false` once the two constants are constructed so that the constructor
// throws an error for future calls, in accordance with the legacy API.
SassNull.constructionAllowed = true;
/** The singleton instance of SassScript null. */

@@ -45,0 +47,0 @@ exports.sassNull = new SassNull();

@@ -149,4 +149,6 @@ "use strict";

class SassNumber extends index_1.Value {
valueInternal;
numeratorUnitsInternal;
denominatorUnitsInternal;
constructor(value, unitOrOptions) {
var _a, _b;
super();

@@ -160,4 +162,4 @@ if (typeof unitOrOptions === 'string') {

}
let numerators = (0, utils_1.asImmutableList)((_a = unitOrOptions === null || unitOrOptions === void 0 ? void 0 : unitOrOptions.numeratorUnits) !== null && _a !== void 0 ? _a : []);
const unsimplifiedDenominators = (_b = unitOrOptions === null || unitOrOptions === void 0 ? void 0 : unitOrOptions.denominatorUnits) !== null && _b !== void 0 ? _b : [];
let numerators = (0, utils_1.asImmutableList)(unitOrOptions?.numeratorUnits ?? []);
const unsimplifiedDenominators = unitOrOptions?.denominatorUnits ?? [];
const denominators = [];

@@ -444,3 +446,3 @@ for (const denominator of unsimplifiedDenominators) {

}
catch (_a) {
catch {
return false;

@@ -552,3 +554,2 @@ }

function conversionFactor(fromUnit, toUnit) {
var _a;
if (fromUnit === toUnit)

@@ -559,3 +560,3 @@ return 1;

return null;
return (_a = factors[fromUnit]) !== null && _a !== void 0 ? _a : null;
return factors[fromUnit] ?? null;
}

@@ -562,0 +563,0 @@ // Returns a human-readable string representation of `numerators` and

@@ -12,12 +12,13 @@ "use strict";

class SassString extends index_1.Value {
textInternal;
hasQuotesInternal;
constructor(textOrOptions, options) {
var _a, _b;
super();
if (typeof textOrOptions === 'string') {
this.textInternal = textOrOptions;
this.hasQuotesInternal = (_a = options === null || options === void 0 ? void 0 : options.quotes) !== null && _a !== void 0 ? _a : true;
this.hasQuotesInternal = options?.quotes ?? true;
}
else {
this.textInternal = '';
this.hasQuotesInternal = (_b = textOrOptions === null || textOrOptions === void 0 ? void 0 : textOrOptions.quotes) !== null && _b !== void 0 ? _b : true;
this.hasQuotesInternal = textOrOptions?.quotes ?? true;
}

@@ -27,3 +28,3 @@ }

static empty(options) {
return options === undefined || (options === null || options === void 0 ? void 0 : options.quotes)
return options === undefined || options?.quotes
? emptyQuoted

@@ -30,0 +31,0 @@ : emptyUnquoted;

@@ -8,2 +8,5 @@ "use strict";

class Version {
major;
minor;
patch;
constructor(major, minor, patch) {

@@ -10,0 +13,0 @@ this.major = major;

{
"name": "sass-embedded",
"version": "1.80.6",
"version": "1.80.7",
"protocol-version": "3.1.0",
"compiler-version": "1.80.6",
"compiler-version": "1.80.7",
"description": "Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol",

@@ -41,22 +41,22 @@ "repository": "sass/embedded-host-node",

"optionalDependencies": {
"sass-embedded-android-arm": "1.80.6",
"sass-embedded-android-arm64": "1.80.6",
"sass-embedded-android-ia32": "1.80.6",
"sass-embedded-android-riscv64": "1.80.6",
"sass-embedded-android-x64": "1.80.6",
"sass-embedded-darwin-arm64": "1.80.6",
"sass-embedded-darwin-x64": "1.80.6",
"sass-embedded-linux-arm": "1.80.6",
"sass-embedded-linux-arm64": "1.80.6",
"sass-embedded-linux-ia32": "1.80.6",
"sass-embedded-linux-riscv64": "1.80.6",
"sass-embedded-linux-x64": "1.80.6",
"sass-embedded-linux-musl-arm": "1.80.6",
"sass-embedded-linux-musl-arm64": "1.80.6",
"sass-embedded-linux-musl-ia32": "1.80.6",
"sass-embedded-linux-musl-riscv64": "1.80.6",
"sass-embedded-linux-musl-x64": "1.80.6",
"sass-embedded-win32-arm64": "1.80.6",
"sass-embedded-win32-ia32": "1.80.6",
"sass-embedded-win32-x64": "1.80.6"
"sass-embedded-android-arm": "1.80.7",
"sass-embedded-android-arm64": "1.80.7",
"sass-embedded-android-ia32": "1.80.7",
"sass-embedded-android-riscv64": "1.80.7",
"sass-embedded-android-x64": "1.80.7",
"sass-embedded-darwin-arm64": "1.80.7",
"sass-embedded-darwin-x64": "1.80.7",
"sass-embedded-linux-arm": "1.80.7",
"sass-embedded-linux-arm64": "1.80.7",
"sass-embedded-linux-ia32": "1.80.7",
"sass-embedded-linux-riscv64": "1.80.7",
"sass-embedded-linux-x64": "1.80.7",
"sass-embedded-linux-musl-arm": "1.80.7",
"sass-embedded-linux-musl-arm64": "1.80.7",
"sass-embedded-linux-musl-ia32": "1.80.7",
"sass-embedded-linux-musl-riscv64": "1.80.7",
"sass-embedded-linux-musl-x64": "1.80.7",
"sass-embedded-win32-arm64": "1.80.7",
"sass-embedded-win32-ia32": "1.80.7",
"sass-embedded-win32-x64": "1.80.7"
},

@@ -67,5 +67,6 @@ "dependencies": {

"colorjs.io": "^0.5.0",
"immutable": "^4.0.0",
"immutable": "^5.0.2",
"rxjs": "^7.4.0",
"supports-color": "^8.1.1",
"sync-child-process": "^1.0.2",
"varint": "^6.0.0"

@@ -87,3 +88,3 @@ },

"extract-zip": "^2.0.1",
"gts": "^5.0.0",
"gts": "^6.0.2",
"jest": "^29.4.1",

@@ -90,0 +91,0 @@ "minipass": "7.1.2",

@@ -21,3 +21,3 @@ "use strict";

fs.mkdirSync(testDir, { recursive: true });
if (options === null || options === void 0 ? void 0 : options.sassPathDirs) {
if (options?.sassPathDirs) {
process.env.SASS_PATH = options.sassPathDirs.join(process.platform === 'win32' ? ';' : ':');

@@ -29,3 +29,3 @@ }

finally {
if (options === null || options === void 0 ? void 0 : options.sassPathDirs)
if (options?.sassPathDirs)
process.env.SASS_PATH = undefined;

@@ -32,0 +32,0 @@ // TODO(awjin): Change this to rmSync once we drop support for Node 12.

@@ -17,3 +17,2 @@ "use strict";

async function getEmbeddedCompiler(outPath, options) {
var _a;
const repo = 'dart-sass';

@@ -25,3 +24,3 @@ let source;

outPath: 'build',
ref: (_a = options === null || options === void 0 ? void 0 : options.ref) !== null && _a !== void 0 ? _a : 'main',
ref: options?.ref ?? 'main',
});

@@ -28,0 +27,0 @@ source = p.join('build', repo);

@@ -18,3 +18,2 @@ "use strict";

async function getLanguageRepo(outPath, options) {
var _a;
if (!options || 'ref' in options) {

@@ -24,3 +23,3 @@ utils.fetchRepo({

outPath: utils.BUILD_PATH,
ref: (_a = options === null || options === void 0 ? void 0 : options.ref) !== null && _a !== void 0 ? _a : 'main',
ref: options?.ref ?? 'main',
});

@@ -27,0 +26,0 @@ }

{
"name": "sass-embedded",
"version": "1.80.6",
"version": "1.80.7",
"protocol-version": "3.1.0",
"compiler-version": "1.80.6",
"compiler-version": "1.80.7",
"description": "Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol",

@@ -41,22 +41,22 @@ "repository": "sass/embedded-host-node",

"optionalDependencies": {
"sass-embedded-android-arm": "1.80.6",
"sass-embedded-android-arm64": "1.80.6",
"sass-embedded-android-ia32": "1.80.6",
"sass-embedded-android-riscv64": "1.80.6",
"sass-embedded-android-x64": "1.80.6",
"sass-embedded-darwin-arm64": "1.80.6",
"sass-embedded-darwin-x64": "1.80.6",
"sass-embedded-linux-arm": "1.80.6",
"sass-embedded-linux-arm64": "1.80.6",
"sass-embedded-linux-ia32": "1.80.6",
"sass-embedded-linux-riscv64": "1.80.6",
"sass-embedded-linux-x64": "1.80.6",
"sass-embedded-linux-musl-arm": "1.80.6",
"sass-embedded-linux-musl-arm64": "1.80.6",
"sass-embedded-linux-musl-ia32": "1.80.6",
"sass-embedded-linux-musl-riscv64": "1.80.6",
"sass-embedded-linux-musl-x64": "1.80.6",
"sass-embedded-win32-arm64": "1.80.6",
"sass-embedded-win32-ia32": "1.80.6",
"sass-embedded-win32-x64": "1.80.6"
"sass-embedded-android-arm": "1.80.7",
"sass-embedded-android-arm64": "1.80.7",
"sass-embedded-android-ia32": "1.80.7",
"sass-embedded-android-riscv64": "1.80.7",
"sass-embedded-android-x64": "1.80.7",
"sass-embedded-darwin-arm64": "1.80.7",
"sass-embedded-darwin-x64": "1.80.7",
"sass-embedded-linux-arm": "1.80.7",
"sass-embedded-linux-arm64": "1.80.7",
"sass-embedded-linux-ia32": "1.80.7",
"sass-embedded-linux-riscv64": "1.80.7",
"sass-embedded-linux-x64": "1.80.7",
"sass-embedded-linux-musl-arm": "1.80.7",
"sass-embedded-linux-musl-arm64": "1.80.7",
"sass-embedded-linux-musl-ia32": "1.80.7",
"sass-embedded-linux-musl-riscv64": "1.80.7",
"sass-embedded-linux-musl-x64": "1.80.7",
"sass-embedded-win32-arm64": "1.80.7",
"sass-embedded-win32-ia32": "1.80.7",
"sass-embedded-win32-x64": "1.80.7"
},

@@ -67,5 +67,6 @@ "dependencies": {

"colorjs.io": "^0.5.0",
"immutable": "^4.0.0",
"immutable": "^5.0.2",
"rxjs": "^7.4.0",
"supports-color": "^8.1.1",
"sync-child-process": "^1.0.2",
"varint": "^6.0.0"

@@ -87,3 +88,3 @@ },

"extract-zip": "^2.0.1",
"gts": "^5.0.0",
"gts": "^6.0.2",
"jest": "^29.4.1",

@@ -90,0 +91,0 @@ "minipass": "7.1.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc