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

@spare/vettro

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spare/vettro - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

85

dist/index.cjs.js

@@ -6,12 +6,7 @@ 'use strict';

var util = require('@spare/util');
var vector = require('@vect/vector');
var hatsuMatrix = require('hatsu-matrix');
var vectorMargin = require('@vect/vector-margin');
// Matrigin
// Vettro
// Mattro
class Vectogin {
constructor(ar, head, tail, dash) {
this.ar = ar;
constructor(vec, head, tail, dash) {
this.vec = vec;
this.head = head;

@@ -22,31 +17,19 @@ this.tail = tail;

reboot(ar) {
return this.ar = ar, this;
}
clone(ar) {
return new Vectogin(ar, this.head, this.tail, this.dash);
}
static build(ar, h = 0, t = 0) {
var _ar;
let d = true,
l;
if (!(l = (_ar = ar) === null || _ar === void 0 ? void 0 : _ar.length)) [ar, h, t, d] = [[], 0, 0, false];
if (!ar || !(l = ar.length)) [ar, h, t, d] = [[], 0, 0, false];
if (!h && !t || h >= l) [h, t, d] = [l, 0, false];
return new Vectogin(vector.copyMargin(ar, h, t, l), h, t, d);
return new Vectogin(vectorMargin.marginCopy(ar, h, t, l), h, t, d);
}
map(fn, mutate = false) {
return mutate ? this.reboot(this.ar.map(fn)) : this.clone(this.ar.map(fn));
const {
vec,
head,
tail
} = this;
return mutate ? this.reboot(vectorMargin.marginMutate(vec, fn, head, tail)) : this.clone(vectorMargin.marginMapper(vec, fn, head, tail));
}
/**
*
* @param {function} [fn]
* @param {boolean} [mutate]
* @return { Vectogin }
*/
stringify(fn, mutate = true) {

@@ -56,14 +39,23 @@ return this.map(fn ? _ => String(fn(_)) : util.totx, mutate);

toList(el) {
toVector(el) {
const {
ar,
vec,
head,
tail
} = this,
diff = ar.length - (head + tail),
list = ar.slice();
this.dash && el ? list.splice(head, diff, el) : list.splice(head, diff);
return list;
dif = vec.length - (head + tail),
ar = vec.slice();
this.dash && el ? ar.splice(head, dif, el) : ar.splice(head, dif);
return ar;
}
reboot(ar) {
if (ar) this.vec = ar;
return this;
}
clone(ar) {
return new Vectogin(ar, this.head, this.tail, this.dash);
}
}

@@ -74,7 +66,8 @@

* @param {*[]} arr
* @param {function(*):string} [abstract]
* @param {number} [head]
* @param {number} [tail]
* @param {{[max]:string,[min]:string,[na]:string}} [visual]
* @return {{text:*[], raw:*[], dye:*[]}}
* @param {function(*):string} [abstract]
* @param {*} hr
* @param {boolean} [pad]
* @return {{raw:*[],text:*[]}}
*/

@@ -86,18 +79,8 @@

abstract,
visual
hr = '...'
} = {}) => {
var _visual, _visual2;
visual = (_visual = visual, util.isVisual(_visual));
let vn = Vectogin.build(arr, head, tail),
raw = vn.toList('...'),
dye = (_visual2 = visual, util.isVisual(_visual2)) ? hatsuMatrix.Visual.vector(raw, { ...visual,
retFn: true,
mutate: false
}) : null,
text = vn.stringify(abstract).toList('...');
let vn = Vectogin.build(arr, head, tail);
return {
text,
raw,
dye
raw: vn.toVector(hr),
text: vn.stringify(abstract).toVector(hr)
};

@@ -104,0 +87,0 @@ };

87

dist/index.esm.js

@@ -1,12 +0,7 @@

import { totx, isVisual } from '@spare/util';
import { copyMargin } from '@vect/vector';
import { Visual } from 'hatsu-matrix';
import { totx } from '@spare/util';
import { marginCopy, marginMutate, marginMapper } from '@vect/vector-margin';
// Matrigin
// Vettro
// Mattro
class Vectogin {
constructor(ar, head, tail, dash) {
this.ar = ar;
constructor(vec, head, tail, dash) {
this.vec = vec;
this.head = head;

@@ -17,31 +12,19 @@ this.tail = tail;

reboot(ar) {
return this.ar = ar, this;
}
clone(ar) {
return new Vectogin(ar, this.head, this.tail, this.dash);
}
static build(ar, h = 0, t = 0) {
var _ar;
let d = true,
l;
if (!(l = (_ar = ar) === null || _ar === void 0 ? void 0 : _ar.length)) [ar, h, t, d] = [[], 0, 0, false];
if (!ar || !(l = ar.length)) [ar, h, t, d] = [[], 0, 0, false];
if (!h && !t || h >= l) [h, t, d] = [l, 0, false];
return new Vectogin(copyMargin(ar, h, t, l), h, t, d);
return new Vectogin(marginCopy(ar, h, t, l), h, t, d);
}
map(fn, mutate = false) {
return mutate ? this.reboot(this.ar.map(fn)) : this.clone(this.ar.map(fn));
const {
vec,
head,
tail
} = this;
return mutate ? this.reboot(marginMutate(vec, fn, head, tail)) : this.clone(marginMapper(vec, fn, head, tail));
}
/**
*
* @param {function} [fn]
* @param {boolean} [mutate]
* @return { Vectogin }
*/
stringify(fn, mutate = true) {

@@ -51,14 +34,23 @@ return this.map(fn ? _ => String(fn(_)) : totx, mutate);

toList(el) {
toVector(el) {
const {
ar,
vec,
head,
tail
} = this,
diff = ar.length - (head + tail),
list = ar.slice();
this.dash && el ? list.splice(head, diff, el) : list.splice(head, diff);
return list;
dif = vec.length - (head + tail),
ar = vec.slice();
this.dash && el ? ar.splice(head, dif, el) : ar.splice(head, dif);
return ar;
}
reboot(ar) {
if (ar) this.vec = ar;
return this;
}
clone(ar) {
return new Vectogin(ar, this.head, this.tail, this.dash);
}
}

@@ -69,7 +61,8 @@

* @param {*[]} arr
* @param {function(*):string} [abstract]
* @param {number} [head]
* @param {number} [tail]
* @param {{[max]:string,[min]:string,[na]:string}} [visual]
* @return {{text:*[], raw:*[], dye:*[]}}
* @param {function(*):string} [abstract]
* @param {*} hr
* @param {boolean} [pad]
* @return {{raw:*[],text:*[]}}
*/

@@ -81,18 +74,8 @@

abstract,
visual
hr = '...'
} = {}) => {
var _visual, _visual2;
visual = (_visual = visual, isVisual(_visual));
let vn = Vectogin.build(arr, head, tail),
raw = vn.toList('...'),
dye = (_visual2 = visual, isVisual(_visual2)) ? Visual.vector(raw, { ...visual,
retFn: true,
mutate: false
}) : null,
text = vn.stringify(abstract).toList('...');
let vn = Vectogin.build(arr, head, tail);
return {
text,
raw,
dye
raw: vn.toVector(hr),
text: vn.stringify(abstract).toVector(hr)
};

@@ -99,0 +82,0 @@ };

{
"name": "@spare/vettro",
"version": "0.0.5",
"version": "0.0.6",
"description": "A debugging tool",

@@ -15,10 +15,7 @@ "main": "dist/index.cjs.js",

"pub": "npm publish",
"test": "node -r @babel/register test/test.index.js"
"test": "node -r @babel/register test/vectogin.test.js"
},
"dependencies": {
"@spare/string": "^0.0.5",
"@spare/util": "^0.0.5",
"@vect/vector": "^0.0.4",
"hatsu-matrix": "^0.0.21",
"veho": "^0.2.23"
"@spare/util": "^0.0.6",
"@vect/vector-margin": "^0.0.17"
},

@@ -41,3 +38,3 @@ "repository": {

"homepage": "https://github.com/hoyeungw/spare#readme",
"gitHead": "7895b3e77293b1eecd777df0d79d9fc4506b722d"
"gitHead": "026b65cd7566cd2bda3e7eaa0bcb03c97671bebf"
}
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