modular-scale
Advanced tools
Comparing version 5.1.0 to 5.1.1
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 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
7083
2
6
0
1