Comments (4)
This is intended.
Variable linesHtml
has type string | TrustedHTML
so you only need casting to string
.
Assignment element.innerHTML = linesHtml as string;
works properly.
The reason for this is, that the casting trick through unknown
requires the variable type to be exactly TrustedHTML
(and it's an union in your case).
from tsec.
Assignment element.innerHTML = linesHtml as string; works properly.
Pretty sure that I have tried this but without success. Tho, I might have been on a wrong version of tsec
- the yarn upgrade trick seems to be buggy and we are kinda desperate for #17. Folks keep getting a wrong version of tsec and aren't happy with tsec at all
from tsec.
I think I figured it out. The latest version of tsec seems to have lost the postinstall script that allows it to build, so even with the upgrade, it is still running old code. I've raised the issue internally and we'll work on a fix.
from tsec.
Oh, that explains a lot
from tsec.
Related Issues (13)
- Guidance on usage with trusted types HOT 2
- Suppress by error code HOT 1
- Publish tsec on npmjs.com HOT 4
- No support for project references? HOT 1
- Don't run tsc as a post install step HOT 4
- Exemptions not working? HOT 2
- Invalid warning on Worker assignment HOT 3
- Bazel Integration: support runfile resolution
- Why assigning Trusted Types to dangerous sinks still causes compilation error? HOT 5
- Support Trusted Types from DOM lib HOT 22
- Add option for ignoring TS errors HOT 6
- [ban-worker-calls] Is there any best practice for such error ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tsec.