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

indent.js

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indent.js - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

tests/javascript/umd.spec.js

26

docs/js/main.js

@@ -172,7 +172,5 @@ var mode;

function init() {
editor.connect(function () {
editor.connect().then(function () {
changeExample('jsx:class');
}, null, {
maxTries: 50
});
})
}

@@ -189,5 +187,7 @@

mode = id.split(':')[0];
editor.configure({
text: EXAMPLES[id],
mode: mode
editor.send({
editor: {
text: EXAMPLES[id],
mode: mode
}
});

@@ -203,4 +203,4 @@ }

tabSize = size;
editor.configure({
tabSize: tabSizeMap[size]
editor.send({
editor: {tabSize: tabSizeMap[size]}
});

@@ -210,3 +210,3 @@ }

function indentCode() {
editor.getText(function (e) {
editor.getText().then(function (text) {
var modeMap = {

@@ -225,6 +225,8 @@ 'less': 'css',

};
editor.configure({
text: indent[modeMap[mode]](e.data, {tabString: tabStringMap[tabSize]})
return editor.send({
editor: {
text: indent[modeMap[mode]](text, {tabString: tabStringMap[tabSize]})
}
});
});
}
{
"name": "indent.js",
"version": "0.3.4",
"version": "0.3.5",
"description": "Fast minimalistic pure indentation of JavaScript, CSS, and HTML.",

@@ -5,0 +5,0 @@ "main": "lib/indent.js",

@@ -49,3 +49,3 @@ # indent.js - pure code indentation for js, jsx, json, ts, tsx, html, css, less, scss

```javascript
import {indent} from 'indent.js';
import indent from 'indent.js';

@@ -52,0 +52,0 @@ var indentedJs = indent.js(code); // JSX as well

@@ -19,2 +19,14 @@ var sut = require('../../lib/indent').js;

it('if: single line with object and comment', function () {
var expected = `
if (a) // Test
b = {
c: 0,
d: 1
}
`;
expect(sut(expected, {tabString: ts})).to.equal(
expected.replace(/\r*\n/g, '\r\n'));
});
it('if: single line', function () {

@@ -21,0 +33,0 @@ var expected = `

@@ -23,2 +23,18 @@ var sut = require('../../lib/indent').js;

});
});
it('empty object declaration', function () {
var expected = `
{
}
`;
expect(sut(expected, {tabString: ts})).to.equal(
expected.replace(/\r*\n/g, '\r\n'));
});
it('empty object with brackets', function () {
var expected = `({
})`;
expect(sut(expected, {tabString: ts})).to.equal(
expected.replace(/\r*\n/g, '\r\n'));
});
});

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