(script: S)
| 11 | } |
| 12 | |
| 13 | export function defineScript<S extends RedisScriptConfig>(script: S): S & SHA1 { |
| 14 | return { |
| 15 | ...script, |
| 16 | SHA1: scriptSha1(script.SCRIPT) |
| 17 | }; |
| 18 | } |
| 19 | |
| 20 | export function scriptSha1(script: RedisScriptConfig['SCRIPT']): string { |
| 21 | return createHash('sha1').update(script).digest('hex'); |
no test coverage detected