UNPKG

gpii-universal

Version:

Cross platform, core components of the GPII personalization infrastructure.

28 lines (22 loc) 1.09 kB
"use strict"; // Convenience functions used in this repo's tests. var fluid = require("infusion"); var gpii = fluid.registerNamespace("gpii"); fluid.registerNamespace("gpii.tests.universal.solutionsRegistry"); // Filter out "intra-application" transforms so that we can cleanly test just the common terms // (the intra-application transforms are tested in SolutionsRegistryFileTests.js) gpii.tests.universal.solutionsRegistry.hasIntraApplicationTransform = function (toInspect) { var hasIntraApplicationTransform = false; if (fluid.isPlainObject(toInspect)) { var elementWithIntraApplicationTransform = fluid.find(toInspect, function (value) { return gpii.tests.universal.solutionsRegistry.hasIntraApplicationTransform(value) ? toInspect : undefined; }); if (elementWithIntraApplicationTransform) { hasIntraApplicationTransform = true; } } else if (typeof toInspect === "string" && toInspect.match("/applications/")) { hasIntraApplicationTransform = true; } return hasIntraApplicationTransform; };