Gathering detailed insights and metrics for sweet-helpers
Gathering detailed insights and metrics for sweet-helpers
Gathering detailed insights and metrics for sweet-helpers
Gathering detailed insights and metrics for sweet-helpers
npm install sweet-helpers
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
34 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Jan 19, 2020
Latest Version
3.0.1
Package Id
sweet-helpers@3.0.1
Size
4.04 kB
NPM Version
3.3.12
Node Version
5.1.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Collection of SweetJS macros.
1npm install sweet-helpers --save-dev
1var gulp = require('gulp'), 2 sweetjs = requier('gulp-sweetjs'); 3 4gulp.task('sweetjs', function () { 5 gulp.src('./myFile.js') 6 .pipe(sweetjs({modules: ['./node_modules/sweet-helpers/index.sjs']})) 7 .pipe(gulp.dest('./public/js')); 8}); 9 10gulp.task('default', ['sweetjs']);
Template
1undef$
Result
1void 0
Returns true if the specified value is undefined.
Template
1isUndef$(foo)
Or
1foo::isUndef$()
Result
1typeof foo === 'undefined'
Returns true if the specified value isn't undefined.
Template
1isNotUndef$(foo)
Or
1foo::isNotUndef$()
Result
1typeof foo !== 'undefined'
Returns true if the specified value isn't null or undefined.
Template
1isSet$(foo)
Or
1foo::isSet$()
Result
1typeof foo !== 'undefined' && foo !== null
Returns true if the specified value is null or undefined.
Template
1isNotSet$(foo)
Or
1foo::isNotSet$()
Result
1typeof foo === 'undefined' || foo === null
Returns true if the specified value is null.
Template
1isNull$(foo)
Or
1foo::isNull$()
Result
1typeof foo !== 'undefined' && foo === null
Returns true if the specified value isn't null.
Template
1isNotNull$(foo)
Or
1foo::isNotNull$()
Result
1typeof foo === 'undefined' || foo !== null
Returns true if the specified value is boolean.
Template
1isBoolean$(foo)
Or
1foo::isBoolean$()
Result
1typeof foo === 'boolean'
Returns true if the specified value isn't boolean.
Template
1isNotBoolean$(foo)
Or
1foo::isNotBoolean$()
Result
1typeof foo !== 'boolean'
Returns true if the specified value is a string.
Template
1isString$(foo)
Or
1foo::isString$()
Result
1typeof foo === 'string'
Returns true if the specified value isn't a string.
Template
1isNotString$(foo)
Or
1foo::isNotString$()
Result
1typeof foo !== 'string'
Returns true if the specified value is a number.
Template
1isNumber$(foo)
Or
1foo::isNumber$()
Result
1typeof foo === 'number'
Returns true if the specified value is a number.
Template
1isNotNumber$(foo)
Or
1foo::isNotNumber$()
Result
1typeof foo !== 'number'
Returns true if the specified value is numeric.
Template
1isNumber$(foo)
Or
1foo::isNumber$()
Result
1typeof foo === 'number' && isFinite(foo)
Returns true if the specified value isn't numeric.
Template
1isNotNumeric$(foo)
Or
1foo::isNotNumeric$()
Result
1typeof foo !== 'number' || !isFinite(foo)
Returns true if the specified value is NaN.
Template
1isRealNaN$(foo)
Or
1foo::isRealNaN$()
Result
1typeof foo === 'number' && isNaN(foo)
Returns true if the specified value isn't NaN.
Template
1isNotRealNaN$(foo)
Or
1foo::isNotRealNaN$()
Result
1typeof foo !== 'number' || !isNaN(foo)
Returns true if the specified value is a function.
Template
1isFunction$(foo)
Or
1foo::isFunction$()
Result
1typeof foo === 'function'
Returns true if the specified value isn't a function.
Template
1isNotFunction$(foo)
Or
1foo::isNotFunction$()
Result
1typeof foo !== 'function'
Returns true if the specified value instance of a base object.
Template
1instanceof$(foo, String)
Or
1foo::instanceof$(String)
Result
1foo instanceof String || foo && foo.constructor && foo.constructor.name === String.name
Returns [[class]] of the specified value.
Template
1type$(foo)
Or
1foo::type$()
Result
1({}).toString.call(foo)
Returns a link for an iterator of the specified value.
Template
1iterator$(foo)
Or
1foo::iterator$()
Result
1typeof foo !== 'undefined' && foo !== null ? 2 (typeof foo['@@iterator'] === 'function' ? 3 foo['@@iterator'] : typeof Symbol === 'function' ? 4 foo[Symbol['iterator']] : void 0) : void 0
Converts the specified value to a number.
Template
1number$(foo)
Or
1foo::number$()
Result
1(+foo)
Converts the specified value to a string.
Template
1string$(foo)
Or
1foo::string$()
Result
1(foo + '')
Converts the specified value to boolean.
Template
1boolean$(foo)
Or
1foo::boolean$()
Result
1!!foo
Returns an object for working with macro functions.
Gets the first non false property from an object.
Template
1use$(foo).get('foo', 'bar')
Or
1foo::get$('foo', 'bar')
Result
1foo['foo'] || foo['bar']
Returns true if all specified properties are exists in an object.
Template
1use$(foo).in('foo', 'bar')
Or
1foo::in$('foo', 'bar')
Result
1'foo' in foo && 'bar' in foo
Returns true if all specified properties aren't exists in an object.
Template
1use$(foo).not('foo', 'bar')
Or
1foo::not$('foo', 'bar')
Result
1'foo' in foo === false && 'bar' in foo === false
Returns true if any of specified properties are exists in an object.
Template
1use$(foo).some('foo', 'bar')
Or
1foo::some$('foo', 'bar')
Result
1'foo' in foo || 'bar' in foo
Decorates a function.
Template
1var foo = decorate$(bar, car) :: function () { 2 return 1; 3};
Or
1var foo = decorate$(bar, car) || function () { 2 return 1; 3};
Result
1var foo = car(bar(function () { 2 return 1; 3}));
The MIT License.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More