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

tscommons-core

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tscommons-core - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

1

dist/helpers/commons-number.d.ts

@@ -19,2 +19,3 @@ export declare abstract class CommonsNumber {

static prettyPercent(value: number, whole?: boolean): string;
static sampleIndices(length: number, samples: number, blockSize: number, allowUnderflow?: boolean): number[];
}

@@ -167,4 +167,26 @@ "use strict";

}
static sampleIndices(length, samples, blockSize, allowUnderflow = false) {
if (length === 0)
return [];
if (blockSize > length && !allowUnderflow)
return [];
if (samples < 1)
throw new Error('Minimum of 2 samples required');
if (blockSize < 1)
throw new Error('Minimum of block size 1 required');
let step = Math.floor(length / samples);
if (step < blockSize)
step = blockSize;
const indices = [];
let index = 0;
while (true) {
indices.push(index);
index += step;
if ((index + blockSize) > length)
break;
}
return indices;
}
}
exports.CommonsNumber = CommonsNumber;
//# sourceMappingURL=commons-number.js.map

3

dist/helpers/commons-type.js

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

// unknown
console.log('Unknown value type encountered', typeof test);
return false;

@@ -597,3 +596,2 @@ }

// unknown
console.log('Unknown value type encountered', typeof value);
return value;

@@ -632,3 +630,2 @@ }

// unknown
console.log('Unknown value type encountered', typeof value);
return value;

@@ -635,0 +632,0 @@ }

{
"name": "tscommons-core",
"version": "1.0.0",
"version": "1.0.1",
"description": "",
"scripts": {
"preprepare": "cti ./src && tsc"
"preprepare": "rm -rf ./dist; cti ./src && tsc"
},

@@ -8,0 +8,0 @@ "main": "dist/index.js",

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