MCPcopy Index your code
hub / github.com/OneSignal/onesignal-node-api / isCodeInRange

Function isCodeInRange

util.ts:9–28  ·  view source on GitHub ↗
(codeRange: string, code: number)

Source from the content-addressed store, hash-verified

7 * @param code the http status code to be checked against the code range
8 */
9export function isCodeInRange(codeRange: string, code: number): boolean {
10 // This is how the default value is encoded in OAG
11 if (codeRange === "0") {
12 return true;
13 }
14 if (codeRange == code.toString()) {
15 return true;
16 } else {
17 const codeString = code.toString();
18 if (codeString.length != codeRange.length) {
19 return false;
20 }
21 for (let i = 0; i < codeString.length; i++) {
22 if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
23 return false;
24 }
25 }
26 return true;
27 }
28}
29
30/**
31* Returns if it can consume form

Callers 15

cancelNotificationMethod · 0.90
copyTemplateToAppMethod · 0.90
createAliasMethod · 0.90
createApiKeyMethod · 0.90
createAppMethod · 0.90
createCustomEventsMethod · 0.90
createNotificationMethod · 0.90
createSegmentMethod · 0.90
createSubscriptionMethod · 0.90
createTemplateMethod · 0.90
createUserMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected