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

donot

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

donot - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

2

dist/donot.js

@@ -1,2 +0,2 @@

!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.donot=t():n.donot=t()}(this,(function(){return function(n){var t={};function r(e){if(t[e])return t[e].exports;var o=t[e]={i:e,l:!1,exports:{}};return n[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=n,r.c=t,r.d=function(n,t,e){r.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:e})},r.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,t){if(1&t&&(n=r(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var o in n)r.d(e,o,function(t){return n[t]}.bind(null,o));return e},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.p="",r(r.s=0)}([function(n,t,r){"use strict";function e(n){return document.querySelector(n)}function o(n){return Array.from(document.querySelectorAll(n))}function u(n,t,r,e,o,u,i){try{var f=n[u](i),a=f.value}catch(n){return void r(n)}f.done?t(a):Promise.resolve(a).then(e,o)}function i(n){return function(){var t=this,r=arguments;return new Promise((function(e,o){var i=n.apply(t,r);function f(n){u(i,e,o,f,a,"next",n)}function a(n){u(i,e,o,f,a,"throw",n)}f(void 0)}))}}function f(n){return a.apply(this,arguments)}function a(){return(a=i(regeneratorRuntime.mark((function n(t){var r,e;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.fetch(t);case 2:return r=n.sent,n.next=5,r.json();case 5:return e=n.sent,n.abrupt("return",e);case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function c(n,t){var r;if("undefined"==typeof Symbol||null==n[Symbol.iterator]){if(Array.isArray(n)||(r=function(n,t){if(!n)return;if("string"==typeof n)return l(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);"Object"===r&&n.constructor&&(r=n.constructor.name);if("Map"===r||"Set"===r)return Array.from(n);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(n,t)}(n))||t&&n&&"number"==typeof n.length){r&&(n=r);var e=0,o=function(){};return{s:o,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,i=!0,f=!1;return{s:function(){r=n[Symbol.iterator]()},n:function(){var n=r.next();return i=n.done,n},e:function(n){f=!0,u=n},f:function(){try{i||null==r.return||r.return()}finally{if(f)throw u}}}}function l(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=new Array(t);r<t;r++)e[r]=n[r];return e}function d(n){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{allowEquals:!0},e=[],o=new Set,u=c(y(n,n));try{for(u.s();!(t=u.n()).done;){var i=t.value;if(!("allowEquals"in r)||r.allowEquals||i[0]!==i[1]){i[0]>i[1]&&(i=[i[1],i[0]]);var f=String(i[0])+String(i[1]);o.has(f)||(e.push(i),o.add(f))}}}catch(n){u.e(n)}finally{u.f()}return e}function s(n){return n*(Math.PI/180)}function y(n,t){var r,e=[],o=c(n);try{for(o.s();!(r=o.n()).done;){var u,i=r.value,f=c(t);try{for(f.s();!(u=f.n()).done;){var a=u.value;e.push([i,a])}}catch(n){f.e(n)}finally{f.f()}}}catch(n){o.e(n)}finally{o.f()}return e}function p(){return function(){}}function v(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t||(t=n,n=0),Array.from(new Array(t-n),(function(t,r){return r+n}))}function m(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t||(t=n,n=0),Math.round(Math.random()*(t-n))+n}function h(n){return b(n)[0]}function b(n){for(var t=n.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),e=[n[r],n[t]];n[t]=e[0],n[r]=e[1]}return n}function g(n){return n.reduce((function(n,t){return n+t}))}function w(n){return new Promise((function(t){"undefined"==typeof window?setTimeout(t,n):window.setTimeout(t,n)}))}r.r(t),r.d(t,"$",(function(){return e})),r.d(t,"$$",(function(){return o})),r.d(t,"combinations",(function(){return d})),r.d(t,"degToRad",(function(){return s})),r.d(t,"getJson",(function(){return f})),r.d(t,"matrix",(function(){return y})),r.d(t,"noop",(function(){return p})),r.d(t,"range",(function(){return v})),r.d(t,"randInt",(function(){return m})),r.d(t,"sample",(function(){return h})),r.d(t,"shuffle",(function(){return b})),r.d(t,"sum",(function(){return g})),r.d(t,"timeout",(function(){return w}))}])}));
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.donot=t():n.donot=t()}(this,(function(){return function(n){var t={};function r(e){if(t[e])return t[e].exports;var o=t[e]={i:e,l:!1,exports:{}};return n[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=n,r.c=t,r.d=function(n,t,e){r.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:e})},r.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,t){if(1&t&&(n=r(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var o in n)r.d(e,o,function(t){return n[t]}.bind(null,o));return e},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.p="",r(r.s=0)}([function(n,t,r){"use strict";function e(n){return document.querySelector(n)}function o(n){return Array.from(document.querySelectorAll(n))}function u(n,t,r,e,o,u,i){try{var f=n[u](i),a=f.value}catch(n){return void r(n)}f.done?t(a):Promise.resolve(a).then(e,o)}function i(n){return function(){var t=this,r=arguments;return new Promise((function(e,o){var i=n.apply(t,r);function f(n){u(i,e,o,f,a,"next",n)}function a(n){u(i,e,o,f,a,"throw",n)}f(void 0)}))}}function f(n){return a.apply(this,arguments)}function a(){return(a=i(regeneratorRuntime.mark((function n(t){var r,e;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.fetch(t);case 2:return r=n.sent,n.next=5,r.json();case 5:return e=n.sent,n.abrupt("return",e);case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function c(n,t){var r;if("undefined"==typeof Symbol||null==n[Symbol.iterator]){if(Array.isArray(n)||(r=function(n,t){if(!n)return;if("string"==typeof n)return l(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);"Object"===r&&n.constructor&&(r=n.constructor.name);if("Map"===r||"Set"===r)return Array.from(n);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(n,t)}(n))||t&&n&&"number"==typeof n.length){r&&(n=r);var e=0,o=function(){};return{s:o,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,i=!0,f=!1;return{s:function(){r=n[Symbol.iterator]()},n:function(){var n=r.next();return i=n.done,n},e:function(n){f=!0,u=n},f:function(){try{i||null==r.return||r.return()}finally{if(f)throw u}}}}function l(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=new Array(t);r<t;r++)e[r]=n[r];return e}function d(n){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],e=0;e<n.length;e+=t)r.push(n.slice(e,e+t));return r}function s(n){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{allowEquals:!0},e=[],o=new Set,u=c(y(n,n));try{for(u.s();!(t=u.n()).done;){var i=t.value;if(!("allowEquals"in r)||r.allowEquals||i[0]!==i[1]){i[0]>i[1]&&(i=[i[1],i[0]]);var f=String(i[0])+String(i[1]);o.has(f)||(e.push(i),o.add(f))}}}catch(n){u.e(n)}finally{u.f()}return e}function p(n){return n*(Math.PI/180)}function y(n,t){var r,e=[],o=c(n);try{for(o.s();!(r=o.n()).done;){var u,i=r.value,f=c(t);try{for(f.s();!(u=f.n()).done;){var a=u.value;e.push([i,a])}}catch(n){f.e(n)}finally{f.f()}}}catch(n){o.e(n)}finally{o.f()}return e}function v(){return function(){}}function m(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t||(t=n,n=0),Array.from(new Array(t-n),(function(t,r){return r+n}))}function h(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t||(t=n,n=0),Math.round(Math.random()*(t-n))+n}function b(n){return g(n)[0]}function g(n){for(var t=n.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),e=[n[r],n[t]];n[t]=e[0],n[r]=e[1]}return n}function w(n){return n.reduce((function(n,t){return n+t}))}function S(n){return new Promise((function(t){"undefined"==typeof window?setTimeout(t,n):window.setTimeout(t,n)}))}r.r(t),r.d(t,"$",(function(){return e})),r.d(t,"$$",(function(){return o})),r.d(t,"chunk",(function(){return d})),r.d(t,"combinations",(function(){return s})),r.d(t,"degToRad",(function(){return p})),r.d(t,"getJson",(function(){return f})),r.d(t,"matrix",(function(){return y})),r.d(t,"noop",(function(){return v})),r.d(t,"range",(function(){return m})),r.d(t,"randInt",(function(){return h})),r.d(t,"sample",(function(){return b})),r.d(t,"shuffle",(function(){return g})),r.d(t,"sum",(function(){return w})),r.d(t,"timeout",(function(){return S}))}])}));
//# sourceMappingURL=donot.js.map
import { $, $$ } from './src/dom.js';
import { getJson } from './src/http.js';
import {
degToRad, find, matrix, noop, combinations, range, randInt, sample,
chunk, degToRad, matrix, noop, combinations, range, randInt, sample,
shuffle, sum

@@ -12,2 +12,3 @@ } from './src/math.js';

$$,
chunk,
combinations,

@@ -14,0 +15,0 @@ degToRad,

{
"name": "donot",
"version": "0.2.0",
"version": "0.3.0",
"description": "Do not use this utility library",

@@ -5,0 +5,0 @@ "main": "dist/donot.js",

@@ -38,2 +38,11 @@ # donot

**`chunk(array: array, size: number): array`**
Chunks a given `array` in multiple arrays of maximum size `size`.
```javascript
const nrs = _.range(1, 10);
const chunks = _.chunk(nrs, 4);
console.log(chunks); // [ [ 1, 2, 3, 4 ], [ 5, 6, 7, 8 ], [ 9 ] ]
````
**`combinations(list: array, opts?:object): array`**

@@ -40,0 +49,0 @@ Create a list of all unique combinations, where a,b === b,a. By default, equals like 'a,a' are allowed, if you don't want that, pass `{ allowEquals : false }` as a second argument.

@@ -0,1 +1,11 @@

export function chunk(array, size = 1) {
const results = [];
for (let i = 0; i < array.length; i += size) {
results.push(array.slice(i, i + size));
}
return results;
}
// Create a list of all unique combinations, where a,b === b,a

@@ -2,0 +12,0 @@ export function combinations(list, opts = { allowEquals : true}) {

(async function() {
const _ = require('donot');
const _ = require('../dist/donot.js');
console.log(_.randInt(5, 10));

@@ -19,2 +19,6 @@

const nrs = _.range(1, 10);
const chunks = _.chunk(nrs, 4);
console.log(chunks);
console.log("Let's wait 2 seconds");

@@ -21,0 +25,0 @@ await _.timeout(2000);

Sorry, the diff of this file is not supported yet

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