Still trying to leak sensitive data?! Instead of a 'safelist' for WHAT TO INCLUDE, you need a 'blocklist' for what to exclude! Meet Omit. It's the perfect utility type for when you want to return ALMOST everything from an object, but need to guarantee you hide sensitive fields: Yesterday we discussed Pick and it only felt natural for us to discuss Omit today! Share this with a friend and come back tomorrow for another Typescript tip! https://lnkd.in/gSFrRK3V #code #coding #programming #softwareengineering
How to use Omit in Typescript to exclude sensitive data
More Relevant Posts
-
Enforced Type Safety with Server-Defined Types 🔄⚙️ Join Steve Kinney to master end-to-end type safety with TypeScript. Share types between client and server, use Zod schemas to avoid API surprises, build with tRPC, and simplify database migrations with Prisma. https://lnkd.in/gHzB-BiA #Fullstack #Backend #WebDev #Programming #Coding #LearnToCode #TypeScript
To view or add a comment, sign in
-
The scariest bug in production? Accidentally exposing sensitive data! Don't just hope you filtered your objects. Enforce it at the type level! Here's how TypeScript's Pick utility type acts as your security guard. It lets you create a "safelist" of properties. #code #coding #programming #softwareengineering
To view or add a comment, sign in
-
-
🚀 Day 06/10 of Linked List Series: Delete a Node at the Beginning 🎯 Let’s understand the concept in a simple and beginner-friendly way 👇 🧠 Algorithm (Step-by-Step): 1️⃣ Start with the head of the linked list (first node). 2️⃣ Check if the list is empty — if yes, there’s nothing to delete. 3️⃣ If not empty, move the head pointer to the next node. 4️⃣ The old head node gets disconnected automatically (deleted). 5️⃣ Return the new head of the list. 💡 In short: Deleting at the beginning simply means — 👉 “Make the second node the new head of the list.” This is one of the simplest and most common operations in Linked Lists. 🔥 Stay tuned for the next part in the series! #CodeWithLakkojuEswaraSai #CodeWithLakkojuEswaraSai_LinkedList #10000Coders #LinkedList #DataStructures #LearnCoding #JavaForBeginners #ProgrammersLife #CodingCommunity #TechLearning #CodingJourney #DSASeries #Leetcode #JavaDeveloper #FullStackDeveloper
To view or add a comment, sign in
-
-
✅Day 58 of #100DaysOfLeetCode 1.📌Problem: 2011. Final Value of Variable After Performing Operations 2.✅ Difficulty: Easy 3.📍Topic: Array 4.🎯 Goal: Given an array of strings operations containing a list of operations, return the final value of x after performing all the operations. 5.🧠key idea: Approach 1: Initialize a counter variable to zero. Iterate through the input array of operations. For each operation string, check if it represents an increment ("++X" or "X++"). If it does, increase the counter by one. Otherwise, it's a decrement, so decrease the counter by one. After checking all the operations, return the final value of the counter. #100DaysOfLeetCode #CodingChallenge #Java #ProblemSolving #SoftwareDevelopment #Developer #Programming #CodeNewbie #Tech #DataStructures #Algorithms #Array #LeetCodeChallenge #SoftwareEngineer #DailyChallenge
To view or add a comment, sign in
-
-
🧠 LeetCode #1526 — Minimum Number of Increments on Subarrays to Form a Target Array Difficulty: Hard 🔴 Language: C++ 💻 💡 Approach: Instead of simulating subarray increments, observe that each time the array value surpasses the previous one, a corresponding operation is required. To calculate the total operations needed, sum all positive variances between adjacent elements along with the initial element. ✅ Time Complexity: O(n) ✅ Space Complexity: O(1) 📈 Result: Accepted (0 ms runtime) 💬 Simple logic, efficient solution! 🔥 Keep solving, keep growing 💪 #LeetCode #CPlusPlus #DSA #Coding #ProblemSolving #HardProblems #100DaysOfCode
To view or add a comment, sign in
-
-
𝐒𝐭𝐨𝐩 𝐁𝐮𝐠𝐬, 𝐒𝐡𝐢𝐩 𝐅𝐚𝐬𝐭𝐞𝐫! Say goodbye to late-night hotfixes and runtime surprises. Your code can, and should, be safer. In this workshop, Soumaya Erradi, Senior Software Developer Atlantis S.R.L., will reveal the true power of Advanced TypeScript. You’ll see how to make your APIs hard to misuse, refactor with total confidence, and encode domain rules directly in your types. Join and walk away with a survival toolkit. The result? Less stress, more speed. More info about the workshop: https://lnkd.in/dCxKx4Bk #TypeScript #AdvancedCoding #Programming #SafeCode
To view or add a comment, sign in
-
-
Day 45 of LeetCode grind — “Make Array Elements Equal to Zero” (Problem #3354) This one looked like a simulation problem at first glance, but it’s actually an elegant math trick hiding under a messy description. Instead of simulating all that left-right bouncing chaos, you just compare prefix sums — figuring out where the array can be “balanced” around a zero. Key takeaway: Sometimes the shortest code comes from refusing to believe the problem is as complicated as it sounds. ✅ Accepted 🧠 Concepts: Prefix Sum, Balance Points 💬 Lesson: Elegant logic > brute force chaos Slowly crawling my way through 100 days of consistency — still standing, still debugging. #LeetCode #100DaysOfCode #ProblemSolving #Cplusplus #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 63 of #100DaysOfCode Today I solved a C++ problem: 👉 Find K Pairs with Smallest Sums 🧩 Problem Summary: Given two sorted arrays arr1 and arr2, and an integer k, the task is to find k pairs (a, b) where a belongs to arr1 and b belongs to arr2, such that their sum is among the smallest possible. 🧠 Approach: I used a min-heap (priority_queue with greater comparator) to always extract the smallest pair sum efficiently. Start by pushing the smallest possible pairs from arr1 and the first element of arr2. Each time we pop the smallest pair, we add the next possible pair from the same row. Continue until we find k pairs. ⚙️ Key Concepts: Priority Queue (Min-Heap) Pair Sum Optimization Efficient use of STL 💡 Complexity: Time: O(k log k) Space: O(k) 👨💻 Language: C++ (STL-based) #100DaysOfCode #Day63 #CPlusPlus #STL #CodingChallenge #DSA #ProblemSolving #LeetCode #CodeNewbie #Programmer #LearnCoding #CompetitiveProgramming #cpp #DataStructures #Algorithms
To view or add a comment, sign in
-
-
#Day13 2 – Add Two Numbers Solved this classic linked list problem by implementing an efficient algorithm to add two numbers represented as reverse-digit linked lists. 💡 Approach: Used a dummy node to simplify list construction, iterated through both lists while handling different lengths, and maintained a carry value for proper digit summation. The solution elegantly handles cases where lists have different sizes and final carry propagation. #LeetCode #Java #LinkedList #DataStructures #Algorithms #ProblemSolving #Coding #Tech #SoftwareEngineering #DailyCoding #Programming
To view or add a comment, sign in
-
-
📅 Day 50 of #100DaysOfCode Problem: Simplify Path (LeetCode 71) Approach: 1️⃣ Used a stringstream to split the path by '/'. 2️⃣ Ignored empty tokens and "." since they don’t change the directory. 3️⃣ For "..", popped the last directory from the stack (if any). 4️⃣ Rebuilt the canonical path from the stack in the correct order. #100DaysOfCode #LeetCode #DSA #ProblemSolving #Stacks #Cplusplus #CodingChallenge #Algorithms #Programming #DeveloperLife #CodingJourney #CodeNewbie #DailyDSA #SoftwareEngineering #KeepLearning #GrowthMindset #Motivation #TechCommunity #CleanCode
To view or add a comment, sign in
-
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Great usage of Omit! I'd also add this doesn't guarantee omission of data at runtime. You'd need some good ol' runtime validation with a type guard or validation library like zod, io-ts, etc.