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

@stylable/code-formatter

Package Overview
Dependencies
Maintainers
6
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stylable/code-formatter - npm Package Compare versions

Comparing version 5.6.1 to 5.7.0

dist/format-css.d.ts

2

dist/formatter.d.ts
import { CSSBeautifyOptions } from 'js-beautify';
import { FormatOptions } from './format-css';
export declare function formatDocumentExperimental(source: string, options: Partial<FormatOptions>): string;
export declare function getDocumentFormatting(content: string, offset?: {

@@ -3,0 +5,0 @@ start: number;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDocumentFormatting = void 0;
exports.getDocumentFormatting = exports.formatDocumentExperimental = void 0;
const index_internal_1 = require("@stylable/core/dist/index-internal");
const js_beautify_1 = require("js-beautify");
const format_css_1 = require("./format-css");
/* new experimental formatter */
function formatDocumentExperimental(source, options) {
// ToDo: support range
let targetCss = source;
try {
targetCss = (0, format_css_1.formatCSS)(source, options);
}
catch (e) {
// return unchanged source on error
}
return targetCss;
}
exports.formatDocumentExperimental = formatDocumentExperimental;
/* format with js-prettify */
function getDocumentFormatting(content, offset, options) {

@@ -7,0 +22,0 @@ const offsetStart = (offset === null || offset === void 0 ? void 0 : offset.start) || 0;

3

dist/index.d.ts

@@ -1,2 +0,3 @@

export { getDocumentFormatting } from './formatter';
export { formatDocumentExperimental, getDocumentFormatting } from './formatter';
export { formatCSS } from './format-css';
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDocumentFormatting = void 0;
exports.formatCSS = exports.getDocumentFormatting = exports.formatDocumentExperimental = void 0;
var formatter_1 = require("./formatter");
Object.defineProperty(exports, "formatDocumentExperimental", { enumerable: true, get: function () { return formatter_1.formatDocumentExperimental; } });
Object.defineProperty(exports, "getDocumentFormatting", { enumerable: true, get: function () { return formatter_1.getDocumentFormatting; } });
var format_css_1 = require("./format-css");
Object.defineProperty(exports, "formatCSS", { enumerable: true, get: function () { return format_css_1.formatCSS; } });
//# sourceMappingURL=index.js.map
{
"name": "@stylable/code-formatter",
"version": "5.6.1",
"version": "5.7.0",
"description": "A code formatting utility for Stylable stylesheets",

@@ -10,4 +10,6 @@ "main": "dist/index.js",

"dependencies": {
"@stylable/core": "^5.6.1",
"js-beautify": "^1.14.7"
"@stylable/core": "^5.7.0",
"@tokey/css-value-parser": "^0.1.2",
"js-beautify": "^1.14.7",
"postcss": "^8.4.21"
},

@@ -14,0 +16,0 @@ "files": [

import { safeParse } from '@stylable/core/dist/index-internal';
import { css, CSSBeautifyOptions } from 'js-beautify';
import type { Root } from 'postcss';
import { formatCSS, FormatOptions } from './format-css';
/* new experimental formatter */
export function formatDocumentExperimental(source: string, options: Partial<FormatOptions>) {
// ToDo: support range
let targetCss = source;
try {
targetCss = formatCSS(source, options);
} catch (e) {
// return unchanged source on error
}
return targetCss;
}
/* format with js-prettify */
export function getDocumentFormatting(

@@ -6,0 +22,0 @@ content: string,

@@ -1,1 +0,2 @@

export { getDocumentFormatting } from './formatter';
export { formatDocumentExperimental, getDocumentFormatting } from './formatter';
export { formatCSS } from './format-css';

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