@hpcc-js/util
Advanced tools
Comparing version 0.0.1 to 0.0.5
@@ -1,8 +0,8 @@ | ||
export * from "./array"; | ||
export * from "./esp"; | ||
export * from "./hashSum"; | ||
export * from "./dictionary"; | ||
export * from "./logging"; | ||
export * from "./object"; | ||
export * from "./observer"; | ||
export * from "./platform"; | ||
export * from "./saxParser"; | ||
export * from "./stack"; | ||
export * from "./string"; | ||
export * from "./url"; |
@@ -1,13 +0,23 @@ | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./array")); | ||
__export(require("./esp")); | ||
__export(require("./hashSum")); | ||
__export(require("./object")); | ||
__export(require("./observer")); | ||
__export(require("./platform")); | ||
__export(require("./string")); | ||
__export(require("./url")); | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "./dictionary", "./logging", "./object", "./platform", "./saxParser", "./stack", "./string", "./url"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./dictionary")); | ||
__export(require("./logging")); | ||
__export(require("./object")); | ||
__export(require("./platform")); | ||
__export(require("./saxParser")); | ||
__export(require("./stack")); | ||
__export(require("./string")); | ||
__export(require("./url")); | ||
}); |
@@ -10,4 +10,4 @@ /** | ||
/** | ||
* exists - return inner property of Object | ||
* Usage: inner("some.prop.to.locate", obj); | ||
* exists - return true if inner property of Object exists | ||
* Usage: exists("some.prop.to.locate", obj); | ||
* | ||
@@ -14,0 +14,0 @@ * @param prop - property to locate |
@@ -1,88 +0,99 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* inner - return inner property of Object | ||
* Usage: inner("some.prop.to.locate", obj); | ||
* | ||
* @param prop - property to locate | ||
* @param obj - object to locate property in | ||
*/ | ||
function inner(prop, obj) { | ||
if (prop === void 0 || obj === void 0) | ||
return void 0; | ||
for (var _i = 0, _a = prop.split("."); _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
if (!obj.hasOwnProperty(item)) { | ||
return undefined; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* inner - return inner property of Object | ||
* Usage: inner("some.prop.to.locate", obj); | ||
* | ||
* @param prop - property to locate | ||
* @param obj - object to locate property in | ||
*/ | ||
function inner(prop, obj) { | ||
if (prop === void 0 || obj === void 0) | ||
return void 0; | ||
for (var _i = 0, _a = prop.split("."); _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
if (!obj.hasOwnProperty(item)) { | ||
return undefined; | ||
} | ||
obj = obj[item]; | ||
} | ||
obj = obj[item]; | ||
return obj; | ||
} | ||
return obj; | ||
} | ||
exports.inner = inner; | ||
/** | ||
* exists - return inner property of Object | ||
* Usage: inner("some.prop.to.locate", obj); | ||
* | ||
* @param prop - property to locate | ||
* @param obj - object to locate property in | ||
*/ | ||
function exists(prop, obj) { | ||
return inner(prop, obj) !== undefined; | ||
} | ||
exports.exists = exists; | ||
function _mixin(dest, source) { | ||
var empty = {}; | ||
for (var key in source) { | ||
var s = source[key]; | ||
if (s instanceof Array) { | ||
exports.inner = inner; | ||
/** | ||
* exists - return true if inner property of Object exists | ||
* Usage: exists("some.prop.to.locate", obj); | ||
* | ||
* @param prop - property to locate | ||
* @param obj - object to locate property in | ||
*/ | ||
function exists(prop, obj) { | ||
return inner(prop, obj) !== undefined; | ||
} | ||
exports.exists = exists; | ||
function _mixin(dest, source) { | ||
var empty = {}; | ||
for (var key in source) { | ||
var s = source[key]; | ||
if (s instanceof Array) { | ||
// TODO: Do we need to support arrays? | ||
} | ||
else if (typeof s === "object") { | ||
s = deepMixin(dest[key], s); | ||
} | ||
if (!(key in dest) || (dest[key] !== s && (!(key in empty) || empty[key] !== s))) { | ||
dest[key] = s; | ||
} | ||
} | ||
else if (typeof s === "object") { | ||
s = deepMixin(dest[key], s); | ||
return dest; | ||
} | ||
/** | ||
* deepMixin - combine several objects from right to left | ||
* Usage: deepMixin({a: "a"}, {b: "b"}); | ||
* | ||
* @param dest - target object to mix into. | ||
* @param sources - objects to mix in | ||
*/ | ||
function deepMixin(dest) { | ||
if (dest === void 0) { dest = {}; } | ||
var sources = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
sources[_i - 1] = arguments[_i]; | ||
} | ||
if (!(key in dest) || (dest[key] !== s && (!(key in empty) || empty[key] !== s))) { | ||
dest[key] = s; | ||
if (typeof dest !== "object") | ||
throw new Error("Destination \"" + dest + "\" must be an object."); | ||
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) { | ||
var source = sources_1[_a]; | ||
_mixin(dest, source); | ||
} | ||
return dest; | ||
} | ||
return dest; | ||
} | ||
/** | ||
* deepMixin - combine several objects from right to left | ||
* Usage: deepMixin({a: "a"}, {b: "b"}); | ||
* | ||
* @param dest - target object to mix into. | ||
* @param sources - objects to mix in | ||
*/ | ||
function deepMixin(dest) { | ||
if (dest === void 0) { dest = {}; } | ||
var sources = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
sources[_i - 1] = arguments[_i]; | ||
exports.deepMixin = deepMixin; | ||
/** | ||
* deepMixinT - combine several objects of Partial<T> from right to left | ||
* Usage: deepMixinT<MyInterface>({a: "a"}, {b: "b"}); | ||
* | ||
* Note: Only provided as a convenience, so user gets auto completion based on destination type. | ||
* | ||
* @param dest - target object to mix into. | ||
* @param sources - objects to mix in | ||
*/ | ||
function deepMixinT(dest) { | ||
if (dest === void 0) { dest = {}; } | ||
var sources = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
sources[_i - 1] = arguments[_i]; | ||
} | ||
return deepMixin.apply(void 0, [dest].concat(sources)); | ||
} | ||
if (typeof dest !== "object") | ||
throw new Error("Destination \"" + dest + "\" must be an object."); | ||
for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) { | ||
var source = sources_1[_a]; | ||
_mixin(dest, source); | ||
} | ||
return dest; | ||
} | ||
exports.deepMixin = deepMixin; | ||
/** | ||
* deepMixinT - combine several objects of Partial<T> from right to left | ||
* Usage: deepMixinT<MyInterface>({a: "a"}, {b: "b"}); | ||
* | ||
* Note: Only provided as a convenience, so user gets auto completion based on destination type. | ||
* | ||
* @param dest - target object to mix into. | ||
* @param sources - objects to mix in | ||
*/ | ||
function deepMixinT(dest) { | ||
if (dest === void 0) { dest = {}; } | ||
var sources = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
sources[_i - 1] = arguments[_i]; | ||
} | ||
return deepMixin.apply(void 0, [dest].concat(sources)); | ||
} | ||
exports.deepMixinT = deepMixinT; | ||
exports.deepMixinT = deepMixinT; | ||
}); |
@@ -1,6 +0,16 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.root = new Function("try{return global;}catch(e){return window;}")(); | ||
exports.isBrowser = new Function("try{return this===window;}catch(e){return false;}"); | ||
exports.isNode = new Function("try{return this===global;}catch(e){return false;}"); | ||
exports.isTravis = new Function("try{return process.env.TRAVIS;}catch(e){return false;}"); | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.root = new Function("try{return global;}catch(e){return window;}")(); | ||
exports.isBrowser = new Function("try{return this===window;}catch(e){return false;}"); | ||
exports.isNode = new Function("try{return this===global;}catch(e){return false;}"); | ||
exports.isTravis = new Function("try{return process.env.TRAVIS;}catch(e){return false;}"); | ||
}); |
@@ -1,26 +0,36 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function trim(str, char) { | ||
if (typeof char !== "string") | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function trim(str, char) { | ||
if (typeof char !== "string") | ||
return str; | ||
if (char.length === 0) | ||
return str; | ||
while (str.indexOf(char) === 0) { | ||
str = str.substring(1); | ||
} | ||
while (endsWith(str, char)) { | ||
str = str.substring(0, str.length - 1); | ||
} | ||
return str; | ||
if (char.length === 0) | ||
return str; | ||
while (str.indexOf(char) === 0) { | ||
str = str.substring(1); | ||
} | ||
while (endsWith(str, char)) { | ||
str = str.substring(0, str.length - 1); | ||
exports.trim = trim; | ||
function endsWith(origString, searchString, position) { | ||
var subjectString = origString.toString(); | ||
if (typeof position !== "number" || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { | ||
position = subjectString.length; | ||
} | ||
position -= searchString.length; | ||
var lastIndex = subjectString.lastIndexOf(searchString, position); | ||
return lastIndex !== -1 && lastIndex === position; | ||
} | ||
return str; | ||
} | ||
exports.trim = trim; | ||
function endsWith(origString, searchString, position) { | ||
var subjectString = origString.toString(); | ||
if (typeof position !== "number" || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { | ||
position = subjectString.length; | ||
} | ||
position -= searchString.length; | ||
var lastIndex = subjectString.lastIndexOf(searchString, position); | ||
return lastIndex !== -1 && lastIndex === position; | ||
} | ||
exports.endsWith = endsWith; | ||
exports.endsWith = endsWith; | ||
}); |
@@ -1,14 +0,24 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var string_1 = require("./string"); | ||
function join() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
var partialUrl = args.length && args[0].length && args[0].charAt(0) === "/"; | ||
return (partialUrl ? "/" : "") + args.map(function (arg) { | ||
return string_1.trim(arg, "/"); | ||
}).join("/"); | ||
} | ||
exports.join = join; | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "./string"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var string_1 = require("./string"); | ||
function join() { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var partialUrl = args.length && args[0].length && args[0].charAt(0) === "/"; | ||
return (partialUrl ? "/" : "") + args.map(function (arg) { | ||
return string_1.trim(arg, "/"); | ||
}).join("/"); | ||
} | ||
exports.join = join; | ||
}); |
{ | ||
"name": "@hpcc-js/util", | ||
"version": "0.0.1", | ||
"version": "0.0.5", | ||
"description": "hpcc-js - Utilities", | ||
@@ -16,10 +16,12 @@ "main": "lib/index.js", | ||
"build": "tsc", | ||
"clean": "rimraf lib", | ||
"clean": "rimraf lib*", | ||
"docs": "typedoc --options tdoptions.json ." | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"tslib": "^1.7.1" | ||
}, | ||
"devDependencies": { | ||
"rimraf": "^2.6.1", | ||
"typedoc": "^0.7.1", | ||
"typescript": "^2.3.3" | ||
"typescript": "^2.3.4" | ||
}, | ||
@@ -37,2 +39,2 @@ "repository": { | ||
"homepage": "https://github.com/hpcc-systems/Visualization" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28921
800
1
1
+ Addedtslib@^1.7.1
+ Addedtslib@1.14.1(transitive)