Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@oozcitak/util

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oozcitak/util - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

12

lib/StringWalker.d.ts

@@ -62,2 +62,14 @@ /**

seek(count: number, reference?: SeekOrigin): void;
/**
* Consumes a number of code points.
*
* @param count - number of code points to take
*/
take(countOrFunc: number | ((char: string) => boolean)): string;
/**
* Skips a number of code points.
*
* @param count - number of code points to skip
*/
skip(countOrFunc: number | ((char: string) => boolean)): void;
}

@@ -64,0 +76,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
/**

@@ -183,2 +184,50 @@ * Walks the code points of a string.

}
/**
* Consumes a number of code points.
*
* @param count - number of code points to take
*/
take(countOrFunc) {
if (_1.isNumber(countOrFunc)) {
if (countOrFunc === 0)
return "";
let str = "";
let n = 0;
while (n < countOrFunc) {
str += this.c;
this.next();
n++;
}
return str;
}
else {
if (!countOrFunc(this.c))
return "";
let str = this.c;
while (this.next() && countOrFunc(this.c)) {
str += this.c;
}
return str;
}
}
/**
* Skips a number of code points.
*
* @param count - number of code points to skip
*/
skip(countOrFunc) {
if (_1.isNumber(countOrFunc)) {
if (countOrFunc === 0)
return;
let n = 0;
while (n < countOrFunc && this.next()) {
n++;
}
}
else {
if (!countOrFunc(this.c))
return;
while (this.next() && countOrFunc(this.c)) { }
}
}
}

@@ -185,0 +234,0 @@ exports.StringWalker = StringWalker;

2

package.json
{
"name": "@oozcitak/util",
"version": "2.0.0",
"version": "2.1.0",
"keywords": [

@@ -5,0 +5,0 @@ "util",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc