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

modular-scale

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modular-scale - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

.github/workflows/ci.yml

27

index.js

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

var defaultBase = 16
var defaultRatio = 1.618
var ratios = {
const defaultBase = 16
const defaultRatio = 1.618
const ratios = {
minorSecond: 1.067,

@@ -23,8 +23,6 @@ majorSecond: 1.125,

module.exports = ModularScale
ModularScale.ratios = ratios
function ModularScale (options) {
options = options || {}
var base = options.base || defaultBase
var ratio = options.ratio || defaultRatio
let base = options.base || defaultBase
let ratio = options.ratio || defaultRatio

@@ -54,3 +52,3 @@ if (typeof base === 'string') {

function up (v, r) {
var c = Math.pow(ratio, v) * base
const c = Math.pow(ratio, v) * base
return r

@@ -62,3 +60,3 @@ ? round(relative(c))

function down (v, r) {
var c = base / Math.pow(ratio, v)
const c = base / Math.pow(ratio, v)
return r

@@ -79,6 +77,6 @@ ? round(relative(c))

v = v || 8
var s = []
var half = Math.floor(v * 0.5)
var i = half * -1
var l = half + 1
const s = []
const half = Math.floor(v * 0.5)
let i = half * -1
const l = half + 1
for (i; i < l; i++) {

@@ -93,1 +91,4 @@ s.push(ms(i, r))

}
ModularScale.ratios = ratios
module.exports = ModularScale
{
"name": "modular-scale",
"version": "5.1.0",
"version": "5.1.1",
"description": "Module for generating a modular scale.",
"main": "index.js",
"scripts": {
"test": "tape test.js | tap-format-spec"
"test": "tape test.js | tap-spek"
},

@@ -21,3 +21,3 @@ "repository": {

"author": "@dam",
"license": "BSD",
"license": "Apache-2.0",
"bugs": {

@@ -28,6 +28,5 @@ "url": "https://github.com/kristoferjoseph/modular-scale/issues"

"devDependencies": {
"@tap-format/spec": "^0.2.0",
"chai": "^2.3.0",
"tap-spek": "^0.0.11",
"tape": "^4.9.0"
}
}

@@ -14,6 +14,6 @@ modular-scale

```
var modularScale = require('modular-scale')
var ms = modularScale({
ratio: 'goldenSection',
```js
var ModularScale = require('modular-scale')
var ms = ModularScale({
ratio: ModularScale.ratios.goldenSection,
base: '16px'

@@ -20,0 +20,0 @@ })

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