New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-string-helper

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-string-helper - npm Package Compare versions

Comparing version 2.0.13 to 2.0.14

11

bundles/ngx-string-helper.umd.js

@@ -223,7 +223,10 @@ (function (global, factory) {

};
NgxStrHelper.prototype.map = function (str, callback) {
if (str.length === 0 || typeof callback !== 'function')
return str;
return str.replace(/./g, callback);
NgxStrHelper.prototype.chop = function (str, step) {
if (str == null)
return [];
str = String(str);
step = ~~step;
return step > 0 ? str.match(new RegExp('.{1,' + step + '}', 'g')) : [str];
};
return NgxStrHelper;

@@ -230,0 +233,0 @@ }());

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],e):e(t["ngx-string-helper"]=t["ngx-string-helper"]||{},t.ng.core)}(this,function(t,e){"use strict";function r(){return new n}var n=function(){function t(){this.escapeChars={"¢":"cent","£":"pound","¥":"yen","€":"euro","©":"copy","®":"reg","<":"lt",">":"gt",'"':"quot","&":"amp","'":"#39"}}return t.prototype.isNullOrEmpty=function(t){return void 0===t||null===t||""===t},t.prototype.truncate=function(t,e){return t.substring(0,e)+"..."},t.prototype.contains=function(t,e){return t.indexOf(e)>=0},t.prototype.toSlug=function(t){return t.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"")},t.prototype.decapitalize=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},t.prototype.capitalize=function(t,e){var r=e?t.slice(1).toLowerCase():t.slice(1);return t.charAt(0).toUpperCase()+r},t.prototype.clean=function(t){return t.trim().replace(/\s\s+/g," ")},t.prototype.chars=function(t){return t.split("")},t.prototype.swapCase=function(t){return t.replace(/\S/g,function(t){return t===t.toUpperCase()?t.toLowerCase():t.toUpperCase()})},t.prototype.include=function(t,e){return""===e||-1!==t.indexOf(e)},t.prototype.count=function(t,e){return 0===t.length||0===e.length?0:t.split(e).length-1},t.prototype.escapeHTML=function(t){var e="[";for(var r in this.escapeChars)e+=r;e+="]";var n=new RegExp(e,"g");return t.replace(n,function(t){return"&"+this.escapeChars[t]+";"})},t.prototype.insert=function(t,e,r){return this.splice(t,e,0,r)},t.prototype.splice=function(t,e,r,n){var o=this.chars(t);return o.splice(~~e,~~r,n),o.join("")},t.prototype.replaceAll=function(t,e,r,n){var o=!0===n?"gi":"g",i=new RegExp(e,o);return t.replace(i,r)},t.prototype.isBlank=function(t){return/^\s*$/.test(t)},t.prototype.reverse=function(t){return this.chars(t).reverse().join("")},t.prototype.startsWith=function(t,e,r){return e=""+e,r=null==r?0:Math.min(this.toPositive(r),t.length),t.lastIndexOf(e,r)===r},t.prototype.endsWith=function(t,e,r){return e=""+e,(r=void 0===r?t.length-e.length:Math.min(this.toPositive(r),t.length)-e.length)>=0&&t.indexOf(e,r)===r},t.prototype.pred=function(t){return this.adjacent(t,-1)},t.prototype.succ=function(t){return this.adjacent(t,1)},t.prototype.titleize=function(t){return t.toLowerCase().replace(/(?:^|\s|-)\S/g,function(t){return t.toUpperCase()})},t.prototype.camelize=function(t,e){return t=t.trim().replace(/[-_\s]+(.)?/g,function(t,e){return e?e.toUpperCase():""}),!0===e?this.decapitalize(t):t},t.prototype.classify=function(t){return this.capitalize(this.camelize(t.replace(/[\W_]/g," "),!1).replace(/\s/g,""),!1)},t.prototype.underscored=function(t){return t.replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},t.prototype.dasherize=function(t){return t.replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},t.prototype.humanize=function(t){return this.capitalize(this.underscored(t).replace(/_id$/,"").replace(/_/g," ").trim(),!1)},t.prototype.toPositive=function(t){return t<0?0:+t||0},t.prototype.adjacent=function(t,e){return 0===t.length?"":t.slice(0,-1)+String.fromCharCode(t.charCodeAt(t.length-1)+e)},t.prototype.toNumber=function(t,e){if(null==t)return 0;var r=Math.pow(10,isFinite(e)?e:0);return Math.round(t*r)/r},t.prototype.stripTags=function(t){return t.replace(/<\/?[^>]+>/g,"")},t.prototype.repeat=function(t,e,r){if(e=~~e,null==r)return this.strRepeat(t,e);for(var n=[];e>0;n[--e]=t);return n.join(r)},t.prototype.strRepeat=function(t,e){if(e<1)return"";for(var r="";e>0;)1&e&&(r+=t),e>>=1,t+=t;return r},t.prototype.surround=function(t,e){return[e,t,e].join("")},t.prototype.quote=function(t,e){return this.surround(t,e||'"')},t.prototype.unquote=function(t,e){return e=e||'"',t[0]===e&&t[t.length-1]===e?t.slice(1,t.length-1):t},t.prototype.boolMatch=function(t,e){var r,n,o=t.toLowerCase();for(e=[].concat(e),r=0;r<e.length;r+=1)if(n=e[r]){if(n.test&&n.test(t))return!0;if(n.toLowerCase()===o)return!0}},t.prototype.toBoolean=function(t,e,r){return void 0===e&&(e=[]),void 0===r&&(r=[]),"number"==typeof t&&(t=""+t),"string"!=typeof t?!!t:(t=t.trim(),!!this.boolMatch(t,e||["true","1"])||!this.boolMatch(t,r||["false","0"])&&void 0)},t.prototype.map=function(t,e){return 0===t.length||"function"!=typeof e?t:t.replace(/./g,e)},t}();n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[]};var o=function(){function t(){}return t}();o.decorators=[{type:e.NgModule,args:[{providers:[{provide:n,useFactory:r}]}]}],o.ctorParameters=function(){return[]},t.NgxStrHelperModule=o,t.NgxStrHelper=n,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],e):e(t["ngx-string-helper"]=t["ngx-string-helper"]||{},t.ng.core)}(this,function(t,e){"use strict";function r(){return new n}var n=function(){function t(){this.escapeChars={"¢":"cent","£":"pound","¥":"yen","€":"euro","©":"copy","®":"reg","<":"lt",">":"gt",'"':"quot","&":"amp","'":"#39"}}return t.prototype.isNullOrEmpty=function(t){return void 0===t||null===t||""===t},t.prototype.truncate=function(t,e){return t.substring(0,e)+"..."},t.prototype.contains=function(t,e){return t.indexOf(e)>=0},t.prototype.toSlug=function(t){return t.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"")},t.prototype.decapitalize=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},t.prototype.capitalize=function(t,e){var r=e?t.slice(1).toLowerCase():t.slice(1);return t.charAt(0).toUpperCase()+r},t.prototype.clean=function(t){return t.trim().replace(/\s\s+/g," ")},t.prototype.chars=function(t){return t.split("")},t.prototype.swapCase=function(t){return t.replace(/\S/g,function(t){return t===t.toUpperCase()?t.toLowerCase():t.toUpperCase()})},t.prototype.include=function(t,e){return""===e||-1!==t.indexOf(e)},t.prototype.count=function(t,e){return 0===t.length||0===e.length?0:t.split(e).length-1},t.prototype.escapeHTML=function(t){var e="[";for(var r in this.escapeChars)e+=r;e+="]";var n=new RegExp(e,"g");return t.replace(n,function(t){return"&"+this.escapeChars[t]+";"})},t.prototype.insert=function(t,e,r){return this.splice(t,e,0,r)},t.prototype.splice=function(t,e,r,n){var o=this.chars(t);return o.splice(~~e,~~r,n),o.join("")},t.prototype.replaceAll=function(t,e,r,n){var o=!0===n?"gi":"g",i=new RegExp(e,o);return t.replace(i,r)},t.prototype.isBlank=function(t){return/^\s*$/.test(t)},t.prototype.reverse=function(t){return this.chars(t).reverse().join("")},t.prototype.startsWith=function(t,e,r){return e=""+e,r=null==r?0:Math.min(this.toPositive(r),t.length),t.lastIndexOf(e,r)===r},t.prototype.endsWith=function(t,e,r){return e=""+e,(r=void 0===r?t.length-e.length:Math.min(this.toPositive(r),t.length)-e.length)>=0&&t.indexOf(e,r)===r},t.prototype.pred=function(t){return this.adjacent(t,-1)},t.prototype.succ=function(t){return this.adjacent(t,1)},t.prototype.titleize=function(t){return t.toLowerCase().replace(/(?:^|\s|-)\S/g,function(t){return t.toUpperCase()})},t.prototype.camelize=function(t,e){return t=t.trim().replace(/[-_\s]+(.)?/g,function(t,e){return e?e.toUpperCase():""}),!0===e?this.decapitalize(t):t},t.prototype.classify=function(t){return this.capitalize(this.camelize(t.replace(/[\W_]/g," "),!1).replace(/\s/g,""),!1)},t.prototype.underscored=function(t){return t.replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},t.prototype.dasherize=function(t){return t.replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},t.prototype.humanize=function(t){return this.capitalize(this.underscored(t).replace(/_id$/,"").replace(/_/g," ").trim(),!1)},t.prototype.toPositive=function(t){return t<0?0:+t||0},t.prototype.adjacent=function(t,e){return 0===t.length?"":t.slice(0,-1)+String.fromCharCode(t.charCodeAt(t.length-1)+e)},t.prototype.toNumber=function(t,e){if(null==t)return 0;var r=Math.pow(10,isFinite(e)?e:0);return Math.round(t*r)/r},t.prototype.stripTags=function(t){return t.replace(/<\/?[^>]+>/g,"")},t.prototype.repeat=function(t,e,r){if(e=~~e,null==r)return this.strRepeat(t,e);for(var n=[];e>0;n[--e]=t);return n.join(r)},t.prototype.strRepeat=function(t,e){if(e<1)return"";for(var r="";e>0;)1&e&&(r+=t),e>>=1,t+=t;return r},t.prototype.surround=function(t,e){return[e,t,e].join("")},t.prototype.quote=function(t,e){return this.surround(t,e||'"')},t.prototype.unquote=function(t,e){return e=e||'"',t[0]===e&&t[t.length-1]===e?t.slice(1,t.length-1):t},t.prototype.boolMatch=function(t,e){var r,n,o=t.toLowerCase();for(e=[].concat(e),r=0;r<e.length;r+=1)if(n=e[r]){if(n.test&&n.test(t))return!0;if(n.toLowerCase()===o)return!0}},t.prototype.toBoolean=function(t,e,r){return void 0===e&&(e=[]),void 0===r&&(r=[]),"number"==typeof t&&(t=""+t),"string"!=typeof t?!!t:(t=t.trim(),!!this.boolMatch(t,e||["true","1"])||!this.boolMatch(t,r||["false","0"])&&void 0)},t.prototype.chop=function(t,e){return null==t?[]:(t=String(t),e=~~e,e>0?t.match(new RegExp(".{1,"+e+"}","g")):[t])},t}();n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[]};var o=function(){function t(){}return t}();o.decorators=[{type:e.NgModule,args:[{providers:[{provide:n,useFactory:r}]}]}],o.ctorParameters=function(){return[]},t.NgxStrHelperModule=o,t.NgxStrHelper=n,Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "ngx-string-helper",
"version": "2.0.13",
"version": "2.0.14",
"description": "Ngx lacks complete string manipulation operations. This is an attempt to fill that gap.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -291,2 +291,7 @@ ## Angular 2+ String Helper

```
#### NgxStrHelper.chop();
```javascript
ngxStrHelper.chop("whitespace", 3);
// => Outputs: ["whi", "tes", "pac", "e"]
```
#### Thanks and enjoy!

@@ -42,3 +42,3 @@ export declare class NgxStrHelper {

toBoolean(str: string, trueValues?: never[], falseValues?: never[]): boolean | undefined;
map(str: string, callback: any): string;
chop(str: string, step: number): never[] | RegExpMatchArray | null;
}

@@ -218,7 +218,10 @@ import { Injectable } from '@angular/core';

};
NgxStrHelper.prototype.map = function (str, callback) {
if (str.length === 0 || typeof callback !== 'function')
return str;
return str.replace(/./g, callback);
NgxStrHelper.prototype.chop = function (str, step) {
if (str == null)
return [];
str = String(str);
step = ~~step;
return step > 0 ? str.match(new RegExp('.{1,' + step + '}', 'g')) : [str];
};
;
return NgxStrHelper;

@@ -225,0 +228,0 @@ }());

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"NgxStrHelper":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"isNullOrEmpty":[{"__symbolic":"method"}],"truncate":[{"__symbolic":"method"}],"contains":[{"__symbolic":"method"}],"toSlug":[{"__symbolic":"method"}],"decapitalize":[{"__symbolic":"method"}],"capitalize":[{"__symbolic":"method"}],"clean":[{"__symbolic":"method"}],"chars":[{"__symbolic":"method"}],"swapCase":[{"__symbolic":"method"}],"include":[{"__symbolic":"method"}],"count":[{"__symbolic":"method"}],"escapeHTML":[{"__symbolic":"method"}],"insert":[{"__symbolic":"method"}],"splice":[{"__symbolic":"method"}],"replaceAll":[{"__symbolic":"method"}],"isBlank":[{"__symbolic":"method"}],"reverse":[{"__symbolic":"method"}],"startsWith":[{"__symbolic":"method"}],"endsWith":[{"__symbolic":"method"}],"pred":[{"__symbolic":"method"}],"succ":[{"__symbolic":"method"}],"titleize":[{"__symbolic":"method"}],"camelize":[{"__symbolic":"method"}],"classify":[{"__symbolic":"method"}],"underscored":[{"__symbolic":"method"}],"dasherize":[{"__symbolic":"method"}],"humanize":[{"__symbolic":"method"}],"toPositive":[{"__symbolic":"method"}],"adjacent":[{"__symbolic":"method"}],"toNumber":[{"__symbolic":"method"}],"stripTags":[{"__symbolic":"method"}],"repeat":[{"__symbolic":"method"}],"strRepeat":[{"__symbolic":"method"}],"surround":[{"__symbolic":"method"}],"quote":[{"__symbolic":"method"}],"unquote":[{"__symbolic":"method"}],"boolMatch":[{"__symbolic":"method"}],"toBoolean":[{"__symbolic":"method"}],"map":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"NgxStrHelper":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"isNullOrEmpty":[{"__symbolic":"method"}],"truncate":[{"__symbolic":"method"}],"contains":[{"__symbolic":"method"}],"toSlug":[{"__symbolic":"method"}],"decapitalize":[{"__symbolic":"method"}],"capitalize":[{"__symbolic":"method"}],"clean":[{"__symbolic":"method"}],"chars":[{"__symbolic":"method"}],"swapCase":[{"__symbolic":"method"}],"include":[{"__symbolic":"method"}],"count":[{"__symbolic":"method"}],"escapeHTML":[{"__symbolic":"method"}],"insert":[{"__symbolic":"method"}],"splice":[{"__symbolic":"method"}],"replaceAll":[{"__symbolic":"method"}],"isBlank":[{"__symbolic":"method"}],"reverse":[{"__symbolic":"method"}],"startsWith":[{"__symbolic":"method"}],"endsWith":[{"__symbolic":"method"}],"pred":[{"__symbolic":"method"}],"succ":[{"__symbolic":"method"}],"titleize":[{"__symbolic":"method"}],"camelize":[{"__symbolic":"method"}],"classify":[{"__symbolic":"method"}],"underscored":[{"__symbolic":"method"}],"dasherize":[{"__symbolic":"method"}],"humanize":[{"__symbolic":"method"}],"toPositive":[{"__symbolic":"method"}],"adjacent":[{"__symbolic":"method"}],"toNumber":[{"__symbolic":"method"}],"stripTags":[{"__symbolic":"method"}],"repeat":[{"__symbolic":"method"}],"strRepeat":[{"__symbolic":"method"}],"surround":[{"__symbolic":"method"}],"quote":[{"__symbolic":"method"}],"unquote":[{"__symbolic":"method"}],"boolMatch":[{"__symbolic":"method"}],"toBoolean":[{"__symbolic":"method"}],"map":[{"__symbolic":"method"}]}}}}]
[{"__symbolic":"module","version":3,"metadata":{"NgxStrHelper":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"isNullOrEmpty":[{"__symbolic":"method"}],"truncate":[{"__symbolic":"method"}],"contains":[{"__symbolic":"method"}],"toSlug":[{"__symbolic":"method"}],"decapitalize":[{"__symbolic":"method"}],"capitalize":[{"__symbolic":"method"}],"clean":[{"__symbolic":"method"}],"chars":[{"__symbolic":"method"}],"swapCase":[{"__symbolic":"method"}],"include":[{"__symbolic":"method"}],"count":[{"__symbolic":"method"}],"escapeHTML":[{"__symbolic":"method"}],"insert":[{"__symbolic":"method"}],"splice":[{"__symbolic":"method"}],"replaceAll":[{"__symbolic":"method"}],"isBlank":[{"__symbolic":"method"}],"reverse":[{"__symbolic":"method"}],"startsWith":[{"__symbolic":"method"}],"endsWith":[{"__symbolic":"method"}],"pred":[{"__symbolic":"method"}],"succ":[{"__symbolic":"method"}],"titleize":[{"__symbolic":"method"}],"camelize":[{"__symbolic":"method"}],"classify":[{"__symbolic":"method"}],"underscored":[{"__symbolic":"method"}],"dasherize":[{"__symbolic":"method"}],"humanize":[{"__symbolic":"method"}],"toPositive":[{"__symbolic":"method"}],"adjacent":[{"__symbolic":"method"}],"toNumber":[{"__symbolic":"method"}],"stripTags":[{"__symbolic":"method"}],"repeat":[{"__symbolic":"method"}],"strRepeat":[{"__symbolic":"method"}],"surround":[{"__symbolic":"method"}],"quote":[{"__symbolic":"method"}],"unquote":[{"__symbolic":"method"}],"boolMatch":[{"__symbolic":"method"}],"toBoolean":[{"__symbolic":"method"}],"chop":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"NgxStrHelper":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"isNullOrEmpty":[{"__symbolic":"method"}],"truncate":[{"__symbolic":"method"}],"contains":[{"__symbolic":"method"}],"toSlug":[{"__symbolic":"method"}],"decapitalize":[{"__symbolic":"method"}],"capitalize":[{"__symbolic":"method"}],"clean":[{"__symbolic":"method"}],"chars":[{"__symbolic":"method"}],"swapCase":[{"__symbolic":"method"}],"include":[{"__symbolic":"method"}],"count":[{"__symbolic":"method"}],"escapeHTML":[{"__symbolic":"method"}],"insert":[{"__symbolic":"method"}],"splice":[{"__symbolic":"method"}],"replaceAll":[{"__symbolic":"method"}],"isBlank":[{"__symbolic":"method"}],"reverse":[{"__symbolic":"method"}],"startsWith":[{"__symbolic":"method"}],"endsWith":[{"__symbolic":"method"}],"pred":[{"__symbolic":"method"}],"succ":[{"__symbolic":"method"}],"titleize":[{"__symbolic":"method"}],"camelize":[{"__symbolic":"method"}],"classify":[{"__symbolic":"method"}],"underscored":[{"__symbolic":"method"}],"dasherize":[{"__symbolic":"method"}],"humanize":[{"__symbolic":"method"}],"toPositive":[{"__symbolic":"method"}],"adjacent":[{"__symbolic":"method"}],"toNumber":[{"__symbolic":"method"}],"stripTags":[{"__symbolic":"method"}],"repeat":[{"__symbolic":"method"}],"strRepeat":[{"__symbolic":"method"}],"surround":[{"__symbolic":"method"}],"quote":[{"__symbolic":"method"}],"unquote":[{"__symbolic":"method"}],"boolMatch":[{"__symbolic":"method"}],"toBoolean":[{"__symbolic":"method"}],"chop":[{"__symbolic":"method"}]}}}}]

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