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

surplus

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

surplus - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

2

es/insert.d.ts

@@ -8,2 +8,2 @@ export interface Range {

export declare type InsertValue = InsertScalarOrArray | (() => InsertValue);
export declare function insert(range: Range, value: InsertValue, exec?: (fn: () => void) => void): Range;
export declare function insert(range: Range, value: InsertValue): Range;

@@ -0,3 +1,4 @@

import { S } from './Surplus';
var DOCUMENT_FRAGMENT_NODE = 11, TEXT_NODE = 3;
export function insert(range, value, exec) {
export function insert(range, value) {
var parent = range.start.parentNode, test = range.start, good = null, t = typeof value;

@@ -40,10 +41,5 @@ //if (parent === null) {

else if (value instanceof Function) {
if (exec) {
exec(function () {
insert(range, value(), exec);
});
}
else {
S(function () {
insert(range, value());
}
});
good = range.end;

@@ -111,2 +107,4 @@ }

if (good === null) {
if (range.end === value)
range.end = value.previousSibling;
parent.replaceChild(value, test);

@@ -124,2 +122,4 @@ range.start = value;

else {
if (range.end === value)
range.end = value.previousSibling;
parent.insertBefore(value, test);

@@ -126,0 +126,0 @@ }

export { insert } from './insert';
export * from './dom';
export { default as S } from 's-js';
export { insert } from './insert';
export * from './dom';
export { default as S } from 's-js';

@@ -184,4 +184,4 @@ export * from './es/Surplus';

interface EventHandler<T extends Event> {
(e : T) : void;
interface EventHandler<T, E extends Event> {
(e : E & { currentTarget: T }) : void;
}

@@ -196,162 +196,162 @@

// Clipboard Events
onCopy?: EventHandler<ClipboardEvent>;
onCopyCapture?: EventHandler<ClipboardEvent>;
onCut?: EventHandler<ClipboardEvent>;
onCutCapture?: EventHandler<ClipboardEvent>;
onPaste?: EventHandler<ClipboardEvent>;
onPasteCapture?: EventHandler<ClipboardEvent>;
onCopy?: EventHandler<T, ClipboardEvent>;
onCopyCapture?: EventHandler<T, ClipboardEvent>;
onCut?: EventHandler<T, ClipboardEvent>;
onCutCapture?: EventHandler<T, ClipboardEvent>;
onPaste?: EventHandler<T, ClipboardEvent>;
onPasteCapture?: EventHandler<T, ClipboardEvent>;
// Composition Events
onCompositionEnd?: EventHandler<CompositionEvent>;
onCompositionEndCapture?: EventHandler<CompositionEvent>;
onCompositionStart?: EventHandler<CompositionEvent>;
onCompositionStartCapture?: EventHandler<CompositionEvent>;
onCompositionUpdate?: EventHandler<CompositionEvent>;
onCompositionUpdateCapture?: EventHandler<CompositionEvent>;
onCompositionEnd?: EventHandler<T, CompositionEvent>;
onCompositionEndCapture?: EventHandler<T, CompositionEvent>;
onCompositionStart?: EventHandler<T, CompositionEvent>;
onCompositionStartCapture?: EventHandler<T, CompositionEvent>;
onCompositionUpdate?: EventHandler<T, CompositionEvent>;
onCompositionUpdateCapture?: EventHandler<T, CompositionEvent>;
// Focus Events
onFocus?: EventHandler<FocusEvent>;
onFocusCapture?: EventHandler<FocusEvent>;
onBlur?: EventHandler<FocusEvent>;
onBlurCapture?: EventHandler<FocusEvent>;
onFocus?: EventHandler<T, FocusEvent>;
onFocusCapture?: EventHandler<T, FocusEvent>;
onBlur?: EventHandler<T, FocusEvent>;
onBlurCapture?: EventHandler<T, FocusEvent>;
// Form Events
//onChange?: EventHandler<FormEvent>;
//onChangeCapture?: EventHandler<FormEvent>;
//onInput?: EventHandler<FormEvent>;
//onInputCapture?: EventHandler<FormEvent>;
//onReset?: EventHandler<FormEvent>;
//onResetCapture?: EventHandler<FormEvent>;
//onSubmit?: EventHandler<FormEvent>;
//onSubmitCapture?: EventHandler<FormEvent>;
onChange?: EventHandler<T, Event>;
onChangeCapture?: EventHandler<T, Event>;
onInput?: EventHandler<T, Event>;
onInputCapture?: EventHandler<T, Event>;
onReset?: EventHandler<T, Event>;
onResetCapture?: EventHandler<T, Event>;
onSubmit?: EventHandler<T, Event>;
onSubmitCapture?: EventHandler<T, Event>;
// Image Events
onLoad?: EventHandler<Event>;
onLoadCapture?: EventHandler<Event>;
onError?: EventHandler<Event>; // also a Media Event
onErrorCapture?: EventHandler<Event>; // also a Media Event
onLoad?: EventHandler<T, Event>;
onLoadCapture?: EventHandler<T, Event>;
onError?: EventHandler<T, Event>; // also a Media Event
onErrorCapture?: EventHandler<T, Event>; // also a Media Event
// Keyboard Events
onKeyDown?: EventHandler<KeyboardEvent>;
onKeyDownCapture?: EventHandler<KeyboardEvent>;
onKeyPress?: EventHandler<KeyboardEvent>;
onKeyPressCapture?: EventHandler<KeyboardEvent>;
onKeyUp?: EventHandler<KeyboardEvent>;
onKeyUpCapture?: EventHandler<KeyboardEvent>;
onKeyDown?: EventHandler<T, KeyboardEvent>;
onKeyDownCapture?: EventHandler<T, KeyboardEvent>;
onKeyPress?: EventHandler<T, KeyboardEvent>;
onKeyPressCapture?: EventHandler<T, KeyboardEvent>;
onKeyUp?: EventHandler<T, KeyboardEvent>;
onKeyUpCapture?: EventHandler<T, KeyboardEvent>;
// Media Events
onAbort?: EventHandler<Event>;
onAbortCapture?: EventHandler<Event>;
onCanPlay?: EventHandler<Event>;
onCanPlayCapture?: EventHandler<Event>;
onCanPlayThrough?: EventHandler<Event>;
onCanPlayThroughCapture?: EventHandler<Event>;
onDurationChange?: EventHandler<Event>;
onDurationChangeCapture?: EventHandler<Event>;
onEmptied?: EventHandler<Event>;
onEmptiedCapture?: EventHandler<Event>;
onEncrypted?: EventHandler<Event>;
onEncryptedCapture?: EventHandler<Event>;
onEnded?: EventHandler<Event>;
onEndedCapture?: EventHandler<Event>;
onLoadedData?: EventHandler<Event>;
onLoadedDataCapture?: EventHandler<Event>;
onLoadedMetadata?: EventHandler<Event>;
onLoadedMetadataCapture?: EventHandler<Event>;
onLoadStart?: EventHandler<Event>;
onLoadStartCapture?: EventHandler<Event>;
onPause?: EventHandler<Event>;
onPauseCapture?: EventHandler<Event>;
onPlay?: EventHandler<Event>;
onPlayCapture?: EventHandler<Event>;
onPlaying?: EventHandler<Event>;
onPlayingCapture?: EventHandler<Event>;
onProgress?: EventHandler<Event>;
onProgressCapture?: EventHandler<Event>;
onRateChange?: EventHandler<Event>;
onRateChangeCapture?: EventHandler<Event>;
onSeeked?: EventHandler<Event>;
onSeekedCapture?: EventHandler<Event>;
onSeeking?: EventHandler<Event>;
onSeekingCapture?: EventHandler<Event>;
onStalled?: EventHandler<Event>;
onStalledCapture?: EventHandler<Event>;
onSuspend?: EventHandler<Event>;
onSuspendCapture?: EventHandler<Event>;
onTimeUpdate?: EventHandler<Event>;
onTimeUpdateCapture?: EventHandler<Event>;
onVolumeChange?: EventHandler<Event>;
onVolumeChangeCapture?: EventHandler<Event>;
onWaiting?: EventHandler<Event>;
onWaitingCapture?: EventHandler<Event>;
onAbort?: EventHandler<T, Event>;
onAbortCapture?: EventHandler<T, Event>;
onCanPlay?: EventHandler<T, Event>;
onCanPlayCapture?: EventHandler<T, Event>;
onCanPlayThrough?: EventHandler<T, Event>;
onCanPlayThroughCapture?: EventHandler<T, Event>;
onDurationChange?: EventHandler<T, Event>;
onDurationChangeCapture?: EventHandler<T, Event>;
onEmptied?: EventHandler<T, Event>;
onEmptiedCapture?: EventHandler<T, Event>;
onEncrypted?: EventHandler<T, Event>;
onEncryptedCapture?: EventHandler<T, Event>;
onEnded?: EventHandler<T, Event>;
onEndedCapture?: EventHandler<T, Event>;
onLoadedData?: EventHandler<T, Event>;
onLoadedDataCapture?: EventHandler<T, Event>;
onLoadedMetadata?: EventHandler<T, Event>;
onLoadedMetadataCapture?: EventHandler<T, Event>;
onLoadStart?: EventHandler<T, Event>;
onLoadStartCapture?: EventHandler<T, Event>;
onPause?: EventHandler<T, Event>;
onPauseCapture?: EventHandler<T, Event>;
onPlay?: EventHandler<T, Event>;
onPlayCapture?: EventHandler<T, Event>;
onPlaying?: EventHandler<T, Event>;
onPlayingCapture?: EventHandler<T, Event>;
onProgress?: EventHandler<T, Event>;
onProgressCapture?: EventHandler<T, Event>;
onRateChange?: EventHandler<T, Event>;
onRateChangeCapture?: EventHandler<T, Event>;
onSeeked?: EventHandler<T, Event>;
onSeekedCapture?: EventHandler<T, Event>;
onSeeking?: EventHandler<T, Event>;
onSeekingCapture?: EventHandler<T, Event>;
onStalled?: EventHandler<T, Event>;
onStalledCapture?: EventHandler<T, Event>;
onSuspend?: EventHandler<T, Event>;
onSuspendCapture?: EventHandler<T, Event>;
onTimeUpdate?: EventHandler<T, Event>;
onTimeUpdateCapture?: EventHandler<T, Event>;
onVolumeChange?: EventHandler<T, Event>;
onVolumeChangeCapture?: EventHandler<T, Event>;
onWaiting?: EventHandler<T, Event>;
onWaitingCapture?: EventHandler<T, Event>;
// MouseEvents
onClick?: EventHandler<MouseEvent>;
onClickCapture?: EventHandler<MouseEvent>;
onContextMenu?: EventHandler<MouseEvent>;
onContextMenuCapture?: EventHandler<MouseEvent>;
onDoubleClick?: EventHandler<MouseEvent>;
onDoubleClickCapture?: EventHandler<MouseEvent>;
onDrag?: EventHandler<DragEvent>;
onDragCapture?: EventHandler<DragEvent>;
onDragEnd?: EventHandler<DragEvent>;
onDragEndCapture?: EventHandler<DragEvent>;
onDragEnter?: EventHandler<DragEvent>;
onDragEnterCapture?: EventHandler<DragEvent>;
onDragExit?: EventHandler<DragEvent>;
onDragExitCapture?: EventHandler<DragEvent>;
onDragLeave?: EventHandler<DragEvent>;
onDragLeaveCapture?: EventHandler<DragEvent>;
onDragOver?: EventHandler<DragEvent>;
onDragOverCapture?: EventHandler<DragEvent>;
onDragStart?: EventHandler<DragEvent>;
onDragStartCapture?: EventHandler<DragEvent>;
onDrop?: EventHandler<DragEvent>;
onDropCapture?: EventHandler<DragEvent>;
onMouseDown?: EventHandler<MouseEvent>;
onMouseDownCapture?: EventHandler<MouseEvent>;
onMouseEnter?: EventHandler<MouseEvent>;
onMouseLeave?: EventHandler<MouseEvent>;
onMouseMove?: EventHandler<MouseEvent>;
onMouseMoveCapture?: EventHandler<MouseEvent>;
onMouseOut?: EventHandler<MouseEvent>;
onMouseOutCapture?: EventHandler<MouseEvent>;
onMouseOver?: EventHandler<MouseEvent>;
onMouseOverCapture?: EventHandler<MouseEvent>;
onMouseUp?: EventHandler<MouseEvent>;
onMouseUpCapture?: EventHandler<MouseEvent>;
onClick?: EventHandler<T, MouseEvent>;
onClickCapture?: EventHandler<T, MouseEvent>;
onContextMenu?: EventHandler<T, MouseEvent>;
onContextMenuCapture?: EventHandler<T, MouseEvent>;
onDoubleClick?: EventHandler<T, MouseEvent>;
onDoubleClickCapture?: EventHandler<T, MouseEvent>;
onDrag?: EventHandler<T, DragEvent>;
onDragCapture?: EventHandler<T, DragEvent>;
onDragEnd?: EventHandler<T, DragEvent>;
onDragEndCapture?: EventHandler<T, DragEvent>;
onDragEnter?: EventHandler<T, DragEvent>;
onDragEnterCapture?: EventHandler<T, DragEvent>;
onDragExit?: EventHandler<T, DragEvent>;
onDragExitCapture?: EventHandler<T, DragEvent>;
onDragLeave?: EventHandler<T, DragEvent>;
onDragLeaveCapture?: EventHandler<T, DragEvent>;
onDragOver?: EventHandler<T, DragEvent>;
onDragOverCapture?: EventHandler<T, DragEvent>;
onDragStart?: EventHandler<T, DragEvent>;
onDragStartCapture?: EventHandler<T, DragEvent>;
onDrop?: EventHandler<T, DragEvent>;
onDropCapture?: EventHandler<T, DragEvent>;
onMouseDown?: EventHandler<T, MouseEvent>;
onMouseDownCapture?: EventHandler<T, MouseEvent>;
onMouseEnter?: EventHandler<T, MouseEvent>;
onMouseLeave?: EventHandler<T, MouseEvent>;
onMouseMove?: EventHandler<T, MouseEvent>;
onMouseMoveCapture?: EventHandler<T, MouseEvent>;
onMouseOut?: EventHandler<T, MouseEvent>;
onMouseOutCapture?: EventHandler<T, MouseEvent>;
onMouseOver?: EventHandler<T, MouseEvent>;
onMouseOverCapture?: EventHandler<T, MouseEvent>;
onMouseUp?: EventHandler<T, MouseEvent>;
onMouseUpCapture?: EventHandler<T, MouseEvent>;
// Selection Events
onSelect?: EventHandler<Event>;
onSelectCapture?: EventHandler<Event>;
onSelect?: EventHandler<T, Event>;
onSelectCapture?: EventHandler<T, Event>;
// Touch Events
onTouchCancel?: EventHandler<TouchEvent>;
onTouchCancelCapture?: EventHandler<TouchEvent>;
onTouchEnd?: EventHandler<TouchEvent>;
onTouchEndCapture?: EventHandler<TouchEvent>;
onTouchMove?: EventHandler<TouchEvent>;
onTouchMoveCapture?: EventHandler<TouchEvent>;
onTouchStart?: EventHandler<TouchEvent>;
onTouchStartCapture?: EventHandler<TouchEvent>;
onTouchCancel?: EventHandler<T, TouchEvent>;
onTouchCancelCapture?: EventHandler<T, TouchEvent>;
onTouchEnd?: EventHandler<T, TouchEvent>;
onTouchEndCapture?: EventHandler<T, TouchEvent>;
onTouchMove?: EventHandler<T, TouchEvent>;
onTouchMoveCapture?: EventHandler<T, TouchEvent>;
onTouchStart?: EventHandler<T, TouchEvent>;
onTouchStartCapture?: EventHandler<T, TouchEvent>;
// UI Events
onScroll?: EventHandler<UIEvent>;
onScrollCapture?: EventHandler<UIEvent>;
onScroll?: EventHandler<T, UIEvent>;
onScrollCapture?: EventHandler<T, UIEvent>;
// Wheel Events
onWheel?: EventHandler<WheelEvent>;
onWheelCapture?: EventHandler<WheelEvent>;
onWheel?: EventHandler<T, WheelEvent>;
onWheelCapture?: EventHandler<T, WheelEvent>;
// Animation Events
onAnimationStart?: EventHandler<AnimationEvent>;
onAnimationStartCapture?: EventHandler<AnimationEvent>;
onAnimationEnd?: EventHandler<AnimationEvent>;
onAnimationEndCapture?: EventHandler<AnimationEvent>;
onAnimationIteration?: EventHandler<AnimationEvent>;
onAnimationIterationCapture?: EventHandler<AnimationEvent>;
onAnimationStart?: EventHandler<T, AnimationEvent>;
onAnimationStartCapture?: EventHandler<T, AnimationEvent>;
onAnimationEnd?: EventHandler<T, AnimationEvent>;
onAnimationEndCapture?: EventHandler<T, AnimationEvent>;
onAnimationIteration?: EventHandler<T, AnimationEvent>;
onAnimationIterationCapture?: EventHandler<T, AnimationEvent>;
// Transition Events
onTransitionEnd?: EventHandler<TransitionEvent>;
onTransitionEndCapture?: EventHandler<TransitionEvent>;
onTransitionEnd?: EventHandler<T, TransitionEvent>;
onTransitionEndCapture?: EventHandler<T, TransitionEvent>;
}

@@ -358,0 +358,0 @@

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.Surplus = global.Surplus || {})));
}(this, (function (exports) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('s-js')) :
typeof define === 'function' && define.amd ? define(['exports', 's-js'], factory) :
(factory((global.Surplus = global.Surplus || {}),global.S));
}(this, (function (exports,S) { 'use strict';
S = 'default' in S ? S['default'] : S;
var TEXT_NODE = 3;
function insert(range, value, exec) {
function insert$$1(range, value) {
var parent = range.start.parentNode, test = range.start, good = null, t = typeof value;

@@ -46,10 +48,5 @@ //if (parent === null) {

else if (value instanceof Function) {
if (exec) {
exec(function () {
insert(range, value(), exec);
});
}
else {
insert(range, value());
}
S(function () {
insert$$1(range, value());
});
good = range.end;

@@ -117,2 +114,4 @@ }

if (good === null) {
if (range.end === value)
range.end = value.previousSibling;
parent.replaceChild(value, test);

@@ -130,2 +129,4 @@ range.start = value;

else {
if (range.end === value)
range.end = value.previousSibling;
parent.insertBefore(value, test);

@@ -177,3 +178,4 @@ }

exports.insert = insert;
exports.insert = insert$$1;
exports.S = S;
exports.createElement = createElement;

@@ -180,0 +182,0 @@ exports.createComment = createComment;

{
"name": "surplus",
"version": "0.4.2",
"version": "0.4.3",
"module": "es/Surplus.js",

@@ -14,4 +14,7 @@ "description": "Javascript pre-processor that converts JSX syntax into inline DOM instructions",

],
"dependencies": {
"s-js": "^0.4.3"
},
"author": "Adam Haile",
"license": "MIT"
}
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