D1
D2
D3
D4
D5
D6
D7

ตัวอย่างหนัง Solana: Anchor IDL failing to initialize in TS SDK with `Error: undefined is not an object (evaluating ‘s.split’)`

ดูหนังออนไลน์ Solana: Anchor IDL failing to initialize in TS SDK with `Error: undefined is not an object (evaluating ‘s.split’)`
ปีที่ฉาย :

เสียง :

Solana: Anchor IDL failing to initialize in TS SDK with `Error: undefined is not an object (evaluating ‘s.split’)` on IMDb

ชม : 3 ครั้ง

Oshibba with IDL IDL Legacy

Solana Explorer, Popular Platform for Access and Disagreeing Entertainment Blockchain, assists problems with Legacy IDL in Typescript SDK. One conquret scoop, which was affiliated, is “unpredited, is not an objection (s.split”).

This question is the question of the predatting the domain name Explorer.Solana.com in the format Camelcast, which is threw some more old IDL. The problem is concluded in the volume, how typescript is the method ofSplit ()Strok in some cases.

Problem:

At the presence of the domain name in the CamelCase Typescript, the methodSplit ()with the empty buckle in the quality of the separator is asked. However, whenExplorer.solana.comdoes not exist with a heavy buckle (that is, there is no stretch), S.Ssplit () Returizes the massive, contemporary only one element. In this case, theundefined ‘look out of the object.

Resolution:

Solana: Anchor IDL failing to initialize in TS SDK with `Error: undefined is not an object (evaluating 's.split')`

To solve this problem, you can use the second underweight for the prey of the domain name in the Camelcase. One of the sides will make up the use of regular expression (regex) in your Typescript code.

Here is a predicted primer, which is used by the Regex for reaching the gastrointestinal resulted:

`Typescript

Import * as TS from “Typescript”;

// Available that we have the following IDL:

Const Exploreridl =

// This is the IDL IDL.

// He has to be a pre -formation in Camelcast, as this: "Explorer.solana.com" -> "Explorer.solana.com"

;

Function Converttocamelcase (IDL: String): String {

Const Parser = Ts.CreateParser (IDL);

Const SourceFile = ts.CreatesourceFile (‘IDL.T’, IDL, TS.Scripttarget.es2015);

Empty CamelCaseidl = ”;

For (CONST TOKEN OF PARSER.GETTOKENS (SOURCEFILE) {

IF (ts.isidentifier (token) &&! token.value.startswith (‘_’)) {

Camelcastidl += Token.name;

} ELSE IF (TS.ISSSTRINGLITEL (TOKEN)) {

Const Regex = New Regexp ($ {TOKEN.VALUE.REPLACE (/([A-Z]) | ([A-Z])/G, '$ 1 $ 1')}, ‘U’);

Let’s do it: Regexpexecarray | zero;

While ((Match = Regex.exec (Token.value))! == null) {

Camelcastidl += Match [0] [0] .tolowerCase ();

}

} ELSE IF (TS.ISEXPRESSIONSTEMENT (TOKEN)) {

CamelCaseidl += Converttocamelcast (Token.Expression);

}

}

return Camelcaseidl;

}

Console.log (Converttocamelcast (Exploreridl));

`

In this accordance with the functioning of Converttocamelcase () If this is an identifier, he simply adds his name to Stroke Camelcase IDL. If this is a stronger book, it will intervene the stack, the same regulation is used, and the storage adds its first letter (in the upper reagistra) to strike camelcast idl.

Conclusion:

The problem with the entrance code can be resolved with the use of regular expression in typescript for the prey of the domain name in Camelcase. This underwear guarantees that the right objects are outbuilding, and the “unpredited objection” is shot “.

ethereum start pine tradingview

C1
C2
C3



C4
C5
C6

ความคิดเห็น


หนังอื่นๆ น่าสนใจ

ค้นหาหนัง

  • D8
  • D9
  • D10
  • D11
  • D12
  • D13
  • D14
  • ดูหนังออนไลน์ ดูหนังใหม่ชนโรงฟรี HD

    ดูหนังออนไลน์ ฟรี คมชัด แบบ HD โหลดเร็ว ไม่กระตุก ความชมชัดได้มากถึง 4K 

    อ่านต่อ

    ดูหนังออนไลน์ ฟรี คมชัด แบบ HD โหลดเร็ว ไม่กระตุก ความชมชัดได้มากถึง 4K