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

de-dupe

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

de-dupe - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

6

cli.js

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

addScope: false,
algorithm: 'gzip',
cleanStrings: false,
includeReplacements: false,
minInstances: -1,
minLength: -1
minLength: -1,
type: 'gzip'
};

@@ -46,3 +46,3 @@ if (typeof options !== 'undefined') {

var stringMap = this.getStringMap(topLevelScopes[i]);
if (this.options.algorithm === 'gzip') {
if (this.options.type === 'gzip') {
var scopeReplacements = this.getGzipStringReplacements(stringMap, startingPos, usedNames);

@@ -49,0 +49,0 @@ replacements = replacements.concat(scopeReplacements);

@@ -7,3 +7,3 @@ export interface DedupeOptions {

*/
algorithm?: 'gzip' | 'all';
type?: 'gzip' | 'all';
/**

@@ -10,0 +10,0 @@ * Adds an IIFE around the entire script, this broadens the possible instances

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

addScope: false,
algorithm: 'gzip',
cleanStrings: false,
includeReplacements: false,
minInstances: -1,
minLength: -1
minLength: -1,
type: 'gzip'
};

@@ -44,3 +44,3 @@ if (typeof options !== 'undefined') {

var stringMap = this.getStringMap(topLevelScopes[i]);
if (this.options.algorithm === 'gzip') {
if (this.options.type === 'gzip') {
var scopeReplacements = this.getGzipStringReplacements(stringMap, startingPos, usedNames);

@@ -47,0 +47,0 @@ replacements = replacements.concat(scopeReplacements);

{
"name": "de-dupe",
"bin": ".bin/de-dupe",
"version": "0.0.11",
"version": "0.0.12",
"description": "Deduplicate strings from javascript assets",

@@ -6,0 +6,0 @@ "main": "index.js",

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

#De-dupe - a Javascript string minifier
# De-dupe - a Javascript string minifier
[![Build Status](https://travis-ci.org/markis/de-dupe.svg?branch=master)](https://travis-ci.org/markis/de-dupe) [![Greenkeeper badge](https://badges.greenkeeper.io/markis/de-dupe.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/markis/de-dupe.svg?branch=master)](https://travis-ci.org/markis/de-dupe) [![Known Vulnerabilities](https://snyk.io/test/github/markis/de-dupe/badge.svg)](https://snyk.io/test/github/markis/de-dupe) [![Greenkeeper badge](https://badges.greenkeeper.io/markis/de-dupe.svg)](https://greenkeeper.io/)

@@ -5,0 +5,0 @@ De-dupe is an asset minification process that will identify duplicate strings in all scopes of a javascript file and will introduce a variable instead of the string itself. It does not introduce variables on the global scope, it will keep the variables to the individual scopes that it identifies. It can also clean up strings so that they don't have large amounts of white space in them.

@@ -19,3 +19,3 @@ import {

*/
algorithm?: 'gzip' | 'all';
type?: 'gzip' | 'all';
/**

@@ -77,7 +77,7 @@ * Adds an IIFE around the entire script, this broadens the possible instances

addScope: false,
algorithm: 'gzip',
cleanStrings: false,
includeReplacements: false,
minInstances: -1,
minLength: -1
minLength: -1,
type: 'gzip'
};

@@ -113,3 +113,3 @@

if (this.options.algorithm === 'gzip') {
if (this.options.type === 'gzip') {
const scopeReplacements = this.getGzipStringReplacements(stringMap, startingPos, usedNames);

@@ -116,0 +116,0 @@ replacements = replacements.concat(scopeReplacements);

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

addScope: false,
algorithm: 'gzip',
cleanStrings: false,
includeReplacements: false,
minInstances: -1,
minLength: -1
minLength: -1,
type: 'gzip'
};

@@ -46,3 +46,3 @@ if (typeof options !== 'undefined') {

var stringMap = this.getStringMap(topLevelScopes[i]);
if (this.options.algorithm === 'gzip') {
if (this.options.type === 'gzip') {
var scopeReplacements = this.getGzipStringReplacements(stringMap, startingPos, usedNames);

@@ -356,3 +356,3 @@ replacements = replacements.concat(scopeReplacements);

var dedupe = new Dedupe({
algorithm: 'gzip',
type: 'gzip',
minInstances: 2,

@@ -362,3 +362,3 @@ minLength: 2

var stringCleaner = new Dedupe({
algorithm: 'all',
type: 'all',
cleanStrings: true,

@@ -370,3 +370,3 @@ minInstances: 2,

addScope: true,
algorithm: 'all',
type: 'all',
minInstances: 2,

@@ -373,0 +373,0 @@ minLength: 2

@@ -7,3 +7,3 @@ import 'mocha';

const dedupe = new Dedupe({
algorithm: 'gzip',
type: 'gzip',
minInstances: 2,

@@ -13,3 +13,3 @@ minLength: 2

const stringCleaner = new Dedupe({
algorithm: 'all',
type: 'all',
cleanStrings: true,

@@ -21,3 +21,3 @@ minInstances: 2,

addScope: true,
algorithm: 'all',
type: 'all',
minInstances: 2,

@@ -24,0 +24,0 @@ minLength: 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