UNPKG

@focuson/cod

Version:

A command line tool to help with the code on demand

16 lines (15 loc) 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Strings = void 0; //Copyright (c)2020-2022 Philip Rice. <br />Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the Software), to dealin the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: <br />The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED AS const crypto_js_1 = require("crypto-js"); class Strings { static findSha(content) { const sha256Code = (0, crypto_js_1.SHA256)(content).toString(); return ({ content: content, sha: sha256Code }); } static replaceMultipleStrings(stringReplaceData) { return contents => stringReplaceData.reduce((acc, v) => acc.replace(v.fromMatcher, v.to), contents); } } exports.Strings = Strings;