Skip to content

Commit 13089db

Browse files
committed
wip: set REVERSE_OPS as alias of OPS
1 parent 510d437 commit 13089db

File tree

4 files changed

+4
-21
lines changed

4 files changed

+4
-21
lines changed

src/cjs/ops.cjs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,4 @@ var OPS;
123123
OPS[(OPS['OP_PUBKEYHASH'] = 253)] = 'OP_PUBKEYHASH';
124124
OPS[(OPS['OP_PUBKEY'] = 254)] = 'OP_PUBKEY';
125125
OPS[(OPS['OP_INVALIDOPCODE'] = 255)] = 'OP_INVALIDOPCODE';
126-
})(OPS || (exports.OPS = OPS = {}));
127-
// Dynamically generate REVERSE_OPS
128-
const REVERSE_OPS = Object.fromEntries(
129-
Object.entries(OPS).map(([key, value]) => [value, key]),
130-
);
131-
exports.REVERSE_OPS = REVERSE_OPS;
126+
})(OPS || (exports.REVERSE_OPS = exports.OPS = OPS = {}));

src/cjs/ops.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,4 @@ declare enum OPS {
119119
OP_PUBKEY = 254,
120120
OP_INVALIDOPCODE = 255
121121
}
122-
declare const REVERSE_OPS: {
123-
[key: number]: string;
124-
};
125-
export { OPS, REVERSE_OPS };
122+
export { OPS, OPS as REVERSE_OPS };

src/esm/ops.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,5 @@ var OPS;
121121
OPS[(OPS['OP_PUBKEY'] = 254)] = 'OP_PUBKEY';
122122
OPS[(OPS['OP_INVALIDOPCODE'] = 255)] = 'OP_INVALIDOPCODE';
123123
})(OPS || (OPS = {}));
124-
// Dynamically generate REVERSE_OPS
125-
const REVERSE_OPS = Object.fromEntries(
126-
Object.entries(OPS).map(([key, value]) => [value, key]),
127-
);
128124
// Export modules
129-
export { OPS, REVERSE_OPS };
125+
export { OPS, OPS as REVERSE_OPS };

ts_src/ops.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,5 @@ enum OPS {
135135
OP_INVALIDOPCODE = 255,
136136
}
137137

138-
// Dynamically generate REVERSE_OPS
139-
const REVERSE_OPS: { [key: number]: string } = Object.fromEntries(
140-
Object.entries(OPS).map(([key, value]) => [value, key]),
141-
);
142-
143138
// Export modules
144-
export { OPS, REVERSE_OPS };
139+
export { OPS, OPS as REVERSE_OPS };

0 commit comments

Comments
 (0)