11cb0ef41Sopenharmony_ci// Flags: --expose-internals 21cb0ef41Sopenharmony_ci'use strict'; 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ciconst common = require('../common'); 51cb0ef41Sopenharmony_ciif (!common.hasCrypto) 61cb0ef41Sopenharmony_ci common.skip('missing crypto'); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ciconst assert = require('assert'); 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ciconst { 111cb0ef41Sopenharmony_ci normalizeAlgorithm, 121cb0ef41Sopenharmony_ci} = require('internal/crypto/util'); 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci{ 151cb0ef41Sopenharmony_ci // Check that normalizeAlgorithm does not mutate object inputs. 161cb0ef41Sopenharmony_ci const algorithm = { name: 'ECDSA', hash: 'SHA-256' }; 171cb0ef41Sopenharmony_ci assert.strictEqual(normalizeAlgorithm(algorithm, 'sign') !== algorithm, true); 181cb0ef41Sopenharmony_ci assert.deepStrictEqual(algorithm, { name: 'ECDSA', hash: 'SHA-256' }); 191cb0ef41Sopenharmony_ci} 20