Socket
Socket
Sign inDemoInstall

collapse-whitespace

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collapse-whitespace - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

package.json
{
"name": "collapse-whitespace",
"version": "1.1.0",
"version": "1.1.1",
"description": "Remove unnecessary whitespace from an element.",

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

@@ -12,7 +12,7 @@ 'use strict';

function isText (node) {
return node && node.nodeType === Node.TEXT_NODE
return node && node.nodeType === 3 // Node.TEXT_NODE
}
function isElem (node) {
return node && node.nodeType === Node.ELEMENT_NODE
return node && node.nodeType === 1 // Node.ELEMENT_NODE
}

@@ -19,0 +19,0 @@

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

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.collapse=e()}}(function(){var e,n,t;return function r(e,n,t){function i(f,u){if(!n[f]){if(!e[f]){var a=typeof require=="function"&&require;if(!u&&a)return a(f,!0);if(o)return o(f,!0);var d=new Error("Cannot find module '"+f+"'");throw d.code="MODULE_NOT_FOUND",d}var l=n[f]={exports:{}};e[f][0].call(l.exports,function(n){var t=e[f][1][n];return i(t?t:n)},l,l.exports,r,e,n,t)}return n[f].exports}var o=typeof require=="function"&&require;for(var f=0;f<t.length;f++)i(t[f]);return i}({1:[function(e,n,t){n.exports=["address","article","aside","audio","blockquote","canvas","dd","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","noscript","ol","output","p","pre","section","table","tfoot","ul","video"]},{}],2:[function(e,n,t){"use strict";var r=e("block-elements").map(function(e){return e.toUpperCase()});function i(e){return f(e)&&r.indexOf(e.nodeName)>=0}function o(e){return e&&e.nodeType===Node.TEXT_NODE}function f(e){return e&&e.nodeType===Node.ELEMENT_NODE}function u(e,n){var t=/^ /,r=/ $/,u,a,d,l,c;if(typeof n!=="function")n=i;function p(t){while(t&&t!==e){if(t.nextSibling)return t.nextSibling;t=t.parentNode;if(d&&n(t)){d.data=d.data.replace(/[ \r\n\t]$/,"");d=null}}return null}function s(e){return e.firstChild?e.firstChild:p(e)}function h(e){var n=p(e);e.parentNode.removeChild(e);return n}if(e.nodeName==="PRE")return;e.normalize();l=s(e);while(l){a=l.previousSibling;u=l.nextSibling;if(o(l)){c=l.data.replace(/[ \r\n\t]+/g," ");if(!d||a&&n(a))c=c.replace(t,"");if(u&&n(u))c=c.replace(r,"");if(d&&r.test(d.data)&&t.test(c))c=c.substr(1);if(c){l.data=c;d=l;l=p(l)}else{l=h(l)}}else if(f(l)){if(l.nodeName==="PRE"){l=p(l);continue}if(d&&n(l)){d.data=d.data.replace(r,"");d=null}l=s(l)}else{l=h(l)}}if(d)d.data=d.data.replace(r,"")}n.exports=u},{"block-elements":1}]},{},[2])(2)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.collapse=e()}}(function(){var e,n,t;return function r(e,n,t){function i(f,u){if(!n[f]){if(!e[f]){var a=typeof require=="function"&&require;if(!u&&a)return a(f,!0);if(o)return o(f,!0);var l=new Error("Cannot find module '"+f+"'");throw l.code="MODULE_NOT_FOUND",l}var d=n[f]={exports:{}};e[f][0].call(d.exports,function(n){var t=e[f][1][n];return i(t?t:n)},d,d.exports,r,e,n,t)}return n[f].exports}var o=typeof require=="function"&&require;for(var f=0;f<t.length;f++)i(t[f]);return i}({1:[function(e,n,t){n.exports=["address","article","aside","audio","blockquote","canvas","dd","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","noscript","ol","output","p","pre","section","table","tfoot","ul","video"]},{}],2:[function(e,n,t){"use strict";var r=e("block-elements").map(function(e){return e.toUpperCase()});function i(e){return f(e)&&r.indexOf(e.nodeName)>=0}function o(e){return e&&e.nodeType===3}function f(e){return e&&e.nodeType===1}function u(e,n){var t=/^ /,r=/ $/,u,a,l,d,c;if(typeof n!=="function")n=i;function p(t){while(t&&t!==e){if(t.nextSibling)return t.nextSibling;t=t.parentNode;if(l&&n(t)){l.data=l.data.replace(/[ \r\n\t]$/,"");l=null}}return null}function s(e){return e.firstChild?e.firstChild:p(e)}function h(e){var n=p(e);e.parentNode.removeChild(e);return n}if(e.nodeName==="PRE")return;e.normalize();d=s(e);while(d){a=d.previousSibling;u=d.nextSibling;if(o(d)){c=d.data.replace(/[ \r\n\t]+/g," ");if(!l||a&&n(a))c=c.replace(t,"");if(u&&n(u))c=c.replace(r,"");if(l&&r.test(l.data)&&t.test(c))c=c.substr(1);if(c){d.data=c;l=d;d=p(d)}else{d=h(d)}}else if(f(d)){if(d.nodeName==="PRE"){d=p(d);continue}if(l&&n(d)){l.data=l.data.replace(r,"");l=null}d=s(d)}else{d=h(d)}}if(l)l.data=l.data.replace(r,"")}n.exports=u},{"block-elements":1}]},{},[2])(2)});
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