tonal-array
Advanced tools
Comparing version 1.0.0-pre5 to 1.0.0-pre6
@@ -7,2 +7,18 @@ 'use strict'; | ||
/** | ||
* [![npm version](https://img.shields.io/npm/v/tonal-array.svg?style=flat-square)](https://www.npmjs.com/package/tonal-array) | ||
* | ||
* A scale is a collection of pitches in ascending or descending order. | ||
* | ||
* This module provides functions to get and manipulate scales. | ||
* | ||
* @example | ||
* import * as array; | ||
* array.sort(["f", "a", "c"]) // => ['C', 'F', 'A'] | ||
* | ||
* @example | ||
* const array = require('tonal-array) | ||
* array.range(1, 4) // => [1, 2, 3, 4] | ||
* @module array | ||
*/ | ||
// ascending range | ||
@@ -34,2 +50,3 @@ function ascR(b, n) { | ||
/** | ||
* | ||
* Rotates a list a number of times. It's completly agnostic about the | ||
@@ -41,10 +58,11 @@ * contents of the list. | ||
*/ | ||
var rotate = function (times, arr) { | ||
function rotate(times, arr) { | ||
var len = arr.length; | ||
var n = (times % len + len) % len; | ||
return arr.slice(n, len).concat(arr.slice(0, n)); | ||
}; | ||
} | ||
/** | ||
* Return a copy of the array with the null values removed | ||
* @function | ||
* @param {Array} array | ||
@@ -66,3 +84,2 @@ * @return {Array} | ||
* | ||
* @private | ||
* @param {String|Array} notes | ||
@@ -78,3 +95,2 @@ * @return {Array} sorted array of notes | ||
* | ||
* @private | ||
* @function | ||
@@ -81,0 +97,0 @@ * @param {Array} notes |
@@ -0,1 +1,17 @@ | ||
/** | ||
* [![npm version](https://img.shields.io/npm/v/tonal-array.svg?style=flat-square)](https://www.npmjs.com/package/tonal-array) | ||
* | ||
* A scale is a collection of pitches in ascending or descending order. | ||
* | ||
* This module provides functions to get and manipulate scales. | ||
* | ||
* @example | ||
* import * as array; | ||
* array.sort(["f", "a", "c"]) // => ['C', 'F', 'A'] | ||
* | ||
* @example | ||
* const array = require('tonal-array) | ||
* array.range(1, 4) // => [1, 2, 3, 4] | ||
* @module array | ||
*/ | ||
import { midi, name } from "tonal-note"; | ||
@@ -29,2 +45,3 @@ | ||
/** | ||
* | ||
* Rotates a list a number of times. It's completly agnostic about the | ||
@@ -36,10 +53,11 @@ * contents of the list. | ||
*/ | ||
export var rotate = function (times, arr) { | ||
export function rotate(times, arr) { | ||
var len = arr.length; | ||
var n = (times % len + len) % len; | ||
return arr.slice(n, len).concat(arr.slice(0, n)); | ||
}; | ||
} | ||
/** | ||
* Return a copy of the array with the null values removed | ||
* @function | ||
* @param {Array} array | ||
@@ -61,3 +79,2 @@ * @return {Array} | ||
* | ||
* @private | ||
* @param {String|Array} notes | ||
@@ -73,3 +90,2 @@ * @return {Array} sorted array of notes | ||
* | ||
* @private | ||
* @function | ||
@@ -76,0 +92,0 @@ * @param {Array} notes |
24
index.js
@@ -0,1 +1,17 @@ | ||
/** | ||
* [![npm version](https://img.shields.io/npm/v/tonal-array.svg?style=flat-square)](https://www.npmjs.com/package/tonal-array) | ||
* | ||
* A scale is a collection of pitches in ascending or descending order. | ||
* | ||
* This module provides functions to get and manipulate scales. | ||
* | ||
* @example | ||
* import * as array; | ||
* array.sort(["f", "a", "c"]) // => ['C', 'F', 'A'] | ||
* | ||
* @example | ||
* const array = require('tonal-array) | ||
* array.range(1, 4) // => [1, 2, 3, 4] | ||
* @module array | ||
*/ | ||
import { midi, name } from "tonal-note"; | ||
@@ -29,2 +45,3 @@ | ||
/** | ||
* | ||
* Rotates a list a number of times. It's completly agnostic about the | ||
@@ -36,10 +53,11 @@ * contents of the list. | ||
*/ | ||
export const rotate = (times, arr) => { | ||
export function rotate(times, arr) { | ||
var len = arr.length; | ||
var n = (times % len + len) % len; | ||
return arr.slice(n, len).concat(arr.slice(0, n)); | ||
}; | ||
} | ||
/** | ||
* Return a copy of the array with the null values removed | ||
* @function | ||
* @param {Array} array | ||
@@ -61,3 +79,2 @@ * @return {Array} | ||
* | ||
* @private | ||
* @param {String|Array} notes | ||
@@ -73,3 +90,2 @@ * @return {Array} sorted array of notes | ||
* | ||
* @private | ||
* @function | ||
@@ -76,0 +92,0 @@ * @param {Array} notes |
{ | ||
"name": "tonal-array", | ||
"version": "1.0.0-pre5", | ||
"version": "1.0.0-pre6", | ||
"description": "Create and manipulate arrays of notes and intervals", | ||
@@ -20,3 +20,3 @@ "repository": "https://github.com/danigb/tonal/packages/array", | ||
"dependencies": { | ||
"tonal-note": "^1.0.0-pre5" | ||
"tonal-note": "^1.0.0-pre6" | ||
}, | ||
@@ -23,0 +23,0 @@ "babel": { |
74891
1387
Updatedtonal-note@^1.0.0-pre6