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

d2-utilizr

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d2-utilizr - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.npmignore

104

index.js
// boolean
export function isString(param) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.isString = isString;
exports.isNumber = isNumber;
exports.isNumeric = isNumeric;
exports.isBoolean = isBoolean;
exports.isDefined = isDefined;
exports.isPrimitive = isPrimitive;
exports.isIE = isIE;
exports.isEmpty = isEmpty;
exports.numberConstrain = numberConstrain;
exports.arrayPluck = arrayPluck;
exports.arrayUnique = arrayUnique;
exports.arrayContains = arrayContains;
exports.arrayFrom = arrayFrom;
exports.arrayClean = arrayClean;
function isString(param) {
return typeof param === 'string';
}
export function isNumber(param) {
function isNumber(param) {
return typeof param === 'number' && isFinite(param);
};
}
export function isNumeric(param) {
;
function isNumeric(param) {
return !isNaN(parseFloat(param)) && isFinite(param);
};
}
export var isArray = Array.isArray;
;
export var isObject = function() {
return (toString.call(null) === '[object Object]') ? function(param) {
var isArray = Array.isArray;
exports.isArray = isArray;
var isObject = (function () {
return toString.call(null) === '[object Object]' ? function (param) {
return param !== null && param !== undefined && toString.call(param) === '[object Object]' && param.ownerDocument === undefined;
} : function(param) {
} : function (param) {
return toString.call(param) === '[object Object]';
};
}();
})();
export var isFunction = function() {
return (typeof document !== 'undefined' && typeof document.getElementsByTagName('body') === 'function') ? function(value) {
exports.isObject = isObject;
var isFunction = (function () {
return typeof document !== 'undefined' && typeof document.getElementsByTagName('body') === 'function' ? function (value) {
return !!value && toString.call(value) === '[object Function]';
} : function(value) {
} : function (value) {
return !!value && typeof value === 'function';
};
}();
})();
export functionisBoolean(param) {
exports.isFunction = isFunction;
function isBoolean(param) {
return typeof param === 'boolean';
}
export functionisDefined(param) {
function isDefined(param) {
return typeof param !== 'undefined';
}
export functionisPrimitive(param) {
function isPrimitive(param) {
var type = typeof param;
return type === 'string' || type === 'number' || type === 'boolean';
};
}
export functionisIE() {
;
function isIE() {
var ua = window.navigator.userAgent;

@@ -68,3 +98,3 @@

var edge = ua.indexOf('Edge/');
if (edge > 0) {
if (edge > 0) {
// IE 12 => return version number

@@ -79,4 +109,5 @@ return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);

// dependency: isArray
export function isEmpty(array, allowEmptyString) {
return (array == null) || (!allowEmptyString ? array === '' : false) || (isArray(array) && array.length === 0);
function isEmpty(array, allowEmptyString) {
return array == null || (!allowEmptyString ? array === '' : false) || isArray(array) && array.length === 0;
}

@@ -86,3 +117,3 @@

export function numberConstrain(number, min, max) {
function numberConstrain(number, min, max) {
number = parseFloat(number);

@@ -99,15 +130,16 @@

export var numberToFixed = function() {
return ((0.9).toFixed() !== '1') ? function(value, precision) {
var numberToFixed = (function () {
return 0.9.toFixed() !== '1' ? function (value, precision) {
precision = precision || 0;
var pow = math.pow(10, precision);
return (math.round(value * pow) / pow).toFixed(precision);
} : function(value, precision) {
} : function (value, precision) {
return value.toFixed(precision);
};
}();
})();
exports.numberToFixed = numberToFixed;
// array
export function arrayPluck(array, propertyName) {
function arrayPluck(array, propertyName) {
var newArray = [];

@@ -127,3 +159,3 @@ var i;

export function arrayUnique(array) {
function arrayUnique(array) {
var newArray = [];

@@ -145,3 +177,3 @@ var i = 0;

export function arrayContains(array, item) {
function arrayContains(array, item) {
return Array.prototype.indexOf.call(array, item) !== -1;

@@ -151,4 +183,5 @@ }

// dependency: isArray
export function arrayFrom(param, isNewRef) {
var toArray = function(iterable, start, end) {
function arrayFrom(param, isNewRef) {
var toArray = function toArray(iterable, start, end) {
if (!iterable || !iterable.length) {

@@ -170,3 +203,3 @@ return [];

start = start || 0;
end = end ? ((end < 0) ? iterable.length + end : end) : iterable.length;
end = end ? end < 0 ? iterable.length + end : end : iterable.length;

@@ -185,3 +218,3 @@ for (i = start; i < end; i++) {

if (isArray(param)) {
return (isNewRef) ? slice.call(param) : param;
return isNewRef ? slice.call(param) : param;
}

@@ -198,3 +231,4 @@

// dependency: isEmpty
export function arrayClean(array) {
function arrayClean(array) {
var results = [],

@@ -201,0 +235,0 @@ i = 0,

{
"name": "d2-utilizr",
"version": "0.0.1",
"version": "0.0.2",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "./node_modules/babel/bin/babel.js src/index.js -o index.js"
},

@@ -18,3 +19,6 @@ "repository": {

},
"homepage": "https://github.com/dhis2/d2-utilizr#readme"
"homepage": "https://github.com/dhis2/d2-utilizr#readme",
"devDependencies": {
"babel": "5.8.34"
}
}
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