New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

swiss-ak

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swiss-ak - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

17

dist/index.js

@@ -425,2 +425,3 @@ var __defProp = Object.defineProperty;

floorTo: () => floorTo,
getOrdinal: () => getOrdinal,
lerp: () => lerp,

@@ -526,2 +527,18 @@ lerpArray: () => lerpArray,

var clamp = (value, min, max) => Math.max(Math.min(min, max), Math.min(value, Math.max(min, max)));
var getOrdinal = (num = 0) => {
const lastDigit = num % 10;
if ([11, 12, 13].includes(num)) {
return "th";
}
if (lastDigit === 1) {
return "st";
}
if (lastDigit === 2) {
return "nd";
}
if (lastDigit === 3) {
return "rd";
}
return "th";
};

@@ -528,0 +545,0 @@ // src/tools/fn.ts

2

package.json
{
"name": "swiss-ak",
"version": "2.0.0",
"version": "2.1.0",
"author": "Jack Cannon <jackc@annon.co.uk> (http://c.annon.co.uk/)",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -159,1 +159,43 @@ import { zip } from './ArrayTools';

export const clamp = (value: number, min: number, max: number) => Math.max(Math.min(min, max), Math.min(value, Math.max(min, max)));
/**<!-- DOCS: ### -->
* getOridinal
*
* - `MathsTools.getOridinal`
*
* Gets the ordinal suffix for a number.
*
* ```typescript
* MathsTools.getOridinal(1); // 'st'
* MathsTools.getOridinal(2); // 'nd'
* MathsTools.getOridinal(3); // 'rd'
* MathsTools.getOridinal(4); // 'th'
*
* MathsTools.getOridinal(11); // 'th'
* MathsTools.getOridinal(12); // 'th'
* MathsTools.getOridinal(13); // 'th'
* MathsTools.getOridinal(14); // 'th'
*
* MathsTools.getOridinal(21); // 'st'
* MathsTools.getOridinal(22); // 'nd'
* MathsTools.getOridinal(23); // 'rd'
* MathsTools.getOridinal(24); // 'th'
* ```
*/
export const getOrdinal = (num: number = 0) => {
const lastDigit = num % 10;
if ([11, 12, 13].includes(num)) {
return 'th';
}
if (lastDigit === 1) {
return 'st';
}
if (lastDigit === 2) {
return 'nd';
}
if (lastDigit === 3) {
return 'rd';
}
return 'th';
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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