UNPKG

node-twstock

Version:

A client library for scraping Taiwan stock market data

26 lines (25 loc) 882 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isWarrant = void 0; function isWarrant(symbol) { const rules = [ /^0[3-8][0-9][0-9][0-9][0-9]$/, /^0[3-8][0-9][0-9][0-9]P$/, /^0[3-8][0-9][0-9][0-9]F$/, /^0[3-8][0-9][0-9][0-9]Q$/, /^0[3-8][0-9][0-9][0-9]C$/, /^0[3-8][0-9][0-9][0-9]B$/, /^0[3-8][0-9][0-9][0-9]X$/, /^0[3-8][0-9][0-9][0-9]Y$/, /^7[0-3][0-9][0-9][0-9][0-9]$/, /^7[0-3][0-9][0-9][0-9]P$/, /^7[0-3][0-9][0-9][0-9]F$/, /^7[0-3][0-9][0-9][0-9]Q$/, /^7[0-3][0-9][0-9][0-9]C$/, /^7[0-3][0-9][0-9][0-9]B$/, /^7[0-3][0-9][0-9][0-9]X$/, /^7[0-3][0-9][0-9][0-9]Y$/, // 上櫃國內標的可展延上限型認售權證 ]; return rules.some(regex => regex.test(symbol)); } exports.isWarrant = isWarrant;