![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@types/trusted-types
Advanced tools
TypeScript definitions for trusted-types
The @types/trusted-types npm package provides TypeScript type definitions for the Trusted Types API, which is a web security standard aimed at preventing Cross-Site Scripting (XSS) by restricting access to potentially dangerous DOM APIs. These type definitions allow developers to use Trusted Types in TypeScript projects with type checking and IntelliSense support.
Type Definitions for Trusted Types
This feature provides TypeScript type definitions for creating and manipulating Trusted Types, such as TrustedHTML, TrustedScript, and TrustedURL. The code sample demonstrates how to create a TrustedHTML type using a Trusted Types policy.
import { TrustedHTML, TrustedScriptURL } from 'trusted-types';
function createTrustedTypes(policyName: string): TrustedHTML {
const policy = trustedTypes.createPolicy(policyName, {
createHTML: (input) => input
});
return policy.createHTML('<div>Safe Content</div>');
}
DOMPurify is a library that sanitizes HTML and prevents XSS attacks. It does not have a dedicated TypeScript types package like @types/trusted-types, but it can be used in conjunction with @types/dompurify to achieve similar goals in terms of preventing XSS, albeit through sanitization rather than enforcing type safety.
npm install --save @types/trusted-types
This package contains type definitions for trusted-types (https://github.com/WICG/trusted-types).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/trusted-types.
These definitions were written by Jakub Vrana, Damien Engels, Emanuel Tesar, Bjarki, and Sebastian Silbermann.
FAQs
TypeScript definitions for trusted-types
The npm package @types/trusted-types receives a total of 8,651,707 weekly downloads. As such, @types/trusted-types popularity was classified as popular.
We found that @types/trusted-types demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.