How to use the sliced function in sliced

To help you get started, we’ve selected a few sliced examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github audio-lab / piano-keyboard / index.js View on Github external
function updateNotes (touches, e, ignoreNotes) {
			var rects = self.rectangles;
			var notes = self.notes;
			var noteEls = self.noteElements;

			touches = slice(touches);

			//save last touches as active
			activeTouches = touches;

			//FIXME: Safari doesn't know what's that
			// var notesOff = new Set(self.activeNotes);
			var notesOff = new Set();
			self.activeNotes.forEach(function (note) {
				notesOff.add(note);
			});

			var notesOn = new Set();
			var blackTouches = new Set();

			//for all notes - find ones to turn on and ones to turn off
			for (var i = 0; i < notes.length; i++) {
github bjrmatos / electron-html-to / src / ensureStartWorker.js View on Github external
workerIpc.on('log', function() {
    // eslint-disable-next-line prefer-rest-params
    debugElectronLog.apply(debugElectronLog, sliced(arguments));
  });
}
github bjrmatos / electron-html-to / src / ensureStartWorker.js View on Github external
workerIpc.on('page-log', function() {
    // eslint-disable-next-line prefer-rest-params
    let newArgs = sliced(arguments),
        windowId = newArgs.splice(0, 1);

    newArgs.unshift(`console log from browser window [${windowId}]:`);
    debugPage.apply(debugPage, newArgs);
  });
github audio-lab / piano-keyboard / index.js View on Github external
noteOff (note) {
		var self = this, keyEl;

		if (self.isBlocked) return self;

		//disable all active notes
		if (note === undefined) {
			self.activeNotes.forEach(self.noteOff, self);
			return self;
		}
		if (isArray(note)) {
			slice(note).forEach(function (note, i) {
				self.noteOff(note);
			});
			return self;
		}

		note = self.parseNote(note);

		if (note === undefined) {
			return self;
		}

		var keyEl = self.element.querySelector('[data-key="' + note + '"]');

		if (!keyEl) {
			// throw Error(key.getName(note) + ' does not exist');
			return self;
github audio-lab / piano-keyboard / index.js View on Github external
noteOn (note, value) {
		var self = this;

		if (self.isBlocked) return self;

		if (value === undefined) {
			value = 127;
		}

		if (isArray(note)) {
			slice(note).forEach(function (note, i) {
				self.noteOn(note, value[i] !== undefined ? value[i] : value );
			});
			return self;
		}

		note = self.parseNote(note);

		if (note === undefined) {
			return self;
		}

		var keyEl = self.element.querySelector('[data-key="' + note + '"]');

		if (!keyEl) {
			// throw Error(key.getName(note) + ' does not exist');
			return;
github bjrmatos / electron-html-to / src / dedicatedProcessStrategy.js View on Github external
childIpc.on('log', function() {
      // eslint-disable-next-line prefer-rest-params
      debugElectronLog.apply(debugElectronLog, sliced(arguments));
    });

sliced

A faster Node.js alternative to Array.prototype.slice.call(arguments)

MIT
Latest version published 9 years ago

Package Health Score

65 / 100
Full package analysis

Popular sliced functions