@useparagon/whiskers-core
Advanced tools
Comparing version 0.0.1-canary.6 to 0.0.1-canary.7
@@ -53,4 +53,33 @@ "use strict"; | ||
}); | ||
it('should NOT mutate inputs', () => { | ||
const target = { | ||
a: 'a', | ||
b: 1, | ||
c: { | ||
d: 'd', | ||
e: 'e', | ||
}, | ||
}; | ||
const source = { | ||
c: { | ||
f: 'f', | ||
}, | ||
}; | ||
(0, objects_1.deepMerge)(target, source); | ||
expect(target).toEqual({ | ||
a: 'a', | ||
b: 1, | ||
c: { | ||
d: 'd', | ||
e: 'e', | ||
}, | ||
}); | ||
expect(source).toEqual({ | ||
c: { | ||
f: 'f', | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); | ||
//# sourceMappingURL=objects.spec.js.map |
@@ -69,1 +69,10 @@ import { GithubActionWorkflowStep } from '../step'; | ||
export declare function filterStepsMatchingClass(steps: GithubActionWorkflowStep<any>[], classesToFilter: (typeof GithubActionWorkflowStep)[]): GithubActionWorkflowStep<any>[]; | ||
/** | ||
* Prefix variable if variable is present | ||
* | ||
* @param variable the variable to prefix | ||
* @param prefix the prefix to prepend | ||
* @param defaultValue the default value if variable is missing (unprefixed) | ||
* @returns | ||
*/ | ||
export declare function prefixIfPresent(variable: string, prefix: string, defaultValue?: string): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.filterStepsMatchingClass = exports.setEnvironmentVariable = exports.setOutput = exports.getAssertStepOutcomeTemplate = exports.wrap = exports.toEnvVarContext = exports.fromEnvVarContext = exports.GithubActionOutcome = void 0; | ||
exports.prefixIfPresent = exports.filterStepsMatchingClass = exports.setEnvironmentVariable = exports.setOutput = exports.getAssertStepOutcomeTemplate = exports.wrap = exports.toEnvVarContext = exports.fromEnvVarContext = exports.GithubActionOutcome = void 0; | ||
/** | ||
@@ -98,2 +98,14 @@ * the possible results of a github action step execution | ||
exports.filterStepsMatchingClass = filterStepsMatchingClass; | ||
/** | ||
* Prefix variable if variable is present | ||
* | ||
* @param variable the variable to prefix | ||
* @param prefix the prefix to prepend | ||
* @param defaultValue the default value if variable is missing (unprefixed) | ||
* @returns | ||
*/ | ||
function prefixIfPresent(variable, prefix, defaultValue = '') { | ||
return `${variable} && format('${prefix}{0}', ${variable}) || '${defaultValue}'`; | ||
} | ||
exports.prefixIfPresent = prefixIfPresent; | ||
//# sourceMappingURL=github-actions.js.map |
export * from './async'; | ||
export * from './enums'; | ||
export * from './github-actions'; | ||
export * from './marshallable.yaml'; | ||
export * from './marshallable'; | ||
export * from './marshallable.yaml'; | ||
export * from './objects'; |
@@ -5,6 +5,7 @@ "use strict"; | ||
tslib_1.__exportStar(require("./async"), exports); | ||
tslib_1.__exportStar(require("./enums"), exports); | ||
tslib_1.__exportStar(require("./github-actions"), exports); | ||
tslib_1.__exportStar(require("./marshallable.yaml"), exports); | ||
tslib_1.__exportStar(require("./marshallable"), exports); | ||
tslib_1.__exportStar(require("./marshallable.yaml"), exports); | ||
tslib_1.__exportStar(require("./objects"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -21,4 +21,7 @@ "use strict"; | ||
function deepMerge(a, b) { | ||
const outcome = { | ||
...a, | ||
}; | ||
Object.entries(b).forEach(([k, v]) => { | ||
a[k] = | ||
outcome[k] = | ||
v !== null && typeof v === 'object' | ||
@@ -28,5 +31,5 @@ ? deepMerge(a[k] || {}, v) | ||
}); | ||
return a; | ||
return outcome; | ||
} | ||
exports.deepMerge = deepMerge; | ||
//# sourceMappingURL=objects.js.map |
{ | ||
"name": "@useparagon/whiskers-core", | ||
"version": "0.0.1-canary.6", | ||
"version": "0.0.1-canary.7", | ||
"bugs": "https://github.com/useparagon/whiskers/issues", | ||
@@ -11,3 +11,4 @@ "homepage": "https://github.com/useparagon/whiskers#readme", | ||
"files": [ | ||
"./dist/" | ||
"./dist/", | ||
"!./dist/.tsbuildinfo" | ||
], | ||
@@ -14,0 +15,0 @@ "engines": { |
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
Sorry, the diff of this file is not supported yet
58864
55
1286