1.0.15 • Published 6 years ago

jscommonutils v1.0.15

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

javaScript Commonly used tools

Installation

    npm install --save  jscommonutils

node

    var jscommonutils = require('jscommonutils')

AMD

    define(function (require, exports, module) {
        var jscommonutils = require('jscommonutils')
    })

##OverView

this API is include many utils which we Frequently used. Here are all the tools included in this package.

  • deppClone(origin, target).this method requests us pass two parameters, The first parameter is the cloned template, and the second parameter as the object we will clone to. it do not return a value, so the target must be a quote. Notes: origin must be object, but the target can be object or array.
  • dataType (target).this method requests us to pass one parameter, it represents the goal of the judge.In different case, it returns a different String. They're listed In the following.
    • number: 1,2,3...
    • string : '1', '2' ,'dad'...
    • boolean : true or fasle
    • undefined : undefined
    • function: function () {}...
    • Array: []
    • null: null
    • String: var a = new String('qqq')
    • Boolean: var a = new Boolean('qqq')
    • Number: var a = new Number('qqq')
    • object: {} or var a = new Object('qqq')
  • arrayUnique(arr).this method is used to get rid of the repeat.It return a new array.
  • getScrollOffset. this method is used to get the Scrill Offset from the top and left.
  • getViewportOffset.this method is used to get the content's height and width
  • getElementOffset.this method is used to get the location of the element from the top and left.

##Usage

    const { datatype, deppClone } = require('jscommonutils')

    const jscommonutils = require('jscommonutils')
    jscommonutils.datatype()
    jscommonutils.deppClone()
1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago