@hpcc-js/common
Advanced tools
Comparing version 0.0.38 to 0.0.39
export declare function SelectionBag(): void; | ||
export declare function SimpleSelection(widgetElement: any, skipBringToTop?: any): void; | ||
export declare function SimpleSelectionMixin(skipBringToTop: any): void; | ||
export declare function isArray(obj: any): boolean; | ||
export declare function template(string: any, _args: any): any; | ||
export declare function naturalSort(data: any, order: any, idx: any, sortCaseSensitive: any): any; | ||
@@ -5,0 +7,0 @@ export declare function multiSort(data: any, sortBy: any): any; |
@@ -202,2 +202,48 @@ import { ascending as d3Ascending, descending as d3Descending } from "d3-array"; | ||
var now = perf && (perf.now || perf.mozNow || perf.msNow || perf.oNow || perf.webkitNow); | ||
export function isArray(obj) { | ||
return Object.prototype.toString.call(obj) === "[object Array]"; | ||
} | ||
// Template --- | ||
// https://github.com/Matt-Esch/string-template (MIT) | ||
var nargs = /\{([0-9a-zA-Z_\[\]]+)\}/g; | ||
export function template(string, _args) { | ||
var args; | ||
if (arguments.length === 2 && typeof arguments[1] === "object") { | ||
args = arguments[1]; | ||
} | ||
else { | ||
args = new Array(arguments.length - 1); | ||
for (var i = 1; i < arguments.length; ++i) { | ||
args[i - 1] = arguments[i]; | ||
} | ||
} | ||
if (!args || !args.hasOwnProperty) { | ||
args = {}; | ||
} | ||
var _loop_1 = function (key) { | ||
if (isArray(args[key])) { | ||
args[key].forEach(function (row, idx) { | ||
args[key + "[" + idx + "]"] = row; | ||
}); | ||
} | ||
}; | ||
// Array handling | ||
for (var key in args) { | ||
_loop_1(key); | ||
} | ||
return string.replace(nargs, function replaceArg(match, i, index) { | ||
var result; | ||
if (string[index - 1] === "{" && | ||
string[index + match.length] === "}") { | ||
return i; | ||
} | ||
else { | ||
result = args.hasOwnProperty(i) ? args[i] : null; | ||
if (result === null || result === undefined) { | ||
return ""; | ||
} | ||
return result; | ||
} | ||
}); | ||
} | ||
export function naturalSort(data, order, idx, sortCaseSensitive) { | ||
@@ -204,0 +250,0 @@ return data.slice(0).sort(function (a, b) { |
export declare function SelectionBag(): void; | ||
export declare function SimpleSelection(widgetElement: any, skipBringToTop?: any): void; | ||
export declare function SimpleSelectionMixin(skipBringToTop: any): void; | ||
export declare function isArray(obj: any): boolean; | ||
export declare function template(string: any, _args: any): any; | ||
export declare function naturalSort(data: any, order: any, idx: any, sortCaseSensitive: any): any; | ||
@@ -5,0 +7,0 @@ export declare function multiSort(data: any, sortBy: any): any; |
@@ -216,2 +216,50 @@ (function (factory) { | ||
var now = perf && (perf.now || perf.mozNow || perf.msNow || perf.oNow || perf.webkitNow); | ||
function isArray(obj) { | ||
return Object.prototype.toString.call(obj) === "[object Array]"; | ||
} | ||
exports.isArray = isArray; | ||
// Template --- | ||
// https://github.com/Matt-Esch/string-template (MIT) | ||
var nargs = /\{([0-9a-zA-Z_\[\]]+)\}/g; | ||
function template(string, _args) { | ||
var args; | ||
if (arguments.length === 2 && typeof arguments[1] === "object") { | ||
args = arguments[1]; | ||
} | ||
else { | ||
args = new Array(arguments.length - 1); | ||
for (var i = 1; i < arguments.length; ++i) { | ||
args[i - 1] = arguments[i]; | ||
} | ||
} | ||
if (!args || !args.hasOwnProperty) { | ||
args = {}; | ||
} | ||
var _loop_1 = function (key) { | ||
if (isArray(args[key])) { | ||
args[key].forEach(function (row, idx) { | ||
args[key + "[" + idx + "]"] = row; | ||
}); | ||
} | ||
}; | ||
// Array handling | ||
for (var key in args) { | ||
_loop_1(key); | ||
} | ||
return string.replace(nargs, function replaceArg(match, i, index) { | ||
var result; | ||
if (string[index - 1] === "{" && | ||
string[index + match.length] === "}") { | ||
return i; | ||
} | ||
else { | ||
result = args.hasOwnProperty(i) ? args[i] : null; | ||
if (result === null || result === undefined) { | ||
return ""; | ||
} | ||
return result; | ||
} | ||
}); | ||
} | ||
exports.template = template; | ||
function naturalSort(data, order, idx, sortCaseSensitive) { | ||
@@ -218,0 +266,0 @@ return data.slice(0).sort(function (a, b) { |
{ | ||
"name": "@hpcc-js/common", | ||
"version": "0.0.38", | ||
"version": "0.0.39", | ||
"description": "hpcc-js - Viz Common", | ||
@@ -11,2 +11,3 @@ "main": "lib/index.js", | ||
"lib-es6/*", | ||
"src/*.css", | ||
"dist/*", | ||
@@ -41,3 +42,3 @@ "font-awesome/**/*" | ||
"devDependencies": { | ||
"@hpcc-js/bundle": "^0.0.10", | ||
"@hpcc-js/bundle": "^0.0.11", | ||
"cpx": "^1.5.0", | ||
@@ -44,0 +45,0 @@ "rimraf": "^2.6.1", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
4456834
181
27322